mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: Joe Damato <joe@dama.to>
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] bnxt_en: Allow ntuple filters for drops
Date: Wed, 28 Jan 2026 15:09:21 -0800	[thread overview]
Message-ID: <CACKFLimN+AOBeesHaiHPZM-OFUtLNeL-3GFtLUDCdv6_RGkEJg@mail.gmail.com> (raw)
In-Reply-To: <20260128222718.1679581-1-joe@dama.to>

[-- Attachment #1: Type: text/plain, Size: 2351 bytes --]

On Wed, Jan 28, 2026 at 2:27 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.

Please add the Fixes tag.  It looks like the drop action never worked
properly because of the vf check.

> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> index 6b15fedbb16f..fd32231bf8e0 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> @@ -1353,10 +1353,12 @@ static int bnxt_add_ntuple_cls_rule(struct bnxt *bp,
>         if (!bp->vnic_info)
>                 return -EAGAIN;
>
> -       vf = ethtool_get_flow_spec_ring_vf(fs->ring_cookie);
> -       ring = ethtool_get_flow_spec_ring(fs->ring_cookie);
> -       if ((fs->flow_type & (FLOW_MAC_EXT | FLOW_EXT)) || vf)
> -               return -EOPNOTSUPP;
> +       if (fs->ring_cookie != RX_CLS_FLOW_DISC) {
> +               vf = ethtool_get_flow_spec_ring_vf(fs->ring_cookie);
> +               ring = ethtool_get_flow_spec_ring(fs->ring_cookie);
> +               if ((fs->flow_type & (FLOW_MAC_EXT | FLOW_EXT)) || vf)

I think the FLOW_MAC_EXT and FLOW_EXT checks should be done unconditionally.

Alternatively, we can also change ethtool_get_flow_spec_ring_vf() to
check that the cookie is not RX_CLS_FLOW_DISC or RX_CLS_FLOW_WAKE.

Thanks.

> +                       return -EOPNOTSUPP;
> +       }

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5469 bytes --]

  reply	other threads:[~2026-01-28 23:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-28 22:27 Joe Damato
2026-01-28 23:09 ` Michael Chan [this message]
2026-01-29  1:01   ` Joe Damato
2026-01-29  2:24     ` Michael Chan

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=CACKFLimN+AOBeesHaiHPZM-OFUtLNeL-3GFtLUDCdv6_RGkEJg@mail.gmail.com \
    --to=michael.chan@broadcom.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joe@dama.to \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®