[dpdk-dev] [PATCH v2] net/i40e: fix inputset field mask

Xing, Beilei beilei.xing at intel.com
Mon Feb 1 04:26:22 CET 2021



> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Zhang,Alvin
> Sent: Monday, February 1, 2021 10:41 AM
> To: Guo, Jia <jia.guo at intel.com>; Xing, Beilei <beilei.xing at intel.com>; Zhang,
> Qi Z <qi.z.zhang at intel.com>
> Cc: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v2] net/i40e: fix inputset field mask
> 
> From: Alvin Zhang <alvinx.zhang at intel.com>
> 
> The absolute field offsets of IPv4 or IPv6 header are related to hardware
> configuration. The X710 and X722 have different hardware configurations,
> and users can even modify the hardware configuration.
> Therefore, The default values cannot be used when calculating mask offset.
> 
> The following flows can be created on X722 NIC, but the packet will not enter
> the queue 3:
>   flow create 0 ingress pattern eth / ipv4 proto is 255  / end
>   actions queue index 3 / end
>   pkt = Ether()/IP(ttl=63, proto=255)/Raw('X'*40)
> 
>   flow create 0 ingress pattern eth / ipv4 tos is 50 / udp / end
>   actions queue index 3 / end
>   pkt = Ether()/IP(tos=50)/UDP()/Raw('X'*40)
> 
>   flow create 0 ingress pattern eth / ipv6 tc is 12 / udp / end
>   actions queue index 3 / end
>   pkt = Ether()/IPv6(tc=12,hlim=34,fl=0x98765)/UDP()/Raw('X'*40)
> 
>   flow create 0 ingress pattern eth / ipv6 hop is 34 / end actions
>   queue index 3 / end
>   pkt = Ether()/IPv6(tc=12,hlim=34,fl=0x98765)/Raw('X'*40)
> 
> This patch read the field offsets from the NIC and return the mask register
> value.
> 
> Fixes: 98f055707685 ("i40e: configure input fields for RSS or flow director")
> Fixes: 92cf7f8ec082 ("i40e: allow filtering on more IP header fields")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Alvin Zhang <alvinx.zhang at intel.com>
> ---
> 
> v2: Update commit log
> ---
> 
> +static int
> +i40e_fd_get_field_offset(struct i40e_hw *hw, uint32_t pit_reg_start,
It's not only for fdir, but also for RSS, so better to remove '_fd' in the function name. 

> +			 uint32_t pit_reg_count, uint32_t hdr_off) {

Besides, since this patch is too HW specific and large, I suggest we need:
1) regression test first. 
2) verify RSS with private API.
But RC3 is coming, we may have no much time for all tests, so can you submit the patch after 21.02 release?

BR,
Beilei


More information about the dev mailing list