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 21DB9A0C4C;
	Tue,  5 Oct 2021 19:12:57 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id C9F93413FA;
	Tue,  5 Oct 2021 19:12:56 +0200 (CEST)
Received: from mga09.intel.com (mga09.intel.com [134.134.136.24])
 by mails.dpdk.org (Postfix) with ESMTP id 31B3B413F2
 for <dev@dpdk.org>; Tue,  5 Oct 2021 19:12:54 +0200 (CEST)
X-IronPort-AV: E=McAfee;i="6200,9189,10128"; a="225701469"
X-IronPort-AV: E=Sophos;i="5.85,349,1624345200"; d="scan'208";a="225701469"
Received: from fmsmga003.fm.intel.com ([10.253.24.29])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 05 Oct 2021 10:12:41 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.85,349,1624345200"; d="scan'208";a="559397313"
Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15])
 by FMSMGA003.fm.intel.com with ESMTP; 05 Oct 2021 10:12:31 -0700
Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by
 ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2242.12; Tue, 5 Oct 2021 10:12:28 -0700
Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by
 orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2242.12 via Frontend Transport; Tue, 5 Oct 2021 10:12:28 -0700
Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.173)
 by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2242.12; Tue, 5 Oct 2021 10:12:27 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nwZWimSgUXo5dwupFSxbyJNJfpLddCiP/da4Oc2bRB6fJ2VL+ORLe+36D6wnAHgVRI/wr/makApGVNjaTHh/WJK3mDYrAe0qOKQj8LR2Cj9J9oxYuZSCXk5/Sy1Mlb04+ARkh1PAE327NNGLjVQfMSVd9abF6ThhNHZ/7GpQ0D33eFuHi+WSt65HLcYaa7W39ddbmlkCmblGOB9422+dqGrtjYgYsAmM5kEKs6wI2BKm/VqBntI2LwYFCNEOPCW/R5/oqwhpBcjWldg8xVXEuff6IvgV90p+pKKZiG0MO9PwBTQfChLdBB8Lcn2RYEu4VD/9YkK1ZxmUkpPeDyGrCA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=aWtQcmrjpb5hOj+oirRYDUQkYsFRwT1fXrYCTbSD7IU=;
 b=RAdBS3r7c2zBWAcMfbov+/Ri7mr2RPhYBYX2VRrmhaV2YuHh7iyhomdsZblVb76yZci2ySyuGtL9tosmaff93pEknPTmcZBP/w09iTs+u+WDCERP8bRZsXJzhCzf1f8ZQBTXGR5p/Suw1Rym5gIKa8HvUpP5LD6B1xtLWhtcR1AVjsgBIGogfliiciFO3gZqIZaG9gV1IFFZ70LKYACB+LpPIE4sJkBleqqslFFTws0Z/gGIxylk6nw+okwbOBgP7Hn6I4DaNBFs3OTruqakgaMF7jyNdf4EAFVLpfCoTHifhoCTMh7z2whMHmvP8gc+ccwIiKj3eFdHEee+0jYIDQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; 
 s=selector2-intel-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=aWtQcmrjpb5hOj+oirRYDUQkYsFRwT1fXrYCTbSD7IU=;
 b=C3Cs4Ra7GRBIpCPqHtRTUXMAiT4i0CqI02wGhvSdWp3g4NsD+3iDO3hmhLYH7OYrpVmonNnuMaG4vSDQo+ag3o9fYp6q4QKxtY2VcUzoaDcfiOYcEYd8sNfaOdvWhTfSxsBHTkzcmHyijYsFKLFeVZw9vjrsojPK8tS4y+9g+Pw=
Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19)
 by DM6PR11MB2953.namprd11.prod.outlook.com (2603:10b6:5:6a::15) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.22; Tue, 5 Oct
 2021 17:12:23 +0000
Received: from DM6PR11MB4491.namprd11.prod.outlook.com
 ([fe80::740e:126e:c785:c8fd]) by DM6PR11MB4491.namprd11.prod.outlook.com
 ([fe80::740e:126e:c785:c8fd%4]) with mapi id 15.20.4566.022; Tue, 5 Oct 2021
 17:12:23 +0000
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: Thomas Monjalon <thomas@monjalon.net>
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>
Thread-Topic: [dpdk-dev] [PATCH v4 5/7] ethdev: add API to retrieve multiple
 ethernet addresses
Thread-Index: AQHXuSfjG9xVha5eB0SK5awVsRBSXavEY0+AgAA1CRCAAAYbgIAABcfg
Date: Tue, 5 Oct 2021 17:12:22 +0000
Message-ID: <DM6PR11MB449115E1ECF276ED60F5B4D29AAF9@DM6PR11MB4491.namprd11.prod.outlook.com>
References: <20211001140255.5726-1-konstantin.ananyev@intel.com>
 <2488441.iy33XtL31i@thomas>
 <DM6PR11MB4491042F0007053CAD2DAEF49AAF9@DM6PR11MB4491.namprd11.prod.outlook.com>
 <3664681.X88tCSIGuU@thomas>
In-Reply-To: <3664681.X88tCSIGuU@thomas>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
dlp-product: dlpe-windows
dlp-reaction: no-action
dlp-version: 11.6.200.16
authentication-results: monjalon.net; dkim=none (message not signed)
 header.d=none;monjalon.net; dmarc=none action=none header.from=intel.com;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: f8805093-0944-4329-f2c3-08d988234c0c
