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 2E30C41B9D; Wed, 1 Feb 2023 11:42:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16B31406A2; Wed, 1 Feb 2023 11:42:19 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id B41094021F for ; Wed, 1 Feb 2023 11:42:17 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 58A5C5C00A9; Wed, 1 Feb 2023 05:42:17 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 01 Feb 2023 05:42:17 -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=1675248137; x= 1675334537; bh=P7BxW5UNeqcm89vbdykslYgON+ZtLOhwNqd7ZkN1WMY=; b=p 0mwPF/USnozEjakDCl6Pb2d1IM5sG9M2vCCoY6hjkoraXAWeOMdzMpB/gaahPHAC C7wX+MZwslWWsePygDTnzdvmFY/P7YU1WkS3Q5Q40GrKsRQzzORAp1GXlB0X7rsa oFg8wBL9iF+b72DQTNQuyYtx1X1hx0t7aGOW/AoQnpOK9yPtnKyRQOT3uOCjfMZP FoxhvtkuIkMWYW1oru86rQKoHr32Ugo3QgX7J+6OH8GLOOD9A16F+OSbLA7a7PiG HlZtwp8TwY4uozD5JKC6MLw6RpN74KxDD6/H7hLedwyFGGcbQVrQeTl4S0u6qZPh U8KYvu7Z2mFLqRpY9jcew== 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=1675248137; x= 1675334537; bh=P7BxW5UNeqcm89vbdykslYgON+ZtLOhwNqd7ZkN1WMY=; b=T JjQObtkPQtdO0XEjCbvLADvW25ZmJBR0MEBiWZO5UqbKb1CflacXYaG0vb4v+9tL OL7lbidcKZZePzzbwXqDQ44gI1ckqEsMVVfuLiDoxQMab86iczHynM0TcErXiVXU 69f/n78hVeZXdiddxu4Dn50iF48i4w30dbm9taD43pQ/lXuJdhEVbMNdcvmOlfZ1 yVMgBaBK6IlA4J5E1TYJdV2V7fdS+M0Dl/OtaHIpJlE1pUoQxxZGgbmoN25dghlf 9mBiO/BHpwPRuW4h1k4h3KcgLuqZQQWtnIDCc/7ir0yd1s2vrhD28f2Ka1LsKJRt d9rBjntxQ8ECSOihRpQBw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudefiedgudelucetufdoteggodetrfdotf 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 05:42:16 -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 Subject: Re: [PATCH V6] ethdev: fix one address occupies two entries in MAC addrs Date: Wed, 01 Feb 2023 11:42:14 +0100 Message-ID: <2165957.1BCLMh4Saa@thomas> In-Reply-To: <20230131064154.10571-1-lihuisong@huawei.com> References: <20221020093102.20679-1-lihuisong@huawei.com> <20230131064154.10571-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 31/01/2023 07:41, 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. > > Fixes: 854d8ad4ef68 ("ethdev: add default mac address modifier") > Cc: stable@dpdk.org > > Signed-off-by: Huisong Li > Acked-by: Chengwen Feng > --- > lib/ethdev/ethdev_driver.h | 6 +++++- > lib/ethdev/rte_ethdev.c | 35 +++++++++++++++++++++++++++++++++-- > 2 files changed, 38 insertions(+), 3 deletions(-) This is a behavior change. It must be noted in the release notes in the API section. > - /** Device Ethernet link address. @see rte_eth_dev_release_port() */ > + /** > + * Device Ethernet link addresses. The first entry (index zero) is the > + * default address. The rest of list cannot be the same as the default > + * address. > + */ Please split the lines after a dot. rest of "the" list Maybe better for this field: All entries are unique. The first entry (index zero) is the default address. > struct rte_ether_addr *mac_addrs; and for the function rte_eth_dev_default_mac_addr_set: Set the default MAC address. It replaces the address at index 0 of the address list. If the address was already in the MAC address list, it is removed from the rest of the list.