Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ice: add flow parsing for GTP and new protocol field support

Introduce new protocol header types and field sizes to support GTPU, GTPC
tunneling protocols.

- Add field size macros for GTP TEID, QFI, and other headers
- Extend ice_flow_field_info and enum definitions
- Update hash macros for new protocols
- Add support for IPv6 prefix matching and fragment headers

This patch lays the groundwork for enhanced RSS and flow classification
capabilities.

Co-developed-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Co-developed-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Co-developed-by: Ting Xu <ting.xu@intel.com>
Signed-off-by: Ting Xu <ting.xu@intel.com>
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>

authored by

Aleksandr Loktionov and committed by
Tony Nguyen
12ed3e5a 2c031d4c

+322 -9
+212 -5
drivers/net/ethernet/intel/ice/ice_flow.c
··· 5 5 #include "ice_flow.h" 6 6 #include <net/gre.h> 7 7 8 + /* Size of known protocol header fields */ 9 + #define ICE_FLOW_FLD_SZ_ETH_TYPE 2 10 + #define ICE_FLOW_FLD_SZ_VLAN 2 11 + #define ICE_FLOW_FLD_SZ_IPV4_ADDR 4 12 + #define ICE_FLOW_FLD_SZ_IPV6_ADDR 16 13 + #define ICE_FLOW_FLD_SZ_IPV6_PRE32_ADDR 4 14 + #define ICE_FLOW_FLD_SZ_IPV6_PRE48_ADDR 6 15 + #define ICE_FLOW_FLD_SZ_IPV6_PRE64_ADDR 8 16 + #define ICE_FLOW_FLD_SZ_IPV4_ID 2 17 + #define ICE_FLOW_FLD_SZ_IPV6_ID 4 18 + #define ICE_FLOW_FLD_SZ_IP_CHKSUM 2 19 + #define ICE_FLOW_FLD_SZ_TCP_CHKSUM 2 20 + #define ICE_FLOW_FLD_SZ_UDP_CHKSUM 2 21 + #define ICE_FLOW_FLD_SZ_SCTP_CHKSUM 4 22 + #define ICE_FLOW_FLD_SZ_IP_DSCP 1 23 + #define ICE_FLOW_FLD_SZ_IP_TTL 1 24 + #define ICE_FLOW_FLD_SZ_IP_PROT 1 25 + #define ICE_FLOW_FLD_SZ_PORT 2 26 + #define ICE_FLOW_FLD_SZ_TCP_FLAGS 1 27 + #define ICE_FLOW_FLD_SZ_ICMP_TYPE 1 28 + #define ICE_FLOW_FLD_SZ_ICMP_CODE 1 29 + #define ICE_FLOW_FLD_SZ_ARP_OPER 2 30 + #define ICE_FLOW_FLD_SZ_GRE_KEYID 4 31 + #define ICE_FLOW_FLD_SZ_GTP_TEID 4 32 + #define ICE_FLOW_FLD_SZ_GTP_QFI 2 33 + #define ICE_FLOW_FLD_SZ_PFCP_SEID 8 34 + #define ICE_FLOW_FLD_SZ_ESP_SPI 4 35 + #define ICE_FLOW_FLD_SZ_AH_SPI 4 36 + #define ICE_FLOW_FLD_SZ_NAT_T_ESP_SPI 4 37 + #define ICE_FLOW_FLD_SZ_L2TPV2_SESS_ID 2 38 + #define ICE_FLOW_FLD_SZ_L2TPV2_LEN_SESS_ID 2 39 + 8 40 /* Describe properties of a protocol header field */ 9 41 struct ice_flow_field_info { 10 42 enum ice_flow_seg_hdr hdr; ··· 52 20 .mask = 0, \ 53 21 } 54 22 23 + /* QFI: 6-bit field in GTP-U PDU Session Container (3GPP TS 38.415) */ 55 24 #define ICE_FLOW_FLD_INFO_MSK(_hdr, _offset_bytes, _size_bytes, _mask) { \ 56 25 .hdr = _hdr, \ 57 26 .off = (_offset_bytes) * BITS_PER_BYTE, \ ··· 94 61 /* ICE_FLOW_FIELD_IDX_IPV6_SA */ 95 62 ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 8, sizeof(struct in6_addr)), 96 63 /* ICE_FLOW_FIELD_IDX_IPV6_DA */ 97 - ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 24, sizeof(struct in6_addr)), 64 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 24, ICE_FLOW_FLD_SZ_IPV6_ADDR), 65 + /* ICE_FLOW_FIELD_IDX_IPV4_CHKSUM */ 66 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV4, 10, ICE_FLOW_FLD_SZ_IP_CHKSUM), 67 + /* ICE_FLOW_FIELD_IDX_IPV4_FRAG */ 68 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV_FRAG, 4, 69 + ICE_FLOW_FLD_SZ_IPV4_ID), 70 + /* ICE_FLOW_FIELD_IDX_IPV6_FRAG */ 71 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV_FRAG, 4, 72 + ICE_FLOW_FLD_SZ_IPV6_ID), 73 + /* ICE_FLOW_FIELD_IDX_IPV6_PRE32_SA */ 74 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 8, 75 + ICE_FLOW_FLD_SZ_IPV6_PRE32_ADDR), 76 + /* ICE_FLOW_FIELD_IDX_IPV6_PRE32_DA */ 77 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 24, 78 + ICE_FLOW_FLD_SZ_IPV6_PRE32_ADDR), 79 + /* ICE_FLOW_FIELD_IDX_IPV6_PRE48_SA */ 80 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 8, 81 + ICE_FLOW_FLD_SZ_IPV6_PRE48_ADDR), 82 + /* ICE_FLOW_FIELD_IDX_IPV6_PRE48_DA */ 83 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 24, 84 + ICE_FLOW_FLD_SZ_IPV6_PRE48_ADDR), 85 + /* ICE_FLOW_FIELD_IDX_IPV6_PRE64_SA */ 86 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 8, 87 + ICE_FLOW_FLD_SZ_IPV6_PRE64_ADDR), 88 + /* ICE_FLOW_FIELD_IDX_IPV6_PRE64_DA */ 89 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 24, 90 + ICE_FLOW_FLD_SZ_IPV6_PRE64_ADDR), 98 91 /* Transport */ 99 92 /* ICE_FLOW_FIELD_IDX_TCP_SRC_PORT */ 100 93 ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_TCP, 0, sizeof(__be16)), ··· 135 76 /* ICE_FLOW_FIELD_IDX_SCTP_DST_PORT */ 136 77 ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_SCTP, 2, sizeof(__be16)), 137 78 /* ICE_FLOW_FIELD_IDX_TCP_FLAGS */ 138 - ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_TCP, 13, 1), 79 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_TCP, 13, ICE_FLOW_FLD_SZ_TCP_FLAGS), 80 + /* ICE_FLOW_FIELD_IDX_TCP_CHKSUM */ 81 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_TCP, 16, ICE_FLOW_FLD_SZ_TCP_CHKSUM), 82 + /* ICE_FLOW_FIELD_IDX_UDP_CHKSUM */ 83 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_UDP, 6, ICE_FLOW_FLD_SZ_UDP_CHKSUM), 84 + /* ICE_FLOW_FIELD_IDX_SCTP_CHKSUM */ 85 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_SCTP, 8, 86 + ICE_FLOW_FLD_SZ_SCTP_CHKSUM), 139 87 /* ARP */ 140 88 /* ICE_FLOW_FIELD_IDX_ARP_SIP */ 141 89 ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_ARP, 14, sizeof(struct in_addr)), ··· 174 108 ICE_FLOW_FLD_INFO_MSK(ICE_FLOW_SEG_HDR_GTPU_EH, 22, sizeof(__be16), 175 109 0x3f00), 176 110 /* ICE_FLOW_FIELD_IDX_GTPU_UP_TEID */ 177 - ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_GTPU_UP, 12, sizeof(__be32)), 111 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_GTPU_UP, 12, 112 + ICE_FLOW_FLD_SZ_GTP_TEID), 113 + /* ICE_FLOW_FIELD_IDX_GTPU_UP_QFI */ 114 + ICE_FLOW_FLD_INFO_MSK(ICE_FLOW_SEG_HDR_GTPU_UP, 22, 115 + ICE_FLOW_FLD_SZ_GTP_QFI, 0x3f00), 178 116 /* ICE_FLOW_FIELD_IDX_GTPU_DWN_TEID */ 179 - ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_GTPU_DWN, 12, sizeof(__be32)), 117 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_GTPU_DWN, 12, 118 + ICE_FLOW_FLD_SZ_GTP_TEID), 119 + /* ICE_FLOW_FIELD_IDX_GTPU_DWN_QFI */ 120 + ICE_FLOW_FLD_INFO_MSK(ICE_FLOW_SEG_HDR_GTPU_DWN, 22, 121 + ICE_FLOW_FLD_SZ_GTP_QFI, 0x3f00), 180 122 /* PPPoE */ 181 123 /* ICE_FLOW_FIELD_IDX_PPPOE_SESS_ID */ 182 124 ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_PPPOE, 2, sizeof(__be16)), ··· 202 128 ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_AH, 4, sizeof(__be32)), 203 129 /* NAT_T_ESP */ 204 130 /* ICE_FLOW_FIELD_IDX_NAT_T_ESP_SPI */ 205 - ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_NAT_T_ESP, 8, sizeof(__be32)), 131 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_NAT_T_ESP, 8, 132 + ICE_FLOW_FLD_SZ_NAT_T_ESP_SPI), 133 + /* L2TPV2 */ 134 + /* ICE_FLOW_FIELD_IDX_L2TPV2_SESS_ID */ 135 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_L2TPV2, 12, 136 + ICE_FLOW_FLD_SZ_L2TPV2_SESS_ID), 137 + /* L2TPV2_LEN */ 138 + /* ICE_FLOW_FIELD_IDX_L2TPV2_LEN_SESS_ID */ 139 + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_L2TPV2, 14, 140 + ICE_FLOW_FLD_SZ_L2TPV2_LEN_SESS_ID), 206 141 }; 207 142 208 143 /* Bitmaps indicating relevant packet types for a particular protocol header ··· 2405 2322 ice_rss_config_xor(hw, prof_id, 2406 2323 sctp_src->idx, sctp_dst->idx, 1); 2407 2324 } 2325 + } 2326 + 2327 + /** 2328 + * ice_rss_cfg_raw_symm - Configure symmetric RSS for a raw parser profile 2329 + * @hw: device HW 2330 + * @prof: parser profile describing extracted FV (field vector) entries 2331 + * @prof_id: RSS profile identifier used to program symmetry registers 2332 + * 2333 + * The routine scans the parser profile's FV entries and looks for 2334 + * direction-sensitive pairs (L3 src/dst, L4 src/dst). When a pair is found, 2335 + * it programs XOR-based symmetry so that flows hash identically regardless 2336 + * of packet direction. This preserves CPU affinity for the same 5-tuple. 2337 + * 2338 + * Notes: 2339 + * - The size of each logical field (IPv4/IPv6 address, L4 port) is expressed 2340 + * in units of ICE_FLOW_FV_EXTRACT_SZ so we can step across fv[] correctly. 2341 + * - We guard against out-of-bounds access before looking at fv[i + len]. 2342 + */ 2343 + static void ice_rss_cfg_raw_symm(struct ice_hw *hw, 2344 + const struct ice_parser_profile *prof, 2345 + u64 prof_id) 2346 + { 2347 + for (size_t i = 0; i < prof->fv_num; i++) { 2348 + u8 proto_id = prof->fv[i].proto_id; 2349 + u16 src_off = 0, dst_off = 0; 2350 + size_t src_idx, dst_idx; 2351 + bool is_matched = false; 2352 + unsigned int len = 0; 2353 + 2354 + switch (proto_id) { 2355 + /* IPv4 address pairs (outer/inner variants) */ 2356 + case ICE_PROT_IPV4_OF_OR_S: 2357 + case ICE_PROT_IPV4_IL: 2358 + case ICE_PROT_IPV4_IL_IL: 2359 + len = ICE_FLOW_FLD_SZ_IPV4_ADDR / 2360 + ICE_FLOW_FV_EXTRACT_SZ; 2361 + src_off = ICE_FLOW_FIELD_IPV4_SRC_OFFSET; 2362 + dst_off = ICE_FLOW_FIELD_IPV4_DST_OFFSET; 2363 + break; 2364 + 2365 + /* IPv6 address pairs (outer/inner variants) */ 2366 + case ICE_PROT_IPV6_OF_OR_S: 2367 + case ICE_PROT_IPV6_IL: 2368 + case ICE_PROT_IPV6_IL_IL: 2369 + len = ICE_FLOW_FLD_SZ_IPV6_ADDR / 2370 + ICE_FLOW_FV_EXTRACT_SZ; 2371 + src_off = ICE_FLOW_FIELD_IPV6_SRC_OFFSET; 2372 + dst_off = ICE_FLOW_FIELD_IPV6_DST_OFFSET; 2373 + break; 2374 + 2375 + /* L4 port pairs (TCP/UDP/SCTP) */ 2376 + case ICE_PROT_TCP_IL: 2377 + case ICE_PROT_UDP_IL_OR_S: 2378 + case ICE_PROT_SCTP_IL: 2379 + len = ICE_FLOW_FLD_SZ_PORT / ICE_FLOW_FV_EXTRACT_SZ; 2380 + src_off = ICE_FLOW_FIELD_SRC_PORT_OFFSET; 2381 + dst_off = ICE_FLOW_FIELD_DST_PORT_OFFSET; 2382 + break; 2383 + 2384 + default: 2385 + continue; 2386 + } 2387 + 2388 + /* Bounds check before accessing fv[i + len]. */ 2389 + if (i + len >= prof->fv_num) 2390 + continue; 2391 + 2392 + /* Verify src/dst pairing for this protocol id. */ 2393 + is_matched = prof->fv[i].offset == src_off && 2394 + prof->fv[i + len].proto_id == proto_id && 2395 + prof->fv[i + len].offset == dst_off; 2396 + if (!is_matched) 2397 + continue; 2398 + 2399 + /* Program XOR symmetry for this field pair. */ 2400 + src_idx = i; 2401 + dst_idx = i + len; 2402 + 2403 + ice_rss_config_xor(hw, prof_id, src_idx, dst_idx, len); 2404 + 2405 + /* Skip over the pair we just handled; the loop's ++i advances 2406 + * one more element, hence the --i after the jump. 2407 + */ 2408 + i += (2 * len); 2409 + /* not strictly needed; keeps static analyzers happy */ 2410 + if (i == 0) 2411 + break; 2412 + --i; 2413 + } 2414 + } 2415 + 2416 + /* Max registers index per packet profile */ 2417 + #define ICE_SYMM_REG_INDEX_MAX 6 2418 + 2419 + /** 2420 + * ice_rss_update_raw_symm - update symmetric hash configuration 2421 + * for raw pattern 2422 + * @hw: pointer to the hardware structure 2423 + * @cfg: configure parameters for raw pattern 2424 + * @id: profile tracking ID 2425 + * 2426 + * Update symmetric hash configuration for raw pattern if required. 2427 + * Otherwise only clear to default. 2428 + */ 2429 + void 2430 + ice_rss_update_raw_symm(struct ice_hw *hw, 2431 + struct ice_rss_raw_cfg *cfg, u64 id) 2432 + { 2433 + struct ice_prof_map *map; 2434 + u8 prof_id, m; 2435 + 2436 + mutex_lock(&hw->blk[ICE_BLK_RSS].es.prof_map_lock); 2437 + map = ice_search_prof_id(hw, ICE_BLK_RSS, id); 2438 + if (map) 2439 + prof_id = map->prof_id; 2440 + mutex_unlock(&hw->blk[ICE_BLK_RSS].es.prof_map_lock); 2441 + if (!map) 2442 + return; 2443 + /* clear to default */ 2444 + for (m = 0; m < ICE_SYMM_REG_INDEX_MAX; m++) 2445 + wr32(hw, GLQF_HSYMM(prof_id, m), 0); 2446 + 2447 + if (cfg->symm) 2448 + ice_rss_cfg_raw_symm(hw, &cfg->prof, prof_id); 2408 2449 } 2409 2450 2410 2451 /**
+90 -4
drivers/net/ethernet/intel/ice/ice_flow.h
··· 22 22 #define ICE_FLOW_HASH_IPV6 \ 23 23 (BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA) | \ 24 24 BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_DA)) 25 + #define ICE_FLOW_HASH_IPV6_PRE32 \ 26 + (BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE32_SA) | \ 27 + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE32_DA)) 28 + #define ICE_FLOW_HASH_IPV6_PRE48 \ 29 + (BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE48_SA) | \ 30 + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE48_DA)) 31 + #define ICE_FLOW_HASH_IPV6_PRE64 \ 32 + (BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE64_SA) | \ 33 + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE64_DA)) 25 34 #define ICE_FLOW_HASH_TCP_PORT \ 26 35 (BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_SRC_PORT) | \ 27 36 BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_DST_PORT)) ··· 48 39 #define ICE_HASH_UDP_IPV6 (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_UDP_PORT) 49 40 #define ICE_HASH_SCTP_IPV4 (ICE_FLOW_HASH_IPV4 | ICE_FLOW_HASH_SCTP_PORT) 50 41 #define ICE_HASH_SCTP_IPV6 (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_SCTP_PORT) 42 + 43 + #define ICE_HASH_TCP_IPV6_PRE32 \ 44 + (ICE_FLOW_HASH_IPV6_PRE32 | ICE_FLOW_HASH_TCP_PORT) 45 + #define ICE_HASH_UDP_IPV6_PRE32 \ 46 + (ICE_FLOW_HASH_IPV6_PRE32 | ICE_FLOW_HASH_UDP_PORT) 47 + #define ICE_HASH_SCTP_IPV6_PRE32 \ 48 + (ICE_FLOW_HASH_IPV6_PRE32 | ICE_FLOW_HASH_SCTP_PORT) 49 + #define ICE_HASH_TCP_IPV6_PRE48 \ 50 + (ICE_FLOW_HASH_IPV6_PRE48 | ICE_FLOW_HASH_TCP_PORT) 51 + #define ICE_HASH_UDP_IPV6_PRE48 \ 52 + (ICE_FLOW_HASH_IPV6_PRE48 | ICE_FLOW_HASH_UDP_PORT) 53 + #define ICE_HASH_SCTP_IPV6_PRE48 \ 54 + (ICE_FLOW_HASH_IPV6_PRE48 | ICE_FLOW_HASH_SCTP_PORT) 55 + #define ICE_HASH_TCP_IPV6_PRE64 \ 56 + (ICE_FLOW_HASH_IPV6_PRE64 | ICE_FLOW_HASH_TCP_PORT) 57 + #define ICE_HASH_UDP_IPV6_PRE64 \ 58 + (ICE_FLOW_HASH_IPV6_PRE64 | ICE_FLOW_HASH_UDP_PORT) 59 + #define ICE_HASH_SCTP_IPV6_PRE64 \ 60 + (ICE_FLOW_HASH_IPV6_PRE64 | ICE_FLOW_HASH_SCTP_PORT) 61 + 62 + #define ICE_FLOW_HASH_GTP_TEID \ 63 + (BIT_ULL(ICE_FLOW_FIELD_IDX_GTPC_TEID)) 64 + 65 + #define ICE_FLOW_HASH_GTP_IPV4_TEID \ 66 + (ICE_FLOW_HASH_IPV4 | ICE_FLOW_HASH_GTP_TEID) 67 + #define ICE_FLOW_HASH_GTP_IPV6_TEID \ 68 + (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_GTP_TEID) 51 69 52 70 #define ICE_FLOW_HASH_GTP_C_TEID \ 53 71 (BIT_ULL(ICE_FLOW_FIELD_IDX_GTPC_TEID)) ··· 164 128 #define ICE_FLOW_HASH_NAT_T_ESP_IPV6_SPI \ 165 129 (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_NAT_T_ESP_SPI) 166 130 131 + #define ICE_FLOW_HASH_L2TPV2_SESS_ID \ 132 + (BIT_ULL(ICE_FLOW_FIELD_IDX_L2TPV2_SESS_ID)) 133 + #define ICE_FLOW_HASH_L2TPV2_SESS_ID_ETH \ 134 + (ICE_FLOW_HASH_ETH | ICE_FLOW_HASH_L2TPV2_SESS_ID) 135 + 136 + #define ICE_FLOW_HASH_L2TPV2_LEN_SESS_ID \ 137 + (BIT_ULL(ICE_FLOW_FIELD_IDX_L2TPV2_LEN_SESS_ID)) 138 + #define ICE_FLOW_HASH_L2TPV2_LEN_SESS_ID_ETH \ 139 + (ICE_FLOW_HASH_ETH | ICE_FLOW_HASH_L2TPV2_LEN_SESS_ID) 140 + 141 + #define ICE_FLOW_FIELD_IPV4_SRC_OFFSET 12 142 + #define ICE_FLOW_FIELD_IPV4_DST_OFFSET 16 143 + #define ICE_FLOW_FIELD_IPV6_SRC_OFFSET 8 144 + #define ICE_FLOW_FIELD_IPV6_DST_OFFSET 24 145 + #define ICE_FLOW_FIELD_SRC_PORT_OFFSET 0 146 + #define ICE_FLOW_FIELD_DST_PORT_OFFSET 2 147 + 167 148 /* Protocol header fields within a packet segment. A segment consists of one or 168 149 * more protocol headers that make up a logical group of protocol headers. Each 169 150 * logical group of protocol headers encapsulates or is encapsulated using/by ··· 213 160 ICE_FLOW_SEG_HDR_AH = 0x00200000, 214 161 ICE_FLOW_SEG_HDR_NAT_T_ESP = 0x00400000, 215 162 ICE_FLOW_SEG_HDR_ETH_NON_IP = 0x00800000, 163 + ICE_FLOW_SEG_HDR_GTPU_NON_IP = 0x01000000, 164 + ICE_FLOW_SEG_HDR_L2TPV2 = 0x10000000, 216 165 /* The following is an additive bit for ICE_FLOW_SEG_HDR_IPV4 and 217 - * ICE_FLOW_SEG_HDR_IPV6 which include the IPV4 other PTYPEs 166 + * ICE_FLOW_SEG_HDR_IPV6. 218 167 */ 219 - ICE_FLOW_SEG_HDR_IPV_OTHER = 0x20000000, 168 + ICE_FLOW_SEG_HDR_IPV_FRAG = 0x40000000, 169 + ICE_FLOW_SEG_HDR_IPV_OTHER = 0x80000000, 220 170 }; 221 171 222 172 /* These segments all have the same PTYPES, but are otherwise distinguished by ··· 256 200 ICE_FLOW_FIELD_IDX_IPV4_DA, 257 201 ICE_FLOW_FIELD_IDX_IPV6_SA, 258 202 ICE_FLOW_FIELD_IDX_IPV6_DA, 203 + ICE_FLOW_FIELD_IDX_IPV4_CHKSUM, 204 + ICE_FLOW_FIELD_IDX_IPV4_ID, 205 + ICE_FLOW_FIELD_IDX_IPV6_ID, 206 + ICE_FLOW_FIELD_IDX_IPV6_PRE32_SA, 207 + ICE_FLOW_FIELD_IDX_IPV6_PRE32_DA, 208 + ICE_FLOW_FIELD_IDX_IPV6_PRE48_SA, 209 + ICE_FLOW_FIELD_IDX_IPV6_PRE48_DA, 210 + ICE_FLOW_FIELD_IDX_IPV6_PRE64_SA, 211 + ICE_FLOW_FIELD_IDX_IPV6_PRE64_DA, 259 212 /* L4 */ 260 213 ICE_FLOW_FIELD_IDX_TCP_SRC_PORT, 261 214 ICE_FLOW_FIELD_IDX_TCP_DST_PORT, ··· 273 208 ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT, 274 209 ICE_FLOW_FIELD_IDX_SCTP_DST_PORT, 275 210 ICE_FLOW_FIELD_IDX_TCP_FLAGS, 211 + ICE_FLOW_FIELD_IDX_TCP_CHKSUM, 212 + ICE_FLOW_FIELD_IDX_UDP_CHKSUM, 213 + ICE_FLOW_FIELD_IDX_SCTP_CHKSUM, 276 214 /* ARP */ 277 215 ICE_FLOW_FIELD_IDX_ARP_SIP, 278 216 ICE_FLOW_FIELD_IDX_ARP_DIP, ··· 296 228 ICE_FLOW_FIELD_IDX_GTPU_EH_QFI, 297 229 /* GTPU_UP */ 298 230 ICE_FLOW_FIELD_IDX_GTPU_UP_TEID, 231 + ICE_FLOW_FIELD_IDX_GTPU_UP_QFI, 299 232 /* GTPU_DWN */ 300 233 ICE_FLOW_FIELD_IDX_GTPU_DWN_TEID, 301 - /* PPPoE */ 234 + ICE_FLOW_FIELD_IDX_GTPU_DWN_QFI, 302 235 ICE_FLOW_FIELD_IDX_PPPOE_SESS_ID, 303 236 /* PFCP */ 304 237 ICE_FLOW_FIELD_IDX_PFCP_SEID, 305 - /* L2TPv3 */ 306 238 ICE_FLOW_FIELD_IDX_L2TPV3_SESS_ID, 307 239 /* ESP */ 308 240 ICE_FLOW_FIELD_IDX_ESP_SPI, ··· 310 242 ICE_FLOW_FIELD_IDX_AH_SPI, 311 243 /* NAT_T ESP */ 312 244 ICE_FLOW_FIELD_IDX_NAT_T_ESP_SPI, 245 + /* L2TPV2 SESSION ID*/ 246 + ICE_FLOW_FIELD_IDX_L2TPV2_SESS_ID, 247 + /* L2TPV2_LEN SESSION ID */ 248 + ICE_FLOW_FIELD_IDX_L2TPV2_LEN_SESS_ID, 313 249 /* The total number of enums must not exceed 64 */ 314 250 ICE_FLOW_FIELD_IDX_MAX 315 251 }; 252 + 253 + static_assert(ICE_FLOW_FIELD_IDX_MAX <= 64, "The total number of enums must not exceed 64"); 316 254 317 255 #define ICE_FLOW_HASH_FLD_IPV4_SA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) 318 256 #define ICE_FLOW_HASH_FLD_IPV6_SA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA) ··· 370 296 /* take inner headers as inputset for packet with outer ipv6. */ 371 297 ICE_RSS_INNER_HEADERS_W_OUTER_IPV6, 372 298 /* take outer headers first then inner headers as inputset */ 299 + /* take inner as inputset for GTPoGRE with outer IPv4 + GRE. */ 300 + ICE_RSS_INNER_HEADERS_W_OUTER_IPV4_GRE, 301 + /* take inner as inputset for GTPoGRE with outer IPv6 + GRE. */ 302 + ICE_RSS_INNER_HEADERS_W_OUTER_IPV6_GRE, 373 303 ICE_RSS_ANY_HEADERS 374 304 }; 375 305 ··· 484 406 bool symm; /* Symmetric Hash for RSS */ 485 407 }; 486 408 409 + struct ice_rss_raw_cfg { 410 + struct ice_parser_profile prof; 411 + bool raw_ena; 412 + bool symm; 413 + }; 414 + 487 415 struct ice_rss_cfg { 488 416 struct list_head l_entry; 489 417 /* bitmap of VSIs added to the RSS entry */ ··· 528 444 int ice_rem_rss_cfg(struct ice_hw *hw, u16 vsi_handle, 529 445 const struct ice_rss_hash_cfg *cfg); 530 446 u64 ice_get_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u32 hdrs, bool *symm); 447 + void ice_rss_update_raw_symm(struct ice_hw *hw, 448 + struct ice_rss_raw_cfg *cfg, u64 id); 531 449 #endif /* _ICE_FLOW_H_ */
+20
drivers/net/ethernet/intel/ice/ice_protocol_type.h
··· 82 82 enum ice_prot_id { 83 83 ICE_PROT_ID_INVAL = 0, 84 84 ICE_PROT_MAC_OF_OR_S = 1, 85 + ICE_PROT_MAC_O2 = 2, 85 86 ICE_PROT_MAC_IL = 4, 87 + ICE_PROT_MAC_IN_MAC = 7, 86 88 ICE_PROT_ETYPE_OL = 9, 87 89 ICE_PROT_ETYPE_IL = 10, 90 + ICE_PROT_PAY = 15, 91 + ICE_PROT_EVLAN_O = 16, 92 + ICE_PROT_VLAN_O = 17, 93 + ICE_PROT_VLAN_IF = 18, 94 + ICE_PROT_MPLS_OL_MINUS_1 = 27, 95 + ICE_PROT_MPLS_OL_OR_OS = 28, 96 + ICE_PROT_MPLS_IL = 29, 88 97 ICE_PROT_IPV4_OF_OR_S = 32, 89 98 ICE_PROT_IPV4_IL = 33, 99 + ICE_PROT_IPV4_IL_IL = 34, 90 100 ICE_PROT_IPV6_OF_OR_S = 40, 91 101 ICE_PROT_IPV6_IL = 41, 102 + ICE_PROT_IPV6_IL_IL = 42, 103 + ICE_PROT_IPV6_NEXT_PROTO = 43, 104 + ICE_PROT_IPV6_FRAG = 47, 92 105 ICE_PROT_TCP_IL = 49, 93 106 ICE_PROT_UDP_OF = 52, 94 107 ICE_PROT_UDP_IL_OR_S = 53, 95 108 ICE_PROT_GRE_OF = 64, 109 + ICE_PROT_NSH_F = 84, 96 110 ICE_PROT_ESP_F = 88, 97 111 ICE_PROT_ESP_2 = 89, 98 112 ICE_PROT_SCTP_IL = 96, 99 113 ICE_PROT_ICMP_IL = 98, 100 114 ICE_PROT_ICMPV6_IL = 100, 115 + ICE_PROT_VRRP_F = 101, 116 + ICE_PROT_OSPF = 102, 101 117 ICE_PROT_PPPOE = 103, 102 118 ICE_PROT_L2TPV3 = 104, 119 + ICE_PROT_ATAOE_OF = 114, 120 + ICE_PROT_CTRL_OF = 116, 121 + ICE_PROT_LLDP_OF = 117, 103 122 ICE_PROT_ARP_OF = 118, 104 123 ICE_PROT_META_ID = 255, /* when offset == metadata */ 124 + ICE_PROT_EAPOL_OF = 120, 105 125 ICE_PROT_INVALID = 255 /* when offset == ICE_FV_OFFSET_INVAL */ 106 126 }; 107 127