x-ms-traffictypediagnostic: DM6PR11MB2953:
x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <DM6PR11MB295331962B331ED7DBCFB2619AAF9@DM6PR11MB2953.namprd11.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:9508;
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: AJJsg9Yqx00grjmrTOAJR8dpt4aa4mhdUeF9XgjcZt8amcNIRz5aLZHzS4jzimcuxq59gho2W3jaeQ5u/yDmJg5HYsLOT5JkvvG+Ay49007TFwWeGWsON9OO91lWGbAuEaWW0ow866c5cwqQ+f9P0ruBztb2iRUPbwdOsYIYwrzCVOID4TNopjrxZr4Cor7CG7XWSSuMgoz9NLuJcMWwW+AML7RSKpzquAus4sjJKKEYfo55IOxX1EOwTVTnRIhYTy3OIVjzCVM4fAWrRea4NwjERf4vwa41k2XKGwLo0gg8nNa0M8YwZ4adHicAGrmaMZ9M8p9MUCTRDTiMs6/6W0xrVxY8HK2wgv5HL9TgXgYdKuYUGehIFyMClS1vO2S5j4jrfsRcVmYJOvoMIN/zYlbcUUA+W6BdIDzPdfb1xZWJNvJVcEkPg2yIB5F2IBE0O6oy3V+vn3HEgcn7eaMr71XGeZDeTn+9GwG0gNGQ9m34ui/Od2urzhtz7+p0duL/atXbD7bAdAe8QRtLN/Fewbj8wj9lTg0ZuNQ9fynIIZK3dFieH8v4tYDibHCFSCDbuMPnNkyOdveyC7AqpP3uS8cQmfyBaEwx6rZcbRse+Zx45TtwvMItjmHDjRtew/nRT2Ahx0NeuUCKbzhCSjNG/VT/x/UVjZI6lvf8iw+fsMZlAAcF8Yai7bIlZn9n1xzJC4HsVOK++/dtqpQSaVLj8w==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(4636009)(366004)(55236004)(9686003)(66476007)(4326008)(66446008)(2906002)(7406005)(55016002)(6506007)(86362001)(8936002)(8676002)(7416002)(66556008)(64756008)(52536014)(186003)(33656002)(26005)(6916009)(7696005)(107886003)(66946007)(38070700005)(54906003)(316002)(122000001)(76116006)(38100700002)(508600001)(71200400001)(5660300002);
 DIR:OUT; SFP:1102; 
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?byDUuG5GG9biF3p7faYoAA1KN6p5nu4YWnhatMxs+xYH8MdAWddsTKvTHfME?=
 =?us-ascii?Q?/IowYLTlFVLcwlamNrWt8Vot2rlnl5tH6vP07bsrVJLJ0zUOYxUT+DkcvwfR?=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us-ascii?Q?S3I7gyJT1hhLY/nSJF0b7Xb56guRbV4TFSR1DNKuIlu0uqZQ23iFaDTUvQef?=
 =?us-ascii?Q?AQw4rPGWAHZpde2QM79Fiyi1uhlOCbzILzD+UolxaeEg2nZ+Uc/+CnVpYCIi?=
 =?us-ascii?Q?eu+2ucbPpLymfxYIf/2mCCyI9Xsx5M5gPS6WGx48wGbqUG3C8ehiALP7HMAw?=
 =?us-ascii?Q?/tcIP48nlwzN+YdbSInNPT155cg/z1sViLGUAfN8saH4kAslYSWR8sz9ldWI?=
 =?us-ascii?Q?joAMBE63ufxvQW+CqX9lax63CYl0gXyobbwXxQjz1R1Qq2uX7ZxxZWQSqt5i?=
 =?us-ascii?Q?xc/+7Zo2N0xXGUF/r5mVg4IFI0+J+5qaTg+0kP2ZohjkGM3I3oqYnHFpuSZr?=
 =?us-ascii?Q?HD0cCe6owUQqqhv5dGixblGb?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4491.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f8805093-0944-4329-f2c3-08d988234c0c
X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2021 17:12:22.9596 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: bSmuw/hRCZDKpWcftZ2rvgC5TmoQhDFyh+72YgoYOORHdZOWMqosYWxojULHvzUbrCN1Bhln4lgjJdf5qGdQp5c0seww5dCtln3ftiR1g/s=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2953
X-OriginatorOrg: intel.com
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>



=20
> 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 ethe=
rnet
> > > > 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.
>=20
> I was sure we had other function.

I didn't find one.
If we do, I am ok to drop that change and rework testpmd code to use
existing one instead.

> Anyway, would be good to reference rte_eth_macaddr_get in the commit.
>=20
>=20
> > > > +/**
> > > > + * 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 b=
e 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.
>=20
> So we don't know know whether there are more.

rte_eth_dev_info. max_mac_addrs tells max number of MACs for this port.

>=20
> > > > + */
> > > > +__rte_experimental
> > > > +int rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr m=
a[],
> > >
> > > 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 i=
ndex.
> > >
> >
> > Yes, it is another possible way.
> > Though current one seems a bit more convenient to me.
>=20
> It misses a way to get the number of addresses.
>=20