From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id F3EC1A034F;
	Mon, 11 Oct 2021 11:02:34 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 1998541102;
	Mon, 11 Oct 2021 11:02:30 +0200 (CEST)
Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com
 [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id C7040410EA
 for <dev@dpdk.org>; Mon, 11 Oct 2021 11:02:27 +0200 (CEST)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
 by mailout.nyi.internal (Postfix) with ESMTP id 6C09A5C0125;
 Mon, 11 Oct 2021 05:02:27 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute2.internal (MEProxy); Mon, 11 Oct 2021 05:02:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding:content-type; s=fm2; bh=
 g4aesa8SeaiQhLu9zZ+Pb04TUgppGa0WdIwzdnPt0tY=; b=dxOLauSkMDKRr4iT
 SF8SOeCRVMBWckYLA0LaxN0iJSywIQtBccs4Sc+XW84TAxox7TN8udVuiqemPgDw
 aH1oKnVqxutOMVEVHiTMdSbIjVBxWvz8fG5pukZNraq5qCzGM1Cy7PTkrGBrp26k
 9XVURukho4WgY7YGu8FCFHaaPgaeOXwT+2WfYAB9idEgGTf+b2xj1/3O5Ws/Gagb
 8uT7Np2OMpac1xRXUN4BDNpqtkhJLo7lf+s4THgS5oBQ1GdTpTDoi16Z6u+JI9CY
 2U5cjhT/+mjY28d43Kdnsa69/v6ju02aQZlpdvTWXfcMjzI71aqhnM3bn8VaT8NF
 4DFYjQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm1; bh=g4aesa8SeaiQhLu9zZ+Pb04TUgppGa0WdIwzdnPt0
 tY=; b=Dtpyvci8XSqJXInw64V8jteyntGfqEwWAaYiQ9Z4mO5+/Kap8otPYfQ4y
 QSszx00dmMPFzwcZdPTnMetHpp98jgxumQq80iQbNTm7pzQkHMVBEGqKx3N9R3Yl
 8eAj54mB8v6MDC7HjZxR1qltgux5q0BK0jtx6iCHnUB7qUUnvz1OUFndKiSxF4il
 cNEsvO2EnpiZouU7Kbm13DT+eUnKHn9e5QXe9ehgZMCuOPoQPIVqLYK5xzbC/Irv
 PiFEcQgfK3Zv3s0scWObZxh/jQAl7iVjUNuFXprJ155Ag0kqXQxz+sj8yijbNuLq
 ilOTziqK08dsGeKgZHJwZUDm9mkEA==
X-ME-Sender: <xms:o_1jYdr1AEST8f89gw1g4Fqo9pkS2O1kOfGnHKVUXxLY6bfgUQJ3xg>
 <xme:o_1jYfqlOMqC90PxXneI1dmCSEnpJEOLBHF_zuetrZ_vHykF-1DtJTIjgKXtBKqdo
 0DD8hFN8TV1RfY-FQ>
X-ME-Received: <xmr:o_1jYaOfFcXZFqs7xZwNr_PvaUvELSLTbVC5kyvB1r5HH803bZPLbOwyHPA-m6IJ6CNo4WDX811b5dxf2RIKNF42JQkeuZwqJpUvYg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddtiedgtdejucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufffkfgjfhgggfgtsehtqhertddttdejnecuhfhrohhmpefvhhhomhgr
 shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg
 ftrfgrthhtvghrnhepkeethedtieevhfeigeejleegudefjeehkeekteeuveeiuedvveeu
 tdejveehveetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh
 homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth
X-ME-Proxy: <xmx:o_1jYY7WyCBusenHgegBZ8Hp32DMYW2p8oHtietC0JQNjkfLbt3r3g>
 <xmx:o_1jYc6ycpH9p8EIFbS2SJjJkr6rO6ldj0gg9-6AwCR6XHnqp0_-Vw>
 <xmx:o_1jYQjSSfVIq9pNS114aTYYXUqltjK0ZEkZqZr10CXz8_pK4UsgTw>
 <xmx:o_1jYcELaIMv-xlvh9X0bjHGzMqoNrMsR_n_s-EDyzf6BM5WvFgBkw>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 11 Oct 2021 05:02:25 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: "Min Hu (Connor)" <humin29@huawei.com>
Cc: dev@dpdk.org, ferruh.yigit@intel.com, andrew.rybchenko@oktetlabs.ru
Date: Mon, 11 Oct 2021 11:02:22 +0200
Message-ID: <40850805.OagmqkyRbq@thomas>
In-Reply-To: <117602c7-b6d3-f4e3-1b3d-c12da6dca113@huawei.com>
References: <20210922033630.41130-1-humin29@huawei.com>
 <5857742.MVTgjyL6ng@thomas> <117602c7-b6d3-f4e3-1b3d-c12da6dca113@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
Subject: Re: [dpdk-dev] [PATCH] ethdev: fix one MAC address occupies two
 index in mac addrs
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

09/10/2021 11:53, Min Hu (Connor):
> Hi, Thomas,
>=20
> The dev->data->mac_addrs[0] will be changed to a new MAC address when=20
> applications modify
> the default MAC address by rte_eth_dev_default_mac_addr_set() API.=20
> However, If the new default
> MAC address has been added as a non-default MAC address by=20
> rte_eth_dev_mac_addr_add() API, the
> rte_eth_dev_default_mac_addr_set() API doesn't remove it from=20
> dev->data->mac_addrs[].
> As a result, one MAC address occupies two index capacities in=20
> dev->data->mac_addrs[].
> This patch adds the logic of removing MAC addresses for this scenario.
>=20
> Is that will be more clear? Hope for your reply

Yes, that's the explanation I was expecting. Thank you!


> =E5=9C=A8 2021/10/8 18:04, Thomas Monjalon =E5=86=99=E9=81=93:
> > 08/10/2021 09:02, Min Hu (Connor):
> >> Hi, Thomas,
> >>
> >> =E5=9C=A8 2021/10/6 3:21, Thomas Monjalon =E5=86=99=E9=81=93:
> >>> 22/09/2021 05:36, Min Hu (Connor):
> >>>> From: Huisong Li <lihuisong@huawei.com>
> >>>>
> >>>> Use the testpmd to perform the following operations:
> >>>> 1) mac_addr add 0 00:18:2D:00:00:90
> >>>> 2) mac_addr add 0 00:18:2D:00:00:91
> >>>> 3) mac_addr add 0 00:18:2D:00:00:92
> >>>> 4) mac_addr set 0 00:18:2D:00:00:91
> >>>> 5) show port 0 macs
> >>>> Number of MAC address added: 4
> >>>>     00:18:2D:00:00:91
> >>>>     00:18:2D:00:00:90
> >>>>     00:18:2D:00:00:91
> >>>>     00:18:2D:00:00:92
> >>>
> >>> Please describe with words.
> >>> Reading similar MAC addresses is not a fun game.
> >>
> >> I do not catch you, could you please be
> >> more detailed, thanks.
> >=20
> > Me too, I don't catch you.
> > Please explain the problem in the commit log
> > so we can understand without the example.
> >=20
> >>>> This is due to the reason that if the address has been added as a
> >>>> non-default MAC address by rte_eth_dev_mac_addr_add API, it doesn't =
remove
> >>>> from dev->data->mac_addrs[] when set default MAC address with the sa=
me
> >>>> address.
> >>>>
> >>>> Fixes: 854d8ad4ef68 ("ethdev: add default mac address modifier")
> >>>> Cc: stable@dpdk.org
> >>>>
> >>>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> >>>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>