patch 'net/bnxt: cap maximum number of unicast MAC addresses' has been queued to stable release 20.11.5
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Fri Feb 18 13:37:57 CET 2022
Hi,
FYI, your patch has been queued to stable release 20.11.5
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/20/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/5889a24544457b11abaccd66f24fc28c0bdbe872
Thanks.
Luca Boccassi
---
>From 5889a24544457b11abaccd66f24fc28c0bdbe872 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 0168481663..cc9cf6c0ea 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -964,7 +964,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
return rc;
/* 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;
/* PF/VF specifics */
@@ -4781,11 +4781,15 @@ static int bnxt_alloc_stats_mem(struct bnxt *bp)
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) {
PMD_DRV_LOG(ERR, "Failed to alloc MAC addr tbl\n");
--
2.30.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2022-02-18 12:37:39.228919121 +0000
+++ 0028-net-bnxt-cap-maximum-number-of-unicast-MAC-addresses.patch 2022-02-18 12:37:37.598789865 +0000
@@ -1 +1 @@
-From 604a6be6b6c70cafdf055129d7d141d84509ad90 Mon Sep 17 00:00:00 2001
+From 5889a24544457b11abaccd66f24fc28c0bdbe872 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 604a6be6b6c70cafdf055129d7d141d84509ad90 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index 99a7d35470..82350a5008 100644
+index 0168481663..cc9cf6c0ea 100644
@@ -26 +27 @@
-@@ -954,7 +954,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
+@@ -964,7 +964,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
@@ -35 +36 @@
-@@ -5016,11 +5016,15 @@ static int bnxt_alloc_stats_mem(struct bnxt *bp)
+@@ -4781,11 +4781,15 @@ static int bnxt_alloc_stats_mem(struct bnxt *bp)
More information about the stable
mailing list