From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net,
Kishore Padmanabha <kishore.padmanabha@broadcom.com>,
Ajit Khaparde <ajit.khaparde@broadcom.com>,
Mohammad Shuab Siddique <mohammad-shuab.siddique@broadcom.com>,
Keegan Freyhof <keegan.freyhof@broadcom.com>
Subject: [PATCH v3 05/13] net/bnxt: remove leftover VMDq code in MAC helpers
Date: Thu, 22 Oct 2026 19:44:32 +0200 [thread overview]
Message-ID: <20261022174447.412638-6-david.marchand@redhat.com> (raw)
In-Reply-To: <20261022174447.412638-1-david.marchand@redhat.com>
The VMDq support removal left dead code in MAC address addition, removal
and filter restore functions.
Remove the VMDq flag checks and pool_mask logic that are no longer needed.
At the same time, remove unneeded reset to 0 of VMDq related field in
the dev_info structure.
Fixes: 582f971526da ("net/bnxt: remove VMDq support")
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v1:
- cleaned up bnxt_mac_addr_add_op,
- preferred bnxt_get_default_vnic() to direct access to bp->vnic_info[0],
---
drivers/net/bnxt/bnxt_ethdev.c | 90 +++++++++-------------------------
1 file changed, 22 insertions(+), 68 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 23edd94444..4a4e9c1ea3 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1252,12 +1252,6 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
* TODO: default_rxconf, default_txconf, rx_desc_lim, and tx_desc_lim
* need further investigation.
*/
- dev_info->max_vmdq_pools = 0;
- dev_info->vmdq_queue_num = 0;
-
- dev_info->vmdq_pool_base = 0;
- dev_info->vmdq_queue_base = 0;
-
dev_info->rx_seg_capa.max_nseg = BNXT_MAX_BUFFER_SPLIT_SEGS;
dev_info->rx_seg_capa.multi_pools = BNXT_MULTI_POOL_BUF_SPLIT_CAP;
dev_info->rx_seg_capa.offset_allowed = BNXT_BUF_SPLIT_OFFSET_CAP;
@@ -1999,45 +1993,32 @@ static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev,
uint32_t index)
{
struct bnxt *bp = eth_dev->data->dev_private;
- uint64_t pool_mask;
struct bnxt_vnic_info *vnic;
struct bnxt_filter_info *filter, *temp_filter;
- uint32_t i;
if (is_bnxt_in_error(bp))
return;
- if ((eth_dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) == 0)
- pool_mask = 1;
- else
- pool_mask = eth_dev->data->mac_pool_sel[index];
+ if (bp->vnic_info == NULL)
+ return;
- /*
- * Loop through all VNICs from the specified filter flow pools to
- * remove the corresponding MAC addr filter
- */
- for (i = 0; i < bp->nr_vnics; i++) {
- if (!(pool_mask & (1ULL << i)))
- continue;
+ vnic = bnxt_get_default_vnic(bp);
- vnic = &bp->vnic_info[i];
- filter = STAILQ_FIRST(&vnic->filter);
- while (filter) {
- temp_filter = STAILQ_NEXT(filter, next);
- if (filter->mac_index == index) {
- STAILQ_REMOVE(&vnic->filter, filter,
- bnxt_filter_info, next);
- bnxt_hwrm_clear_l2_filter(bp, filter);
- bnxt_free_filter(bp, filter);
- }
- filter = temp_filter;
+ filter = STAILQ_FIRST(&vnic->filter);
+ while (filter) {
+ temp_filter = STAILQ_NEXT(filter, next);
+ if (filter->mac_index == index) {
+ STAILQ_REMOVE(&vnic->filter, filter,
+ bnxt_filter_info, next);
+ bnxt_hwrm_clear_l2_filter(bp, filter);
+ bnxt_free_filter(bp, filter);
}
+ filter = temp_filter;
}
}
static int bnxt_add_mac_filter(struct bnxt *bp, struct bnxt_vnic_info *vnic,
- struct rte_ether_addr *mac_addr, uint32_t index,
- uint32_t pool)
+ struct rte_ether_addr *mac_addr, uint32_t index)
{
struct bnxt_filter_info *filter;
int rc = 0;
@@ -2045,9 +2026,7 @@ static int bnxt_add_mac_filter(struct bnxt *bp, struct bnxt_vnic_info *vnic,
/* Attach requested MAC address to the new l2_filter */
STAILQ_FOREACH(filter, &vnic->filter, next) {
if (filter->mac_index == index) {
- PMD_DRV_LOG_LINE(DEBUG,
- "MAC addr already existed for pool %d",
- pool);
+ PMD_DRV_LOG_LINE(DEBUG, "MAC addr already exists");
return 0;
}
}
@@ -2082,10 +2061,9 @@ static int bnxt_add_mac_filter(struct bnxt *bp, struct bnxt_vnic_info *vnic,
static int bnxt_mac_addr_add_op(struct rte_eth_dev *eth_dev,
struct rte_ether_addr *mac_addr,
- uint32_t index, uint32_t pool)
+ uint32_t index, uint32_t pool __rte_unused)
{
struct bnxt *bp = eth_dev->data->dev_private;
- struct bnxt_vnic_info *vnic;
int rc = 0;
rc = is_bnxt_in_error(bp);
@@ -2097,11 +2075,6 @@ static int bnxt_mac_addr_add_op(struct rte_eth_dev *eth_dev,
return -ENOTSUP;
}
- if (pool >= bp->max_vnics) {
- PMD_DRV_LOG_LINE(ERR, "Pool %u exceeds VNIC count %u!", pool, bp->max_vnics);
- return -EINVAL;
- }
-
/* Filter settings will get applied when port is started */
if (!eth_dev->data->dev_started)
return 0;
@@ -2109,9 +2082,7 @@ static int bnxt_mac_addr_add_op(struct rte_eth_dev *eth_dev,
if (bp->vnic_info == NULL)
return 0;
- vnic = &bp->vnic_info[pool];
-
- rc = bnxt_add_mac_filter(bp, vnic, mac_addr, index, pool);
+ rc = bnxt_add_mac_filter(bp, bnxt_get_default_vnic(bp), mac_addr, index);
return rc;
}
@@ -2953,7 +2924,7 @@ bnxt_config_vlan_hw_filter(struct bnxt *bp, uint64_t rx_offloads)
for (i = 0; i < RTE_ETHER_MAX_VLAN_ID; i++)
bnxt_del_vlan_filter(bp, i);
- rc = bnxt_add_mac_filter(bp, vnic, NULL, 0, 0);
+ rc = bnxt_add_mac_filter(bp, vnic, NULL, 0);
if (rc)
return rc;
} else {
@@ -3030,7 +3001,7 @@ bnxt_config_vlan_hw_stripping(struct bnxt *bp, uint64_t rx_offloads)
if (rc)
return rc;
} else {
- rc = bnxt_add_mac_filter(bp, vnic, NULL, 0, 0);
+ rc = bnxt_add_mac_filter(bp, vnic, NULL, 0);
if (rc)
return rc;
}
@@ -3181,7 +3152,7 @@ bnxt_set_default_mac_addr_op(struct rte_eth_dev *dev,
/* This filter will allow only untagged packets */
rc = bnxt_add_vlan_filter(bp, 0);
} else {
- rc = bnxt_add_mac_filter(bp, vnic, addr, 0, 0);
+ rc = bnxt_add_mac_filter(bp, vnic, addr, 0);
}
PMD_DRV_LOG_LINE(DEBUG, "Set MAC addr");
@@ -4528,10 +4499,7 @@ static int bnxt_restore_mac_filters(struct bnxt *bp)
struct rte_eth_dev *dev = bp->eth_dev;
struct rte_eth_dev_info dev_info;
struct rte_ether_addr *addr;
- uint64_t pool_mask;
- uint32_t pool = 0;
uint32_t i;
- bool vmdq;
int rc;
if (BNXT_VF(bp) && !BNXT_VF_IS_TRUSTED(bp))
@@ -4541,8 +4509,6 @@ static int bnxt_restore_mac_filters(struct bnxt *bp)
if (rc)
return rc;
- vmdq = (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) != 0;
-
/* replay MAC address configuration */
for (i = 1; i < dev_info.max_mac_addrs; i++) {
addr = &dev->data->mac_addrs[i];
@@ -4551,21 +4517,9 @@ static int bnxt_restore_mac_filters(struct bnxt *bp)
if (rte_is_zero_ether_addr(addr))
continue;
- pool = 0;
- if (!vmdq)
- pool_mask = 1;
- else
- pool_mask = dev->data->mac_pool_sel[i];
-
- do {
- if (pool_mask & 1ULL) {
- rc = bnxt_mac_addr_add_op(dev, addr, i, pool);
- if (rc)
- return rc;
- }
- pool_mask >>= 1;
- pool++;
- } while (pool_mask);
+ rc = bnxt_mac_addr_add_op(dev, addr, i, 0);
+ if (rc)
+ return rc;
}
return 0;
--
2.54.0
next prev parent reply other threads:[~2026-10-22 17:45 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 13:05 [PATCH 0/8] Validate multiqueue configuration in ethdev David Marchand
2026-10-16 13:05 ` [PATCH 1/8] net/bnxt: remove leftover VMDq code in MAC helpers David Marchand
2026-10-16 13:05 ` [PATCH 2/8] drivers/net: fix reported VMDq capability David Marchand
2026-10-16 13:05 ` [PATCH 3/8] drivers/net: remove check on VMDq modes David Marchand
2026-10-16 13:05 ` [PATCH 4/8] devtools: check VMDq capability David Marchand
2026-10-16 13:05 ` [PATCH 5/8] ethdev: check DCB availability David Marchand
2026-10-16 13:05 ` [PATCH 6/8] drivers/net: fix reported RSS capability David Marchand
2026-10-16 13:05 ` [PATCH 7/8] ethdev: check RSS availability David Marchand
2026-10-16 13:05 ` [PATCH 8/8] ethdev: check unknown Rx/Tx multi-queue modes David Marchand
2026-10-16 16:44 ` [PATCH 0/8] Validate multiqueue configuration in ethdev Stephen Hemminger
2026-10-19 6:41 ` Renyong Wan
2026-10-21 10:30 ` [PATCH v2 00/12] " David Marchand
2026-10-21 10:30 ` [PATCH v2 01/12] devtools: fix matching in doc check David Marchand
2026-10-21 10:42 ` Thomas Monjalon
2026-10-21 10:30 ` [PATCH v2 02/12] doc: fix L2TPv2 and PPP matching support for ICE David Marchand
2026-10-21 10:30 ` [PATCH v2 03/12] devtools: handle multiple drivers in doc check David Marchand
2026-10-22 9:39 ` Thomas Monjalon
2026-10-21 10:30 ` [PATCH v2 04/12] net/bnxt: remove leftover VMDq code in MAC helpers David Marchand
2026-10-21 10:30 ` [PATCH v2 05/12] drivers/net: fix reported VMDq capability David Marchand
2026-10-21 10:53 ` Bruce Richardson
2026-10-21 10:30 ` [PATCH v2 06/12] drivers/net: remove check on VMDq modes David Marchand
2026-10-21 10:55 ` Bruce Richardson
2026-10-21 10:30 ` [PATCH v2 07/12] devtools: check VMDq capability David Marchand
2026-10-22 9:44 ` Thomas Monjalon
2026-10-21 10:30 ` [PATCH v2 08/12] doc: fix DCB capability for some Intel drivers David Marchand
2026-10-21 11:04 ` Bruce Richardson
2026-10-21 10:30 ` [PATCH v2 09/12] ethdev: check DCB availability David Marchand
2026-10-21 11:07 ` Bruce Richardson
2026-10-21 10:30 ` [PATCH v2 10/12] drivers/net: fix reported RSS capability David Marchand
2026-10-22 6:17 ` Renyong Wan
2026-10-21 10:30 ` [PATCH v2 11/12] ethdev: check RSS availability David Marchand
2026-10-21 10:30 ` [PATCH v2 12/12] ethdev: check unknown Rx/Tx multi-queue modes David Marchand
2026-10-21 17:42 ` [PATCH v2 00/12] Validate multiqueue configuration in ethdev Stephen Hemminger
2026-10-22 17:44 ` [PATCH v3 00/13] " David Marchand
2026-10-22 17:44 ` [PATCH v3 01/13] devtools: fix matching in doc check David Marchand
2026-10-22 17:44 ` [PATCH v3 02/13] doc: fix L2TPv2 and PPP matching support for ICE David Marchand
2026-10-22 17:44 ` [PATCH v3 03/13] devtools: support Intel drivers in doc check David Marchand
2026-10-23 10:11 ` Thomas Monjalon
2026-10-22 17:44 ` [PATCH v3 04/13] devtools: handle multiple " David Marchand
2026-10-23 10:13 ` Thomas Monjalon
2026-10-23 15:08 ` David Marchand
2026-10-22 17:44 ` David Marchand [this message]
2026-10-22 17:44 ` [PATCH v3 06/13] drivers/net: fix reported VMDq capability David Marchand
2026-10-22 17:44 ` [PATCH v3 07/13] drivers/net: remove check on VMDq modes David Marchand
2026-10-27 2:38 ` fengchengwen
2026-10-22 17:44 ` [PATCH v3 08/13] devtools: check VMDq capability David Marchand
2026-10-22 17:44 ` [PATCH v3 09/13] doc: fix DCB capability for some Intel drivers David Marchand
2026-10-22 17:44 ` [PATCH v3 10/13] ethdev: check DCB availability David Marchand
2026-10-27 2:39 ` fengchengwen
2026-10-22 17:44 ` [PATCH v3 11/13] drivers/net: fix reported RSS capability David Marchand
2026-10-22 17:44 ` [PATCH v3 12/13] ethdev: check RSS availability David Marchand
2026-10-27 2:41 ` fengchengwen
2026-10-22 17:44 ` [PATCH v3 13/13] ethdev: check unknown Rx/Tx multi-queue modes David Marchand
2026-10-26 18:11 ` [PATCH v3 00/13] Validate multiqueue configuration in ethdev Stephen Hemminger
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=20261022174447.412638-6-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=keegan.freyhof@broadcom.com \
--cc=kishore.padmanabha@broadcom.com \
--cc=mohammad-shuab.siddique@broadcom.com \
--cc=thomas@monjalon.net \
/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