DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: ciara.loftus@intel.com, anatoly.burakov@intel.com,
	rjarry@redhat.com, cfontain@redhat.com,
	Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Subject: [PATCH v7 4/4] net/iavf: accept up to 32k unicast MAC addresses
Date: Mon, 14 Sep 2026 10:17:25 +0200	[thread overview]
Message-ID: <20260914081725.1097704-4-david.marchand@redhat.com> (raw)
In-Reply-To: <20260914081725.1097704-1-david.marchand@redhat.com>

E810 hardware provides 32k switch lookups.
Thanks to this, it is possible to allow a lot more secondary mac
addresses than what is possible today.

In practice, the maximum number of macs available per port may be lower
and depends on usage by other (trusted?) VFs on the same PF.
There is no way to figure out this limit but to try adding a mac address
and get an error from the PF driver.

Mailbox exchanges are limited to IAVF_AQ_BUF_SZ, segment messages
accordingly.

Since unicast and multicast addresses arrays are sized with two
different constants, prefer RTE_DIM() whenever possible.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v6:
- reused helper added in previous commit,
- used RTE_DIM() instead of macro constants,

Changes since v5:
- separated from series that went in next-net,
- rebased,

Changes since v4:
- rebased,

Changes since v2:
- added an entry in release notes,
- removed unneeded temp variable,

Changes since v1:
- fixed buffer overflow on mailbox messages during port restart/VF reset,

---
 doc/guides/rel_notes/release_26_11.rst |  4 ++++
 drivers/net/intel/iavf/iavf.h          |  7 ++++---
 drivers/net/intel/iavf/iavf_ethdev.c   |  7 +++----
 drivers/net/intel/iavf/iavf_vchnl.c    | 10 ++++++++--
 4 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/doc/guides/rel_notes/release_26_11.rst b/doc/guides/rel_notes/release_26_11.rst
index 6c29513041..5a4c7d815d 100644
--- a/doc/guides/rel_notes/release_26_11.rst
+++ b/doc/guides/rel_notes/release_26_11.rst
@@ -64,6 +64,10 @@ New Features
   * Renamed the ``enable_ptype_lldp`` devarg to ``enable_lldp``.
     The old name is no longer accepted.
 
+  * Increased the maximum number of secondary unicast MAC addresses
+    from 64 to 32k.
+    This increases a VF port memory footprint by ~192kB.
+
 * **Updated Intel ixgbe driver.**
 
   Added ``fdir_buffer_size`` devarg to select the Flow Director table size
diff --git a/drivers/net/intel/iavf/iavf.h b/drivers/net/intel/iavf/iavf.h
index 34b9b4ad94..f3f2b4ae51 100644
--- a/drivers/net/intel/iavf/iavf.h
+++ b/drivers/net/intel/iavf/iavf.h
@@ -32,7 +32,8 @@
 #define IAVF_IRQ_MAP_NUM_PER_BUF	 128
 #define IAVF_RXTX_QUEUE_CHUNKS_NUM	 2
 
-#define IAVF_NUM_MACADDR_MAX      64
+#define IAVF_UC_MACADDR_MAX      32768
+#define IAVF_MC_MACADDR_MAX      64
 
 #define IAVF_DEV_WATCHDOG_PERIOD     2000 /* microseconds, set 0 to disable*/
 
