From: Joe Damato <joe@dama.to>
To: Michael Chan <michael.chan@broadcom.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Pavan Chebbi <pavan.chebbi@broadcom.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
shruti.parab@broadcom.com
Subject: Re: [PATCH net-next v2] bnxt_en: Allow ntuple filters for drops
Date: Fri, 30 Jan 2026 16:33:53 -0800 [thread overview]
Message-ID: <aX1N8UfZ4I+8ZTii@devvm20253.cco0.facebook.com> (raw)
In-Reply-To: <CACKFLinQD_fuJZDkzqHo=qFMQZrhXujjNOxuhBzHGQ8KwRJ8Uw@mail.gmail.com>
On Thu, Jan 29, 2026 at 06:28:38PM -0800, Michael Chan wrote:
> On Thu, Jan 29, 2026 at 4:23 PM Joe Damato <joe@dama.to> wrote:
> >
> > It appears that in commit 7efd79c0e689 ("bnxt_en: Add drop action
> > support for ntuple"), bnxt gained support for ntuple filters for packet
> > drops.
> >
> > However, support for this does not seem to work in recent kernels or
> > against net-next:
> >
> > % sudo ethtool -U eth0 flow-type udp4 src-ip 1.1.1.1 action -1
> > rmgr: Cannot insert RX class rule: Operation not supported
> > Cannot insert classification rule
> >
> > The issue is that the existing code uses ethtool_get_flow_spec_ring_vf,
> > which will return a non-zero value if the ring_cookie is set to
> > RX_CLS_FLOW_DISC, which then causes bnxt_add_ntuple_cls_rule to return
> > -EOPNOTSUPP because it thinks the user is trying to set an ntuple filter
> > for a vf.
> >
> > Fix this by first checking that the ring_cookie is not RX_CLS_FLOW_DISC.
> >
> > After this patch, ntuple filters for drops can be added:
> >
> > % sudo ethtool -U eth0 flow-type udp4 src-ip 1.1.1.1 action -1
> > Added rule with ID 0
> >
> > % ethtool -n eth0
> > 44 RX rings available
> > Total 1 rules
> >
> > Filter: 0
> > Rule Type: UDP over IPv4
> > Src IP addr: 1.1.1.1 mask: 0.0.0.0
> > Dest IP addr: 0.0.0.0 mask: 255.255.255.255
> > TOS: 0x0 mask: 0xff
> > Src port: 0 mask: 0xffff
> > Dest port: 0 mask: 0xffff
> > Action: Drop
> >
> > Signed-off-by: Joe Damato <joe@dama.to>
> > ---
> > v2:
> > - Extract the FLOW_MAC_EXT and FLOW_EXT check so it happens unconditionally.
> > - Eliminate the local variable ring, which was used in only one place and
> > call ethtool_get_flow_spec_ring instead.
> >
> > v1: https://lore.kernel.org/netdev/20260128222718.1679581-1-joe@dama.to/
>
> One minor improvement is to eliminate the vf variable since it is also
> used only once. But I'm fine with this patch. Thanks.
>
> Reviewed-by: Michael Chan <michael.chan@broadcom.com>
I made the improvement you suggested in the v3 I just sent. I retained your
tag because the suggestion was cosmetic; I hope that's OK.
prev parent reply other threads:[~2026-01-31 0:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-30 0:23 [PATCH net-next v2] bnxt_en: Allow ntuple filters for drops Joe Damato
2026-01-30 2:28 ` Michael Chan
2026-01-31 0:33 ` Joe Damato [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aX1N8UfZ4I+8ZTii@devvm20253.cco0.facebook.com \
--to=joe@dama.to \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=shruti.parab@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox