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 85A44A0C4C; Tue, 5 Oct 2021 18:35:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70483413DD; Tue, 5 Oct 2021 18:35:13 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 5E93A413AF for ; Tue, 5 Oct 2021 18:35:12 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10128"; a="225690819" X-IronPort-AV: E=Sophos;i="5.85,349,1624345200"; d="scan'208";a="225690819" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2021 09:35:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,349,1624345200"; d="scan'208";a="589423352" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga004.jf.intel.com with ESMTP; 05 Oct 2021 09:35:09 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx606.amr.corp.intel.com (10.18.126.86) 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 09:35:09 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx609.amr.corp.intel.com (10.18.126.89) 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 09:35:08 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx607.amr.corp.intel.com (10.18.126.87) 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 09:35:08 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.177) by edgegateway.intel.com (192.55.55.68) 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 09:35:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vu8qIp5ONw5WSzRpY3a9bu8H5w9n45lX1a3y0MSqe8ObUy1BQ7VBllkNHnVnBcpG82TSsQsuHZ2SJ3hKpii4q6GISmsccsW8tUxxKVPUrw/tRrlq6Oi3TiV6PYRFR8FTuWbExLabNsq8JpOfPxOZ+tikOv5+sRTtvhVH3xZduiGV8t2sq0hZYWiVEzNo0qQETVhvV7akwiQC4MaQTBZF/dAsEMJ4GPacfXxOfw+C6zBuPnpa5bKG34dP8F9xMNNGO9SxOIx+4YLYl5OB1eTFZEumKaS/RUwHvsGm2jNW6TDzAOS5m6df37JT/sidM3F3szbxZIQ3xagdAt5QyESrNQ== 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=fzDUz2mV4gjdVdhM02ZWmECCm3uK5gZJfmWgjasbrg4=; b=MQvmPvvmqZsBC/cZUN9tXclpzuDJIjQ9zSjLRtuNGbl8FZ6wPNrL4R7gX6lRZDjLU7bZkS5wQXDSx009YHcdXuwFFolLVt2OC3DHqZm+AH7soMH/6bY8LIp4KyaMN1d8Lrtq/zc3mA/BEm2Bi5VuSiciJtNAaRhdKCsquaeR0MiTTazej40XoYMmwzUpOWL2Ua3lMvmt0jPKkIVkf2ZwvGWQad0LkClXFvVlr33ZrK5ZcFgg3qlywSdF1oomjjrV3nCo6laBga9vFsGv+5EqW/6c1fzj8bDsr6nxfpEb/L8tqPQ2G1KEj3spJAbfvE5JW0o11jhF2ICqdM5yo+Zkxg== 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=fzDUz2mV4gjdVdhM02ZWmECCm3uK5gZJfmWgjasbrg4=; b=P9iKN3ht9ZV4V8TXgl0Km0MZKDdFiyqwhLJ13vEswdsml0DSPFrWVtTCj64cic2A44w1CPo9m9V//wyS2jVejMghsMEo+Cz6tXdChGsTLz4oQwGLFybKLtbn2lIvigpSkC3BesOHJoj/gOG0Zc+SfaVyoLVICZeeEy59fnUVqIg= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB3227.namprd11.prod.outlook.com (2603:10b6:5:5d::16) 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 16:35:01 +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 16:35:01 +0000 From: "Ananyev, Konstantin" To: Thomas Monjalon CC: "dev@dpdk.org" , "Li, Xiaoyun" , "anoobj@marvell.com" , "jerinj@marvell.com" , "ndabilpuram@marvell.com" , "adwivedi@marvell.com" , "shepard.siegel@atomicrules.com" , "ed.czeck@atomicrules.com" , "john.miller@atomicrules.com" , "irusskikh@marvell.com" , "ajit.khaparde@broadcom.com" , "somnath.kotur@broadcom.com" , "rahul.lakkireddy@chelsio.com" , "hemant.agrawal@nxp.com" , "sachin.saxena@oss.nxp.com" , "Wang, Haiyue" , "Daley, John" , "hyonkim@cisco.com" , "Zhang, Qi Z" , "Wang, Xiao W" , "humin29@huawei.com" , "yisen.zhuang@huawei.com" , "oulijun@huawei.com" , "Xing, Beilei" , "Wu, Jingjing" , "Yang, Qiming" , "matan@nvidia.com" , "viacheslavo@nvidia.com" , "sthemmin@microsoft.com" , "longli@microsoft.com" , "heinrich.kuhn@corigine.com" , "kirankumark@marvell.com" , "andrew.rybchenko@oktetlabs.ru" , "mczekaj@marvell.com" , "jiawenwu@trustnetic.com" , "jianwang@trustnetic.com" , "maxime.coquelin@redhat.com" , "Xia, Chenbo" , "Yigit, Ferruh" , "mdr@ashroe.eu" , "Jayatheerthan, Jay" Thread-Topic: [dpdk-dev] [PATCH v4 5/7] ethdev: add API to retrieve multiple ethernet addresses Thread-Index: AQHXuSfjG9xVha5eB0SK5awVsRBSXavEY0+AgAA1CRA= Date: Tue, 5 Oct 2021 16:35:01 +0000 Message-ID: References: <20211001140255.5726-1-konstantin.ananyev@intel.com> <20211004135603.20593-1-konstantin.ananyev@intel.com> <20211004135603.20593-6-konstantin.ananyev@intel.com> <2488441.iy33XtL31i@thomas> In-Reply-To: <2488441.iy33XtL31i@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: 167ddd42-dd5d-4573-5937-08d9881e1433 x-ms-traffictypediagnostic: DM6PR11MB3227: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kHR7TMU2PBPxYCB4fQAD7RWzFEWWsUUXqqQsscewgSFHhQmA9C2pfAWAgbUtFXlufDcHp6lvBR+yquqgZkky+yBAM3anUL+/2lYxniVlETNoEVm5qr+lQbkIWJzKazaxp2m6vsUkE0hJwl6bzcA3ZqrHi8AOAFBc1TFUPInHBHoBOVlPCyhEwktDm5hQ2OaBMz9ODWkQ2KbDIF0ial+0nmMP/HY5oNEGPucZcW/vuqJKq04l84R8PLWj7G+Yn2fYxvQ17/7VlUJuJza5x32kkS2lQOtO0BRxcOlXPZ+CpZfbO7XXsW25x5l/yv3X60TUUc89V/an7C1epW3wK+6uNTzA2dBVhXzCz4K/m3XprnFz5gLwvOMiyIc9JVYXlOietqFvZ+3GMZn4DDpYk0fU+v4NfzDODtOhCHU8UCbIf9k+K3cFr0Eb9ABv7S+SBVr02qMge55fvoyiLcc9ShgeskQLxFF7EuEhmSRsrBhJx36QpMyB+FNj/5HjDv7u6oGdQhmcQQl/XMnBusgZT7LEZkbKUJm6dUzE5ko8HsVmQrvFykqJEsLeo/lu6bPk79CopSPxgW66xNzpG5C80XrTRZiGImDY76VF6lye8sNCWhQgWDqcxbWeGPHFAvsVYkCjykDIxQcqEyXLpcm0PNqJ3r7u3ip5kN/iXkZbZl1T1eyimrBXC1Vy/G5+83glQjfjMnLq292yzQReI5gZ77iQJg== 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)(6506007)(38100700002)(122000001)(7406005)(66946007)(76116006)(55236004)(66556008)(66476007)(64756008)(38070700005)(71200400001)(52536014)(7416002)(66446008)(186003)(8936002)(26005)(4326008)(316002)(33656002)(9686003)(86362001)(55016002)(5660300002)(2906002)(54906003)(508600001)(8676002)(6916009)(7696005)(107886003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?s4yo0NDSPVJfhEgPwICLWtXLKi5qj5bGQd6LVGnbz94JD7Xh5ZSxjGsmfinn?= =?us-ascii?Q?G5mpgnwzlq7jsEWBGSM05Wm6PWeck5x/JMNvfV1ZZfWSDd1U3cS9CYEXwg3k?= =?us-ascii?Q?2fiJh+r9MFNvEdv6V5a++1jAoOa48R9RjpZlHC+x9TopZkZTdZSDDRLbeYAO?= =?us-ascii?Q?Wtc2MpWa/v8XZJFIK9CkPtp6JM0mCQyZPtCaW5fhm/jgaAx2PcdTs8EFcQZq?= =?us-ascii?Q?PKyMJEredumMcI4ARR6UDxxeh7B09+IDrALTKFSNuL+wmkAlDu0ruQUkgFOy?= =?us-ascii?Q?v8HmEBD5k+q1j8SkfdWc/MH6GNifroxnct5dT6EeBkuLQjjfF5cCRBgiLWHV?= =?us-ascii?Q?aWNKrsBZ3r+zMI7A6zGiNFzOK0tpD2CYnkYlzx8TcU0/tOrlXL0OQmgjzI+4?= =?us-ascii?Q?otiXhs1pAdhy23upYDxwNn30NGrIisehBlRaGCArnGfrxIfORSd2kFDlich+?= =?us-ascii?Q?RRc6f/ZiZsNHNmRa6moFRrWXN7pbhWF4hENbCzy8cCnfJXzDRHDY0mpnhLi5?= =?us-ascii?Q?8woL4VA5U9mlkbbcT0LpzuMbAXsRTStf6DC8souHh0qhbUoYlrwvuFrR+rTK?= =?us-ascii?Q?AraIJ+y/gTCaILe8tmZbsdfOb6jfy1I2w0C9M8GS7v4GIRqCePQCmG0+dxqe?= =?us-ascii?Q?cAV9oYuqZUbrAF4i2XZJuqeRQq8qJPioT+D5aY9QNhkGDZLqcL7iTR1nMVZG?= =?us-ascii?Q?BcwZDBPA8WjEoW5/uw9y8j0BTyQ88e++sP/BC8yPddZj96cl1IP5nAUq798J?= =?us-ascii?Q?wgFE5W3IHZey8TR77tIWu+p1DKS+iJYXbgsFRWhGjzzyFwI2Yz1R3CigAodI?= =?us-ascii?Q?NHl9ZBNm/kE7TnXJRV4U81OWLZNcvOwKYGlxzclAxfbsdSUrbxM+C6xEYL/l?= =?us-ascii?Q?+V7CGU6IIPjUPLhS9SeLqS84nN/yYURMLJg83Ll6iBu2doisL+SLDzW64cH8?= =?us-ascii?Q?18ARji+IWR0lckDSrLruZEyULA8mswzEmaxWUFKsAks7QbQKuhVYeveP/ESf?= =?us-ascii?Q?u4n2VVJn95DGT7W3lpRqKjTWjrBCnR9gE4xXRfqA4rHKoWwLNCJN4ZLdjKF1?= =?us-ascii?Q?QvI0HVarDopCMpKV7bKJnA5D6lN/t8c/qjYvMmDESRUrKS6LuM4x1mmTpLJQ?= =?us-ascii?Q?RLpWcMiqdWM0rANJxb+AgQqdfxqCNj6a1AKOQFpatBGrsuce+mlVK4IB9KgT?= =?us-ascii?Q?ga1YE+oHD54rEX3bsBMLUeMb/OZmKnZmXv2MVtMu4ITrL4pF3gFj6O3KCFHz?= =?us-ascii?Q?ICWJw5elAOOKIbWggU1hDDS4KWuwqKZs59hMAsR/7SQBlMmBgHZDVQqHdw3D?= =?us-ascii?Q?2mFjawR0fC6fGq4x/jaIv7Yx?= 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: 167ddd42-dd5d-4573-5937-08d9881e1433 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2021 16:35:01.6033 (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: lbr3BkiKs0OMn8Sq/sPDmEm5pwhdG6BrUomtbYwizksJbW3QVYZXawZaPmAzCBPazv3IFXSTB3BYVyjeTDajfTfX4s9mnXtSZdEtNYIiV8U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3227 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" >=20 > 04/10/2021 15:56, Konstantin Ananyev: > > Introduce rte_eth_macaddrs_get() to allow user to retrieve all ethernet > > addresses assigned to given port. >=20 > 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 >=20 > [...] > > +* **Add new function into ethdev lib.** > > + > > + * Added ``rte_eth_macaddrs_get`` to allow user to retrieve all Ether= net > > + addresses aasigned to given ethernet port. >=20 > typo above >=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 be fi= lled 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. >=20 > Which error if the array is too small? None, we just return up to *num* addresses, that's it. =20 > > + */ > > +__rte_experimental > > +int rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr ma[], >=20 > Please don't use array syntax in parameters, it should be a pointer. > How do we get the number of returned addresses? >=20 > > + uint32_t num); >From above: * @return * - number of retrieved addresses if successful =20 > Another approach would be to get addresses one by one by passing an index= . >=20 Yes, it is another possible way. Though current one seems a bit more convenient to me.=20