@@ -256,10 +257,10 @@ struct iavf_info {
 	uint32_t link_speed;
 
 	/* Unicast addrs */
-	struct rte_ether_addr mac_addrs[IAVF_NUM_MACADDR_MAX];
+	struct rte_ether_addr mac_addrs[IAVF_UC_MACADDR_MAX];
 
 	/* Multicast addrs */
-	struct rte_ether_addr mc_addrs[IAVF_NUM_MACADDR_MAX];
+	struct rte_ether_addr mc_addrs[IAVF_MC_MACADDR_MAX];
 	uint16_t mc_addrs_num;   /* Multicast mac addresses number */
 
 	struct iavf_vsi vsi;
diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c
index f7aeac8c83..2d055e6f5b 100644
--- a/drivers/net/intel/iavf/iavf_ethdev.c
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
@@ -411,10 +411,9 @@ iavf_set_mc_addr_list(struct rte_eth_dev *dev,
 		IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	int err, ret;
 
-	if (mc_addrs_num > IAVF_NUM_MACADDR_MAX) {
-		PMD_DRV_LOG(ERR,
-			    "can't add more than a limited number (%u) of addresses.",
-			    (uint32_t)IAVF_NUM_MACADDR_MAX);
+	if (mc_addrs_num > RTE_DIM(vf->mc_addrs)) {
+		PMD_DRV_LOG(ERR, "can't add more than a limited number (%u) of addresses.",
+			(unsigned int)RTE_DIM(vf->mc_addrs));
 		return -EINVAL;
 	}
 
diff --git a/drivers/net/intel/iavf/iavf_vchnl.c b/drivers/net/intel/iavf/iavf_vchnl.c
index decfae3182..418a7e897e 100644
--- a/drivers/net/intel/iavf/iavf_vchnl.c
+++ b/drivers/net/intel/iavf/iavf_vchnl.c
@@ -1712,8 +1712,8 @@ iavf_send_eth_addr_list(struct iavf_adapter *adapter, const char *caller,
 void
 iavf_add_del_secondary_mac_addr(struct iavf_adapter *adapter, bool add)
 {
+	uint8_t cmd_buffer[IAVF_ETH_ADDR_CMD_SIZE(IAVF_ETH_ADDR_PER_REQ)] = {0};
 	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);
-	uint8_t cmd_buffer[IAVF_ETH_ADDR_CMD_SIZE(RTE_DIM(vf->mac_addrs))] = {0};
 	struct virtchnl_ether_addr_list *list;
 
 	list = (struct virtchnl_ether_addr_list *)cmd_buffer;
@@ -1730,6 +1730,12 @@ iavf_add_del_secondary_mac_addr(struct iavf_adapter *adapter, bool add)
 			memcpy(vc_addr->addr, addr->addr_bytes, sizeof(addr->addr_bytes));
 			vc_addr->type = VIRTCHNL_ETHER_ADDR_EXTRA;
 		}
+
+		if (list->num_elements == IAVF_ETH_ADDR_PER_REQ) {
+			if (iavf_send_eth_addr_list(adapter, __func__, list, add))
+				return;
+			list->num_elements = 0;
+		}
 	}
 
 	if (list->num_elements != 0)
@@ -2308,8 +2314,8 @@ iavf_add_del_mc_addr_list(struct iavf_adapter *adapter,
 			struct rte_ether_addr *mc_addrs,
 			uint32_t mc_addrs_num, bool add)
 {
-	uint8_t cmd_buffer[IAVF_ETH_ADDR_CMD_SIZE(IAVF_NUM_MACADDR_MAX)] = {0};
 	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);
+	uint8_t cmd_buffer[IAVF_ETH_ADDR_CMD_SIZE(RTE_DIM(vf->mc_addrs))] = {0};
 	struct virtchnl_ether_addr_list *list;
 	uint32_t i;
 
-- 
2.54.0


  parent reply	other threads:[~2026-09-14  8:18 UTC|newest]

Thread overview: 146+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03  9:18 [PATCH 0/4] Remove limitations coming from legacy VMDq David Marchand
2026-04-03  9:18 ` [PATCH 1/4] ethdev: skip VMDq pools unless configured David Marchand
2026-06-01  9:30   ` Andrew Rybchenko
2026-04-03  9:18 ` [PATCH 2/4] ethdev: announce VMDq capability David Marchand
2026-04-06 22:22   ` Kishore Padmanabha
2026-04-29 14:18     ` David Marchand
2026-05-18 22:12       ` Kishore Padmanabha
2026-06-01  9:32   ` Andrew Rybchenko
2026-04-03  9:18 ` [PATCH 3/4] ethdev: hide VMDq internal sizes David Marchand
2026-06-01  9:34   ` Andrew Rybchenko
2026-04-03  9:18 ` [PATCH 4/4] net/iavf: accept up to 32k unicast MAC addresses David Marchand
2026-04-05 18:47 ` [PATCH 0/4] Remove limitations coming from legacy VMDq Stephen Hemminger
2026-04-29 14:22   ` David Marchand
2026-05-06 12:35 ` [PATCH v2 0/5] " David Marchand
2026-05-06 12:35   ` [PATCH v2 1/5] ethdev: skip VMDq pools unless configured David Marchand
2026-06-01  9:35     ` Andrew Rybchenko
2026-05-06 12:35   ` [PATCH v2 2/5] ethdev: announce VMDq capability David Marchand
2026-06-01  9:36     ` Andrew Rybchenko
2026-05-06 12:35   ` [PATCH v2 3/5] ethdev: hide VMDq internal sizes David Marchand
2026-05-06 12:35   ` [PATCH v2 4/5] net/iavf: accept up to 32k unicast MAC addresses David Marchand
2026-05-06 12:35   ` [PATCH v2 5/5] net/iavf: fix duplicate MAC addresses install David Marchand
2026-05-07  2:51   ` [PATCH v2 0/5] Remove limitations coming from legacy VMDq Stephen Hemminger
2026-05-10 15:03     ` David Marchand
2026-05-10 17:03 ` [PATCH v3 " David Marchand
2026-05-10 17:03   ` [PATCH v3 1/5] ethdev: check VMDq availability David Marchand
2026-06-01  9:38     ` Andrew Rybchenko
2026-05-10 17:03   ` [PATCH v3 2/5] ethdev: skip VMDq pools unless configured David Marchand
2026-06-01  9:38     ` Andrew Rybchenko
2026-05-10 17:03   ` [PATCH v3 3/5] ethdev: hide VMDq internal sizes David Marchand
2026-06-01  9:39     ` Andrew Rybchenko
2026-05-10 17:03   ` [PATCH v3 4/5] net/iavf: accept up to 32k unicast MAC addresses David Marchand
2026-05-12 14:41     ` Stephen Hemminger
2026-05-27 13:25       ` David Marchand
2026-05-10 17:03   ` [PATCH v3 5/5] net/iavf: fix duplicate MAC addresses install David Marchand
2026-07-09 16:02 ` [PATCH v4 00/10] Remove limitations coming from legacy VMDq David Marchand
2026-07-09 16:02   ` [PATCH v4 01/10] ethdev: check VMDq availability David Marchand
2026-07-09 16:02   ` [PATCH v4 02/10] ethdev: skip VMDq pools unless configured David Marchand
2026-07-09 16:02   ` [PATCH v4 03/10] ethdev: hide VMDq internal sizes David Marchand
2026-07-09 16:02   ` [PATCH v4 04/10] net/iavf: accept up to 32k unicast MAC addresses David Marchand
2026-07-09 16:02   ` [PATCH v4 05/10] net/iavf: fix duplicate MAC addresses install David Marchand
2026-07-13 13:12     ` Loftus, Ciara
2026-07-13 14:10       ` David Marchand
2026-07-14  9:23         ` Loftus, Ciara
2026-07-09 16:02   ` [PATCH v4 06/10] net/mlx5: remove MAC addresses flush helper on Linux David Marchand
2026-07-09 16:02   ` [PATCH v4 07/10] net/mlx5: remove redundant MAC address index checks David Marchand
2026-07-09 16:02   ` [PATCH v4 08/10] net/mlx5: pass maximum number of unicast MAC to common code David Marchand
2026-07-09 16:02   ` [PATCH v4 09/10] net/mlx5: use bitset for tracking MAC addresses David Marchand
2026-07-09 16:02   ` [PATCH v4 10/10] net/mlx5: accept more unicast " David Marchand
2026-07-10  6:44     ` David Marchand
2026-07-10  7:48     ` David Marchand
2026-07-23 12:41 ` [PATCH v5 00/10] Remove limitations coming from legacy VMDq David Marchand
2026-07-23 12:41   ` [PATCH v5 01/10] ethdev: check VMDq availability David Marchand
2026-07-23 12:41   ` [PATCH v5 02/10] ethdev: skip VMDq pools unless configured David Marchand
2026-07-23 12:41   ` [PATCH v5 03/10] ethdev: hide VMDq internal sizes David Marchand
2026-07-23 12:41   ` [PATCH v5 04/10] net/iavf: accept up to 32k unicast MAC addresses David Marchand
2026-07-23 12:41   ` [PATCH v5 05/10] net/iavf: fix duplicate MAC addresses install David Marchand
2026-07-23 12:41   ` [PATCH v5 06/10] net/mlx5: remove MAC addresses flush helper on Linux David Marchand
2026-07-23 12:41   ` [PATCH v5 07/10] net/mlx5: remove redundant MAC address index checks David Marchand
2026-07-23 12:41   ` [PATCH v5 08/10] net/mlx5: pass maximum number of unicast MAC to common code David Marchand
2026-07-23 17:35     ` Stephen Hemminger
2026-07-23 12:41   ` [PATCH v5 09/10] net/mlx5: use bitset for tracking MAC addresses David Marchand
2026-07-23 12:41   ` [PATCH v5 10/10] net/mlx5: accept more unicast " David Marchand
2026-07-27  7:20   ` [PATCH v5 00/10] Remove limitations coming from legacy VMDq David Marchand
2026-08-24 11:42 ` [PATCH v6 0/3] " David Marchand
2026-08-24 11:42   ` [PATCH v6 1/3] ethdev: check VMDq availability David Marchand
2026-08-24 11:42   ` [PATCH v6 2/3] ethdev: skip VMDq pools unless configured David Marchand
2026-08-24 16:21     ` Stephen Hemminger
2026-08-24 16:24       ` David Marchand
2026-08-24 16:39         ` Stephen Hemminger
2026-08-24 11:42   ` [PATCH v6 3/3] ethdev: hide VMDq internal sizes David Marchand
2026-08-24 17:01   ` [PATCH v6 0/3] Remove limitations coming from legacy VMDq Stephen Hemminger
2026-09-04 12:28 ` [PATCH v6 1/2] net/iavf: accept up to 32k unicast MAC addresses David Marchand
2026-09-04 12:28   ` [PATCH v6 2/2] net/iavf: fix duplicate MAC addresses install David Marchand
2026-09-09  9:39     ` Loftus, Ciara
2026-09-11 14:14       ` David Marchand
2026-09-11 15:37         ` David Marchand
2026-09-11 16:26           ` David Marchand
2026-09-10 10:24   ` [PATCH v6 1/2] net/iavf: accept up to 32k unicast MAC addresses Burakov, Anatoly
2026-09-11  9:37     ` Burakov, Anatoly
2026-09-11 11:52       ` David Marchand
2026-09-11 12:14         ` Burakov, Anatoly
2026-09-10 12:13   ` Burakov, Anatoly
2026-09-10 12:20     ` Burakov, Anatoly
2026-09-10 12:30       ` David Marchand
2026-09-10 12:38         ` Burakov, Anatoly
2026-09-08  9:27 ` [PATCH v6 1/5] net/mlx5: remove MAC addresses flush helper on Linux David Marchand
2026-09-08  9:27   ` [PATCH v6 2/5] net/mlx5: remove redundant MAC address index checks David Marchand
2026-09-11  8:36     ` Dariusz Sosnowski
2026-09-08  9:27   ` [PATCH v6 3/5] net/mlx5: pass maximum number of unicast MAC to common code David Marchand
2026-09-11  8:38     ` Dariusz Sosnowski
2026-09-08  9:27   ` [PATCH v6 4/5] net/mlx5: use bitset for tracking MAC addresses David Marchand
2026-09-11  8:40     ` Dariusz Sosnowski
2026-09-08  9:27   ` [PATCH v6 5/5] net/mlx5: accept more unicast " David Marchand
2026-09-11  8:59     ` Dariusz Sosnowski
2026-09-11  9:55       ` David Marchand
2026-09-11 10:01         ` Dariusz Sosnowski
2026-09-11  8:35   ` [PATCH v6 1/5] net/mlx5: remove MAC addresses flush helper on Linux Dariusz Sosnowski
2026-09-14  8:17 ` [PATCH v7 1/4] net/iavf: fix MAC addresses leak on reset David Marchand
2026-09-14  8:17   ` [PATCH v7 2/4] net/iavf: fix duplicate MAC addresses install David Marchand
2026-09-14 10:19     ` Loftus, Ciara
2026-09-14 11:56       ` David Marchand
2026-09-14 12:02         ` Bruce Richardson
2026-09-14 12:27           ` David Marchand
2026-09-23 11:53     ` Burakov, Anatoly
2026-09-14  8:17   ` [PATCH v7 3/4] net/iavf: add a helper for sending MAC addresses to PF David Marchand
2026-09-23 12:04     ` Burakov, Anatoly
2026-09-14  8:17   ` David Marchand [this message]
2026-09-23 12:14     ` [PATCH v7 4/4] net/iavf: accept up to 32k unicast MAC addresses Burakov, Anatoly
2026-09-14 10:15   ` [PATCH v7 1/4] net/iavf: fix MAC addresses leak on reset Loftus, Ciara
2026-09-14 11:54     ` David Marchand
2026-09-14 11:57       ` Loftus, Ciara
2026-09-23 11:47   ` Burakov, Anatoly
2026-09-23 14:37     ` Bruce Richardson
2026-09-14 14:42 ` [PATCH v7 1/5] net/mlx5: remove MAC addresses flush helper on Linux David Marchand
2026-09-14 14:42   ` [PATCH v7 2/5] net/mlx5: remove redundant MAC address index checks David Marchand
2026-09-21  8:31     ` Raslan Darawsheh
2026-09-21 10:06       ` David Marchand
2026-09-14 14:42   ` [PATCH v7 3/5] net/mlx5: pass maximum number of unicast MAC to common code David Marchand
2026-09-21  8:31     ` Raslan Darawsheh
2026-09-21 10:07       ` David Marchand
2026-09-14 14:42   ` [PATCH v7 4/5] net/mlx5: use bitset for tracking MAC addresses David Marchand
2026-09-14 14:42   ` [PATCH v7 5/5] net/mlx5: accept more unicast " David Marchand
2026-09-14 14:51     ` Dariusz Sosnowski
2026-09-21  8:31     ` Raslan Darawsheh
2026-09-21  8:31   ` [PATCH v7 1/5] net/mlx5: remove MAC addresses flush helper on Linux Raslan Darawsheh
2026-09-21 10:31     ` David Marchand
2026-09-21 11:02       ` Raslan Darawsheh
2026-09-21 11:50 ` [PATCH v8 " David Marchand
2026-09-21 11:50   ` [PATCH v8 2/5] net/mlx5: remove redundant MAC address index checks David Marchand
2026-09-21 11:50   ` [PATCH v8 3/5] net/mlx5: pass maximum number of unicast MAC to common code David Marchand
2026-09-21 11:50   ` [PATCH v8 4/5] net/mlx5: use bitset for tracking MAC addresses David Marchand
2026-09-21 11:50   ` [PATCH v8 5/5] net/mlx5: accept more unicast " David Marchand
2026-09-21 11:52     ` David Marchand
2026-09-23 11:55     ` Raslan Darawsheh
2026-09-24  6:38 ` [PATCH v9 1/5] net/mlx5: remove MAC addresses flush helper on Linux David Marchand
2026-09-24  6:38   ` [PATCH v9 2/5] net/mlx5: remove redundant MAC address index checks David Marchand
2026-09-29 12:50     ` Raslan Darawsheh
2026-09-24  6:38   ` [PATCH v9 3/5] net/mlx5: pass maximum number of unicast MAC to common code David Marchand
2026-09-29 12:50     ` Raslan Darawsheh
2026-09-24  6:38   ` [PATCH v9 4/5] net/mlx5: use bitset for tracking MAC addresses David Marchand
2026-09-29 12:50     ` Raslan Darawsheh
2026-09-24  6:38   ` [PATCH v9 5/5] net/mlx5: accept more unicast " David Marchand
2026-09-28 14:40     ` Dariusz Sosnowski
2026-09-29 12:50     ` Raslan Darawsheh
2026-09-29 13:24       ` David Marchand
2026-09-29 12:50   ` [PATCH v9 1/5] net/mlx5: remove MAC addresses flush helper on Linux Raslan Darawsheh

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=20260914081725.1097704-4-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=cfontain@redhat.com \
    --cc=ciara.loftus@intel.com \
    --cc=dev@dpdk.org \
    --cc=rjarry@redhat.com \
    --cc=vladimir.medvedkin@intel.com \
    /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