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 637EB41BAE; Thu, 2 Feb 2023 14:12:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 388DF42D32; Thu, 2 Feb 2023 14:12:02 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id E3BE64014F for ; Thu, 2 Feb 2023 14:12:00 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1A3F15C009D; Thu, 2 Feb 2023 08:11:59 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 02 Feb 2023 08:11:59 -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=1675343519; x= 1675429919; bh=k15hcIKPRvLwyBidvsHkalvEKG7ZydTh0AzXPHx88bg=; b=G 7CcPjLnCTF2nOD2RNFxf2sbi1RGOudLF+oD4dCFGTqLPeBBvvkONhHG38VpIhZ/Y 59u/WSlj5OEo33/K35BgPpQNpMFdm2xvdYhSLxld3p1lew+8rYOPtFZDwqbLRKN7 r0dJb87zb+7AgBTUJ4oP7me72QbfXxoNn5GxPMPvVQc1ug2kQ/lb/8ae0LcA5M1E WyltNgqLT+uP2w7Ei1NoV3v/9PAtzkfsFxp2KYVulazBW26pNqGyUSJxTFwLUWYs 8CZ3+r7rQDFJ2Q7dOzZ91NRZltxEYslgn2lcS/ytKYPAtYHIZvjK4+IdDtq0+bkB t/2CGBKn5zwzrYOUjZ0dA== 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=1675343519; x= 1675429919; bh=k15hcIKPRvLwyBidvsHkalvEKG7ZydTh0AzXPHx88bg=; b=Z GiaSS+4jASdu7hU9oBgMKwlMRW8LxOhx1X2s0LXBrcik/2sXTaijOt73xQfcub3+ Cw+fW5vd166fqUfzFaAnbBheUNUnRwBBOWBE/y/nrcQODneVgOnpAdDKPWaJLutf G91zw9NVeywiGUWfFcbUxLDT8qY6HTjM8zolxRb4274yeD7nzG7C5XXDWKczEOfo g7rjUUgaNPx4ZwGHScEy2+veInGkJcb9pwGn3OaQjpW59ZA0skFET0EpUnumB2me 7eTrGTe91J/swBDFzf+9kBaDUPPjM02IyflGQf3cuxjkDl8+AiLmi/Ra2SBnCIJu WYzBHrG517pomyBHWu9sg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudefkedggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedtjeeiieefhedtfffgvdelteeufeefheeujefgueetfedttdei kefgkeduhedtgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 2 Feb 2023 08:11:57 -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 V8] ethdev: fix one address occupies two entries in MAC addrs Date: Thu, 02 Feb 2023 14:11:56 +0100 Message-ID: <7764739.EvYhyI6sBW@thomas> In-Reply-To: <20230202123625.14975-1-lihuisong@huawei.com> References: <20221020093102.20679-1-lihuisong@huawei.com> <20230202123625.14975-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 02/02/2023 13:36, 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 the 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 Acked-by: Thomas Monjalon Thank you