From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4E0CBA0544; Wed, 1 Jun 2022 19:49:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 421AB427F6; Wed, 1 Jun 2022 19:49:46 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 132C14003F for ; Wed, 1 Jun 2022 19:49:44 +0200 (CEST) Received: from [192.168.1.126] (unknown [188.242.181.57]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 9F67CB2; Wed, 1 Jun 2022 20:49:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 9F67CB2 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1654105783; bh=vAhmi5rSO7lwUAt9/fMb7iWIumNxA/FAlPxwgKCN6Eg=; h=Date:Subject:To:References:Cc:From:In-Reply-To:From; b=yXXgbuQc5Yw5LL68kjYCr20ufLduuAyI0xWHIx39njOw57fflW0wamOSz+QpGTmQ/ 9h/+MgRMbfh6LuRxmZ38cdTrBvOCg4msHXksgJDAcEGR6anSBp2pm/LlEUabvUYry/ iVJVyCaXPEoHvKkvkTa0K1NzhjlV0QgHxv9zBi2Y= Message-ID: <4c77e589-396b-a358-3d5f-4764de45a26d@oktetlabs.ru> Date: Wed, 1 Jun 2022 20:49:43 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v4 2/2] ethdev: document default and non-default MAC address Content-Language: en-US To: "Min Hu (Connor)" , dev@dpdk.org References: <20220514020049.57294-1-humin29@huawei.com> <20220601063949.43202-1-humin29@huawei.com> <20220601063949.43202-3-humin29@huawei.com> Cc: Thomas Monjalon , Ferruh Yigit From: Andrew Rybchenko In-Reply-To: <20220601063949.43202-3-humin29@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 6/1/22 09:39, Min Hu (Connor) wrote: > From: Huisong Li > > 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 > Signed-off-by: Min Hu > --- > 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]; The patch itself does not make sense since it documents what happens in the first patch of the series. So, it should be a part of the first patch.