patch 'net/bnxt: cap maximum number of unicast MAC addresses' has been queued to stable release 21.11.1

Kevin Traynor ktraynor at redhat.com
Mon Feb 21 16:34:04 CET 2022


Hi,

FYI, your patch has been queued to stable release 21.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/26/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/6b7c0ce0ce9bc9339b36c37a5eb0056a319b9c05

Thanks.

Kevin

---
>From 6b7c0ce0ce9bc9339b36c37a5eb0056a319b9c05 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Date: Tue, 4 Jan 2022 14:08:12 +0530
Subject: [PATCH] net/bnxt: cap maximum number of unicast MAC addresses

[ upstream commit 604a6be6b6c70cafdf055129d7d141d84509ad90 ]

The Maximum number of receive mac addr is hard coded to 128
in the ethdev library(RTE_ETH_NUM_RECEIVE_MAC_ADDR).
But the bnxt devices support more than 128 unicast MAC filters
which could result in a segfault while user tries to add more
than 128 unicast MAC addresses to the port.

Fixes: a2033fda22ab ("net/bnxt: fix number of MAC addresses for VMDq")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur at broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 99a7d35470..82350a5008 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -955,5 +955,5 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
 
 	/* MAC Specifics */
-	dev_info->max_mac_addrs = bp->max_l2_ctx;
+	dev_info->max_mac_addrs = RTE_MIN(bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR);
 	dev_info->max_hash_mac_addrs = 0;
 
@@ -5017,9 +5017,13 @@ static int bnxt_setup_mac_addr(struct rte_eth_dev *eth_dev)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
+	size_t max_mac_addr = RTE_MIN(bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR);
 	int rc = 0;
 
+	if (bp->max_l2_ctx > RTE_ETH_NUM_RECEIVE_MAC_ADDR)
+		PMD_DRV_LOG(INFO, "Max number of MAC addrs supported is %d, but will be limited to %d\n",
+			    bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR);
+
 	eth_dev->data->mac_addrs = rte_zmalloc("bnxt_mac_addr_tbl",
-					       RTE_ETHER_ADDR_LEN *
-					       bp->max_l2_ctx,
+					       RTE_ETHER_ADDR_LEN * max_mac_addr,
 					       0);
 	if (eth_dev->data->mac_addrs == NULL) {
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-21 15:22:45.852218472 +0000
+++ 0055-net-bnxt-cap-maximum-number-of-unicast-MAC-addresses.patch	2022-02-21 15:22:44.124704200 +0000
@@ -1 +1 @@
-From 604a6be6b6c70cafdf055129d7d141d84509ad90 Mon Sep 17 00:00:00 2001
+From 6b7c0ce0ce9bc9339b36c37a5eb0056a319b9c05 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 604a6be6b6c70cafdf055129d7d141d84509ad90 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list