Hi Bruce,

This patch attempts to resolve the SCTP mismatching on 82599ES.
A sample flow rule is as follows: 
flow create 0 ingress pattern eth / ipv4 dst is 245.194.135.241 src is 
215.201.218.98 / sctp  / end actions drop /  end

NIC will pass the packet to host , however we expect the packet to be dropped.
The reason for this is that ixgbe_parse_fdir_filter_normal() does not change 
the SCTP mask, which has a default value of 0. 
This causes HW to ignore L4 protocol type because the L4P register is set.
(The default value is set by the following patch, called patch_df. 
 
https://patches.dpdk.org/project/dpdk/patch/20250418074309.705337-1-yuanx.w...@intel.com/)

However, This patch seems to need to be discard due to another issue.
This scenario is based on patch_df and create 2 rules on 82599ES.
flow create 0 ingress pattern fuzzy thresh is 6 / ipv4 dst is 102.23.130.154 
src is 70.247.152.105  / end actions queue index 6 /  end
flow create 0 ingress pattern fuzzy thresh is 4 / ipv4 dst is 193.23.234.17 src 
is 59.247.66.16 / udp dst is 57827 src is 23877  / end actions queue index 11 / 
 end

The second rule creation fails (ixgbe_flow.c line 3168) because the port mask 
is different from the first one. The first is 0x0 and the other is 0xffff.
Because of this scenario, I think it would be better to retore the default 
value of port mask to 0xffff. Therefore, we should reconsider the patch_df 
solution.

If all mask are formatted as 0xffff, raw IP packet will not match on E610, I 
think it is not appropriate to use port masks as L4P condition. I am 
considering using IXGBE_ATR_L4TYPE_MASK.
if (info->mask.dst_port_mask == 0 && info->mask.src_port_mask == 0) 
    fdirm |= IXGBE_FDIRM_L4P;

Do you have any suggestions?
 
Thanks,
Yuan

> -----Original Message-----
> From: Richardson, Bruce <bruce.richard...@intel.com>
> Sent: Monday, June 30, 2025 5:11 PM
> To: Wang, YuanX <yuanx.w...@intel.com>
> Cc: Burakov, Anatoly <anatoly.bura...@intel.com>; Medvedkin, Vladimir
> <vladimir.medved...@intel.com>; dev@dpdk.org; sta...@dpdk.org
> Subject: Re: [PATCH] net/ixgbe: fix sctp mask in flow director
> 
> On Fri, Jun 27, 2025 at 04:59:53PM +0800, Yuan Wang wrote:
> > Since the default value of the port mask is set to 0, the port mask
> > does not change in some cases when creating SCTP flow rules, which
> > results in incorrect L4P register configuration.
> >
> > This patch fixes this issue by setting the mask to 0xffff in these cases.
> >
> > Fixes: c81daae2383a (net/ixgbe: fix port mask default value in filter)
> > Cc: sta...@dpdk.org
> >
> > Signed-off-by: Yuan Wang <yuanx.w...@intel.com>
> > ---
> >  drivers/net/intel/ixgbe/ixgbe_flow.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/net/intel/ixgbe/ixgbe_flow.c
> > b/drivers/net/intel/ixgbe/ixgbe_flow.c
> > index 6278646720..9f2e470ad9 100644
> > --- a/drivers/net/intel/ixgbe/ixgbe_flow.c
> > +++ b/drivers/net/intel/ixgbe/ixgbe_flow.c
> > @@ -2161,6 +2161,8 @@ ixgbe_parse_fdir_filter_normal(struct
> rte_eth_dev *dev,
> >                                     item, "Not supported by fdir filter");
> >                             return -rte_errno;
> >                     }
> > +                   rule->mask.src_port_mask = 0xffff;
> > +                   rule->mask.dst_port_mask = 0xffff;
> >             }
> >
> 
> Hi,
> 
> can you give a quick example of how to demonstrate the issue here, so I can
> test the patch? Presumably without this patch some packets are incorrectly
> classified/filtered based on the rte_flow rules?
> 
> Thanks,
> /Bruce

Reply via email to