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 5BEC0A0C4C;
	Tue,  5 Oct 2021 18:45:33 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id F28614132B;
	Tue,  5 Oct 2021 18:45:32 +0200 (CEST)
Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com
 [66.111.4.229]) by mails.dpdk.org (Postfix) with ESMTP id C090F41297
 for <dev@dpdk.org>; Tue,  5 Oct 2021 18:45:31 +0200 (CEST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailnew.nyi.internal (Postfix) with ESMTP id 58242581012;
 Tue,  5 Oct 2021 12:45:31 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute1.internal (MEProxy); Tue, 05 Oct 2021 12:45:31 -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=
 X/T8pak2wFitMZf9CclUEypcgRWHqfGDaXCkcORgU8Y=; b=Iogn2FmGlSor23zF
 cM3h60K59hjjIZxYVxhFHuvuwLwjgIT6hGGucMUcM6guSXtWDcDCQRmRugq7/SzH
 cPepAh3P2HS3zLOITw2QlgZdkniZBFrPCaSCUbyc7cXVvbNVW9m7hPBmAUguoeMw
 8T6c/6gR2IS0XJEWrKjLe8dXWPw4+gSv1aZK6rjgnmz8uP8KpXa4tOIJTrOvGmPU
 yh3Qjb7ewUUF4d2NZTRB5FAVQyKII45VfndfCZN6Cwne1OqYyNeuGxt5soMeyONJ
 s/nL9O3Yz+MAEAiXIBx+6Qh/9d0ChryuSzKOXHXEiNCl6k0B5YjJoSlV5biyXPTW
 yHM81g==
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=X/T8pak2wFitMZf9CclUEypcgRWHqfGDaXCkcORgU
 8Y=; b=ljbyzNTxqbsu/6lL89WBx6h+SEUbIstyz3K3JdS2Cor0oTptzsoc1oFlT
 6ftPUrvLfNGH3jJ+vhJDfbT7zZWPr4pvNfbSuLlvAc9yShKU4TCeSyyJtvgI2smK
 Z+CwQtUebzTqWs8JNwW4JtYd9Bx5Y7cG1FpBCRXrgTuN2bYEU3BgFEQvhxfUtpfo
 PnsPsFxihQxgxCZ8GA48hAV6d8I+a+Ec0yic4tFlk3/mMb9spRlb5DPp0fNeUxGJ
 SEqBbQZfNnHACkdtQIPDxitC3miiBNo6Pz8WiZ7oYYJqPQNBUltngMzKKkLoKB5j
 vNjash3HZnq+48bzfldDw6vuJWM8g==
X-ME-Sender: <xms:KoFcYUWzpl4N1FeyWlI5wvp1IA8oj7mTMF_mHfdjZb_qH4rDhwFA3w>
 <xme:KoFcYYlunHMqwH3PE25IMWB6xLFNqgpSsORTq8I2H0nkfEAmfE7KwylO-H013x_7O
 nhsgEOM01tRgwpRbQ>
X-ME-Received: <xmr:KoFcYYZ-lnAKROEGu4a8OoW0o84LOKao4_CqF-NwH4seJ5T_kIFF-ExfG7X8aT3uffuocSpogvOLj2RbjZ_TZV-S5IHB3tCcwUjSWKxZhzc>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudelgedguddthecutefuodetggdotefrod
 ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh
 necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd
 enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm
 rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc
 ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej
 ueeiiedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh
 hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght
X-ME-Proxy: <xmx:KoFcYTWvK0L-oAkakLzVr4RW5dmrJnIdu7vmqlSRwv0zGQfdg--LWA>
 <xmx:KoFcYen7IiMoqGZRqzNRgi9zstFeZ9ajEsWcOIUPI3yT5JdmXI0fgA>
 <xmx:KoFcYYc06y1gVeGV06m3MRsaHNaVDeFzSC7pYyc9HXOTitE1jJaC5w>
 <xmx:K4FcYRZZxHMv4vk9JuOD3QL7sIIrMZT60io6P1wyhxDQtRmdNUngjQ>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 5 Oct 2021 12:45:22 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "Li, Xiaoyun" <xiaoyun.li@intel.com>,
 "anoobj@marvell.com" <anoobj@marvell.com>,
 "jerinj@marvell.com" <jerinj@marvell.com>,
 "ndabilpuram@marvell.com" <ndabilpuram@marvell.com>,
 "adwivedi@marvell.com" <adwivedi@marvell.com>,
 "shepard.siegel@atomicrules.com" <shepard.siegel@atomicrules.com>,
 "ed.czeck@atomicrules.com" <ed.czeck@atomicrules.com>,
 "john.miller@atomicrules.com" <john.miller@atomicrules.com>,
 "irusskikh@marvell.com" <irusskikh@marvell.com>,
 "ajit.khaparde@broadcom.com" <ajit.khaparde@broadcom.com>,
 "somnath.kotur@broadcom.com" <somnath.kotur@broadcom.com>,
 "rahul.lakkireddy@chelsio.com" <rahul.lakkireddy@chelsio.com>,
 "hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>,
 "sachin.saxena@oss.nxp.com" <sachin.saxena@oss.nxp.com>, "Wang,
 Haiyue" <haiyue.wang@intel.com>, "Daley, John" <johndale@cisco.com>,
 "hyonkim@cisco.com" <hyonkim@cisco.com>, "Zhang,
 Qi Z" <qi.z.zhang@intel.com>, "Wang, Xiao W" <xiao.w.wang@intel.com>,
 "humin29@huawei.com" <humin29@huawei.com>,
 "yisen.zhuang@huawei.com" <yisen.zhuang@huawei.com>,
 "oulijun@huawei.com" <oulijun@huawei.com>, "Xing,
 Beilei" <beilei.xing@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>,
 "Yang, Qiming" <qiming.yang@intel.com>,
 "matan@nvidia.com" <matan@nvidia.com>,
 "viacheslavo@nvidia.com" <viacheslavo@nvidia.com>,
 "sthemmin@microsoft.com" <sthemmin@microsoft.com>,
 "longli@microsoft.com" <longli@microsoft.com>,
 "heinrich.kuhn@corigine.com" <heinrich.kuhn@corigine.com>,
 "kirankumark@marvell.com" <kirankumark@marvell.com>,
 "andrew.rybchenko@oktetlabs.ru" <andrew.rybchenko@oktetlabs.ru>,
 "mczekaj@marvell.com" <mczekaj@marvell.com>,
 "jiawenwu@trustnetic.com" <jiawenwu@trustnetic.com>,
 "jianwang@trustnetic.com" <jianwang@trustnetic.com>,
 "maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>, "Xia,
 Chenbo" <chenbo.xia@intel.com>, "Yigit, Ferruh" <ferruh.yigit@intel.com>,
 "mdr@ashroe.eu" <mdr@ashroe.eu>, "Jayatheerthan,
 Jay" <jay.jayatheerthan@intel.com>
Date: Tue, 05 Oct 2021 18:45:19 +0200
Message-ID: <3664681.X88tCSIGuU@thomas>
In-Reply-To: <DM6PR11MB4491042F0007053CAD2DAEF49AAF9@DM6PR11MB4491.namprd11.prod.outlook.com>
References: <20211001140255.5726-1-konstantin.ananyev@intel.com>
 <2488441.iy33XtL31i@thomas>
 <DM6PR11MB4491042F0007053CAD2DAEF49AAF9@DM6PR11MB4491.namprd11.prod.outlook.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [PATCH v4 5/7] ethdev: add API to retrieve multiple
 ethernet addresses
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>

05/10/2021 18:35, Ananyev, Konstantin:
> > 04/10/2021 15:56, Konstantin Ananyev:
> > > Introduce rte_eth_macaddrs_get() to allow user to retrieve all ethernet
> > > addresses assigned to given port.
> > 
> > We already have functions to get MAC addresses.
> > Please explain the difference.
> 
> rte_eth_macaddr_get() returns just first (primary) MAC address
> assigned to the port.
> That one allow user to retrieve all addresses assigned to the port.

I was sure we had other function.
Anyway, would be good to reference rte_eth_macaddr_get in the commit.


> > > +/**
> > > + * Retrieve the Ethernet addresses of an Ethernet device.
> > > + *
> > > + * @param port_id
> > > + *   The port identifier of the Ethernet device.
> > > + * @param ma
> > > + *   A pointer to an array of structures of type *ether_addr* to be filled with
> > > + *   the Ethernet addresses of the Ethernet device.
> > > + * @param num
> > > + *   Number of elements in the *ma* array.
> > > + * @return
> > > + *   - number of retrieved addresses if successful
> > > + *   - (-ENODEV) if *port_id* invalid.
> > > + *   - (-EINVAL) if bad parameter.
> > 
> > Which error if the array is too small?
> 
> None, we just return up to *num* addresses, that's it.

So we don't know know whether there are more.

> > > + */
> > > +__rte_experimental
> > > +int rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr ma[],
> > 
> > Please don't use array syntax in parameters, it should be a pointer.
> > How do we get the number of returned addresses?
> > 
> > > +	uint32_t num);
> 
> From above:
>  * @return
>  *   - number of retrieved addresses if successful
>  
> > Another approach would be to get addresses one by one by passing an index.
> > 
> 
> Yes, it is another possible way.
> Though current one seems a bit more convenient to me. 

It misses a way to get the number of addresses.