]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bnxt_en: Implement XDP RSS hash metadata extraction for V3_CMP
authorChris J Arges <carges@cloudflare.com>
Wed, 25 Mar 2026 20:09:50 +0000 (15:09 -0500)
committerJakub Kicinski <kuba@kernel.org>
Sun, 29 Mar 2026 21:09:08 +0000 (14:09 -0700)
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.

Reviewed-by: Joe Damato <joe@dama.to>
Signed-off-by: Chris J Arges <carges@cloudflare.com>
Link: https://patch.msgid.link/20260325201139.2501937-5-carges@cloudflare.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c

index 1f920464b426e207eaf137bada20c072583cc5af..babcd463e50e205c900a44100913779260cb105b 100644 (file)
@@ -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;