DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/ixgbe: fix sctp mask in flow director
@ 2025-06-27  8:59 Yuan Wang
  2025-06-30  9:10 ` Bruce Richardson
  0 siblings, 1 reply; 3+ messages in thread
From: Yuan Wang @ 2025-06-27  8:59 UTC (permalink / raw)
  To: anatoly.burakov, vladimir.medvedkin; +Cc: dev, Yuan Wang, stable

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: stable@dpdk.org

Signed-off-by: Yuan Wang <yuanx.wang@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;
 		}
 
 		item = next_no_fuzzy_pattern(pattern, item);
-- 
2.47.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net/ixgbe: fix sctp mask in flow director
  2025-06-27  8:59 [PATCH] net/ixgbe: fix sctp mask in flow director Yuan Wang
@ 2025-06-30  9:10 ` Bruce Richardson
  2025-07-01  9:14   ` Wang, YuanX
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Richardson @ 2025-06-30  9:10 UTC (permalink / raw)
  To: Yuan Wang; +Cc: anatoly.burakov, vladimir.medvedkin, dev, stable

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: stable@dpdk.org
> 
> Signed-off-by: Yuan Wang <yuanx.wang@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] net/ixgbe: fix sctp mask in flow director
  2025-06-30  9:10 ` Bruce Richardson
@ 2025-07-01  9:14   ` Wang, YuanX
  0 siblings, 0 replies; 3+ messages in thread
From: Wang, YuanX @ 2025-07-01  9:14 UTC (permalink / raw)
  To: Richardson, Bruce; +Cc: Burakov, Anatoly, Medvedkin, Vladimir, dev, stable

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.wang@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.richardson@intel.com>
> Sent: Monday, June 30, 2025 5:11 PM
> To: Wang, YuanX <yuanx.wang@intel.com>
> Cc: Burakov, Anatoly <anatoly.burakov@intel.com>; Medvedkin, Vladimir
> <vladimir.medvedkin@intel.com>; dev@dpdk.org; stable@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: stable@dpdk.org
> >
> > Signed-off-by: Yuan Wang <yuanx.wang@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-01  9:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-27  8:59 [PATCH] net/ixgbe: fix sctp mask in flow director Yuan Wang
2025-06-30  9:10 ` Bruce Richardson
2025-07-01  9:14   ` Wang, YuanX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).