public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Damato <joe@dama.to>
To: Chris J Arges <carges@cloudflare.com>
Cc: michael.chan@broadcom.com, pavan.chebbi@broadcom.com,
	kuba@kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	"David S. Miller" <davem@davemloft.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	kernel-team@cloudflare.com, netdev@vger.kernel.org,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 3/5] bnxt_en: Implement XDP RSS hash metadata extraction for V3_CMP
Date: Mon, 9 Mar 2026 18:02:32 -0700	[thread overview]
Message-ID: <aa9tqH8i1GQ0j31Y@devvm20253.cco0.facebook.com> (raw)
In-Reply-To: <20260306230600.1628196-4-carges@cloudflare.com>

On Fri, Mar 06, 2026 at 05:00:18PM -0600, Chris J Arges wrote:
> This adds another conditional for if cmp_type is CMP_TYPE_RX_L2_V3_CMP for
> drivers that support this completion format.
> 
> It uses a similar approach as found in other parts of the driver.
> 
> Signed-off-by: Chris J Arges <carges@cloudflare.com>
> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 20 +++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> index 1f920464b426..25ecef1eb96e 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> @@ -514,6 +514,26 @@ int bnxt_xdp_rx_hash(const struct xdp_md *ctx, u32 *hash,
>  		default:
>  			break;
>  		}
> +	} else if (xdp->cmp_type == CMP_TYPE_RX_L2_V3_CMP) {
> +		struct bnxt *bp = netdev_priv(xdp->xdp.rxq->dev);
> +		u8 ext_op;
> +
> +		if (rxcmp1->rx_cmp_flags2 & cpu_to_le32(RX_CMP_FLAGS2_IP_TYPE))
> +			hash_type |= XDP_RSS_TYPE_L3_IPV6;
> +		else
> +			hash_type |= XDP_RSS_TYPE_L3_IPV4;
> +
> +		ext_op = RX_CMP_V3_HASH_TYPE(bp, rxcmp);
> +		switch (ext_op) {
> +		case EXT_OP_INNER_4:
> +		case EXT_OP_OUTER_4:
> +		case EXT_OP_INNFL_3:
> +		case EXT_OP_OUTFL_3:
> +			hash_type |= XDP_RSS_L4;
> +			break;
> +		default:
> +			break;
> +		}

Looks like the above code is duplicated from bnxt_rss_ext_op?

Maybe that could be refactored into a helper in bnxt.h and called from here to
reduce code duplciation?

  reply	other threads:[~2026-03-10  1:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06 23:00 [PATCH net-next v3 0/5] bnxt_en: Add XDP RSS hash metadata support Chris J Arges
2026-03-06 23:00 ` [PATCH net-next v3 1/5] bnxt_en: use bnxt_xdp_buff for xdp context Chris J Arges
2026-03-10  0:52   ` Joe Damato
2026-03-13  0:14   ` Andy Gospodarek
2026-03-06 23:00 ` [PATCH net-next v3 2/5] bnxt_en: Implement XDP RSS hash metadata extraction Chris J Arges
2026-03-10  0:56   ` Joe Damato
2026-03-13  0:15   ` Andy Gospodarek
2026-03-06 23:00 ` [PATCH net-next v3 3/5] bnxt_en: Implement XDP RSS hash metadata extraction for V3_CMP Chris J Arges
2026-03-10  1:02   ` Joe Damato [this message]
2026-03-13  0:15   ` Andy Gospodarek
2026-03-06 23:00 ` [PATCH net-next v3 4/5] selftests: net: move common xdp.py functions into lib Chris J Arges
2026-03-10  0:54   ` Joe Damato
2026-03-06 23:00 ` [PATCH net-next v3 5/5] selftests: drv-net: xdp: Add rss_hash metadata tests Chris J Arges
2026-03-10  0:51 ` [PATCH net-next v3 0/5] bnxt_en: Add XDP RSS hash metadata support Joe Damato
2026-03-10  2:06   ` Chris Arges
2026-03-10  2:37 ` Jakub Kicinski

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=aa9tqH8i1GQ0j31Y@devvm20253.cco0.facebook.com \
    --to=joe@dama.to \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=carges@cloudflare.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kernel-team@cloudflare.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=sdf@fomichev.me \
    /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