[PATCH net-next v4 4/6] bnxt_en: Implement XDP RSS hash metadata extraction for V3_CMP

Chris J Arges posted 6 patches 3 weeks, 3 days ago
[PATCH net-next v4 4/6] bnxt_en: Implement XDP RSS hash metadata extraction for V3_CMP
Posted by Chris J Arges 3 weeks, 3 days ago
This adds another conditional when cmp_type is CMP_TYPE_RX_L2_V3_CMP for
drivers that support this completion format.

This re-uses bnxt_rss_ext_op to provide similar functionality. One
limitation is for L4 hash-types, protocol-specific bits can't be
determined.

Signed-off-by: Chris J Arges <carges@cloudflare.com>
---
v4: re-uses bnxt_rss_ext_op
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
index 1f920464b426..babcd463e50e 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
@@ -514,6 +514,16 @@ 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);
+
+		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;
+
+		if (bnxt_rss_ext_op(bp, rxcmp) == PKT_HASH_TYPE_L4)
+			hash_type |= XDP_RSS_L4;
 	}
 
 	*rss_type = hash_type;
-- 
2.43.0
Re: [PATCH net-next v4 4/6] bnxt_en: Implement XDP RSS hash metadata extraction for V3_CMP
Posted by Joe Damato 3 weeks, 3 days ago
On Fri, Mar 13, 2026 at 05:27:34PM -0500, Chris J Arges wrote:
> This adds another conditional when cmp_type is CMP_TYPE_RX_L2_V3_CMP for
> drivers that support this completion format.
> 
> This re-uses bnxt_rss_ext_op to provide similar functionality. One
> limitation is for L4 hash-types, protocol-specific bits can't be
> determined.
> 
> Signed-off-by: Chris J Arges <carges@cloudflare.com>
> ---
> v4: re-uses bnxt_rss_ext_op
> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 

Reviewed-by: Joe Damato <joe@dama.to>