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 7B11B41BA0; Wed, 1 Feb 2023 17:38:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1695D42B8E; Wed, 1 Feb 2023 17:38:05 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id BEE194113F for ; Wed, 1 Feb 2023 17:38:03 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 4B69E5C0197; Wed, 1 Feb 2023 11:38:01 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 01 Feb 2023 11:38:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1675269481; x= 1675355881; bh=R/YX1wa+WtXbTEeEs5dzTb/J0JEOTjFxVgYzd7CPH7g=; b=o 6VXK2GFE4r4RgHUgPns/yfbOj91ltC4imqO/wD5RbOEv4ZyWm3b/DMLFpW8+5Itm rd7uWEMS6At0d/eYN9k2ivant4cGbZXdx9LjrKjhtic8H8UeZ0Myc5Sk2A2Af0Wo WK/LK96q3ls9Qq1R56FEPA6bEhSAByFwluYVHD70OmzZmlPFJmDYpijjpf/2PM4N Dx1nUNngyofQ06OYGG+f3r4o2E401x2/YKYjiYwu/6TUm1ejSBNPdBdlxVk3xZvN bVVMpBPFze7STparPSio6v0vyRLVEfhbLwGjhNAiPjkQ88MdUaB04YnXS/8b7rkg 03pzR8XppKlBw4jAgFKhw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1675269481; x= 1675355881; bh=R/YX1wa+WtXbTEeEs5dzTb/J0JEOTjFxVgYzd7CPH7g=; b=a 17/VutAgpTTTKR0XbWlmymIAGBg9FrwnXIwJNLACf/7c3i6/Z38lC5imJ6q5kW7R 4h0AQyGYwkMfp1mdv4fOGJFKV1Ul4b+jzSLdWwcDT8bKDBsAD/XPkYHhoyDjMioc aCQLbijGNuc72GlSJ92rVb2VJbx5OJXYE/XgOidc9+pPIPCV2bhU1KjNkPgpt6iv EN1PxjSoRtSfeEB0+1EZqw2HCeo7+vElahl5GriUB6/OOuSTTcPbtQKfS1KhqeFL 3zHSTlbcMjeGTilL/IlGmwOWk/pzfbxcYxNn7YVVf59E+78Ar0pYiPo/G47pczR6 0wLZw2jQr6Z+khLxP60bw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudefiedgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedtjeeiieefhedtfffgvdelteeufeefheeujefgueetfedttdei kefgkeduhedtgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Feb 2023 11:37:59 -0500 (EST) From: Thomas Monjalon To: Huisong Li Cc: dev@dpdk.org, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru, liudongdong3@huawei.com, huangdaode@huawei.com, fengchengwen@huawei.com, lihuisong@huawei.com Subject: Re: [PATCH V7] ethdev: fix one address occupies two entries in MAC addrs Date: Wed, 01 Feb 2023 17:37:57 +0100 Message-ID: <3915735.ZaRXLXkqSa@thomas> In-Reply-To: <20230201131501.15698-1-lihuisong@huawei.com> References: <20221020093102.20679-1-lihuisong@huawei.com> <20230201131501.15698-1-lihuisong@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 01/02/2023 14:15, Huisong Li: > The dev->data->mac_addrs[0] will be changed to a new MAC address when > applications modify the default MAC address by .mac_addr_set(). However, > if the new default one has been added as a non-default MAC address by > .mac_addr_add(), the .mac_addr_set() doesn't remove it from the mac_addrs > list. As a result, one MAC address occupies two entries in the list. Like: > add(MAC1) > add(MAC2) > add(MAC3) > add(MAC4) > set_default(MAC3) > default=MAC3, the rest of list=MAC1, MAC2, MAC3, MAC4 > Note: MAC3 occupies two entries. > > In addition, some PMDs, such as i40e, ice, hns3 and so on, do remove the > old default MAC when set default MAC. If user continues to do > set_default(MAC5), and the mac_addrs list is default=MAC5, filters=(MAC1, > MAC2, MAC3, MAC4). At this moment, user can still see MAC3 from the list, > but packets with MAC3 aren't actually received by the PMD. > > So need to ensure that the new default address is removed from the rest of > the list if the address was already in the list. > > Fixes: 854d8ad4ef68 ("ethdev: add default mac address modifier") > Cc: stable@dpdk.org > > Signed-off-by: Huisong Li > Acked-by: Chengwen Feng [...] > --- a/doc/guides/rel_notes/release_23_03.rst > +++ b/doc/guides/rel_notes/release_23_03.rst > @@ -101,10 +101,16 @@ API Changes > Use fixed width quotes for ``function_names`` or ``struct_names``. > Use the past tense. > > + useless line? > This section is a comment. Do not overwrite or remove it. > Also, make sure to start the actual text at the margin. > ======================================================= Please check the comment: "make sure to start the actual text at the margin." > + * ethdev: ensured all entries in MAC address list is unique. is -> are uniques > + The function ``rte_eth_dev_default_mac_addr_set`` replaces the address > + at index 0 of the address list. If the address was already in the > + address list, it is removed from the rest of the list. You need to highlight what changed: When setting a default MAC address with the function ``rte_eth_dev_default_mac_addr_set``, the address is now removed from the rest of the address list in order to ensure it is only at index 0 of the list. [...] > --- a/lib/ethdev/ethdev_driver.h > +++ b/lib/ethdev/ethdev_driver.h > @@ -117,7 +117,11 @@ 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 addresses. > + * All entries are unique. The first entry (index zero) is the > + * default address. > + */ You remember I asked to split lines after the dot? > /** > * Set the default MAC address. > + * It replaces the address at index 0 of the MAC address list. > + * If the address was already in the MAC address list, it is removed from > + * the rest of the list. Here you can split after the comma.