[PATCH V3 2/2] ethdev: document default and non-default MAC address

Min Hu (Connor) humin29 at huawei.com
Sat May 14 04:00:49 CEST 2022


From: Huisong Li <lihuisong at huawei.com>

The rte_eth_dev_data::mac_addrs is a MAC address array. The index zero of
this array is as the default address index, and other indexes can't be the
same as the address corresponding to index 0. If we break it, may cause
following problems:
1) waste of MAC address spaces.
2) a fake MAC address in the MAC list, isn't in hardware MAC entries.
3) a MAC address is assigned to diffent pool.

Signed-off-by: Huisong Li <lihuisong at huawei.com>
Signed-off-by: Min Hu <humin29 at huawei.com>
---
 lib/ethdev/ethdev_driver.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h
index 69d9dc21d8..d49e9138c6 100644
--- a/lib/ethdev/ethdev_driver.h
+++ b/lib/ethdev/ethdev_driver.h
@@ -115,7 +115,12 @@ struct rte_eth_dev_data {
 
 	uint64_t rx_mbuf_alloc_failed; /**< Rx ring mbuf allocation failures */
 
-	/** Device Ethernet link address. @see rte_eth_dev_release_port() */
+	/**
+	 * Device Ethernet link address. The index zero of the array is as the
+	 * index of the default address, and other indexes can't be the same
+	 * as the address corresponding to index 0.
+	 * @see rte_eth_dev_release_port()
+	 */
 	struct rte_ether_addr *mac_addrs;
 	/** Bitmap associating MAC addresses to pools */
 	uint64_t mac_pool_sel[RTE_ETH_NUM_RECEIVE_MAC_ADDR];
-- 
2.33.0



More information about the dev mailing list