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 61A19A0C4C; Tue, 5 Oct 2021 15:13:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A21AC4137D; Tue, 5 Oct 2021 15:13:53 +0200 (CEST) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by mails.dpdk.org (Postfix) with ESMTP id DEEBE4137D for ; Tue, 5 Oct 2021 15:13:52 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 917DC580EE4; Tue, 5 Oct 2021 09:13:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 05 Oct 2021 09:13:51 -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= VfgH9iqIRbciN6BveO3HU9vL+hmy8HRg0NQgRcIfH6g=; b=kYCYSF0HJyn7ekBw x7xX44atew0wrjKJO2CqRpkL+00IZ348ZsL71DLdaK9EIP/AARCtSjEvGlh7J32I gmRRt+oAd37Yf1BJTAnn5HAIRS2fC/qDEoqGzkqVS/oQNXTGw4lh6XmuSl0zRXz8 pGQK3UwMghGahF3NrON7V5yxd+bPJQsqeiwgoEyxJ90rON7Fs8xljOpD5JFQsHDJ GdFPkDF7l8nEin4Bi7BS7EeaUdQwUih7VeWnHDS3IvJcU5l46LQK6Gvw3d/rOeDv qh/Pjr++OpWIMf65TvjLsiS6KgNplQzXLsZWO3cQfvHmeQklDmKLulhUFzIZ56X9 GIhlww== 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=VfgH9iqIRbciN6BveO3HU9vL+hmy8HRg0NQgRcIfH 6g=; b=RLg/4CZyNc1aORBYQXHR3pt+6AdBqN6QqSKw1tswyC6EQ4Am0hJ+n98h5 2RWNB4P8wAAoROJwz55cQ1s5F2NMmmAv9669aE+X1BZTmCrtXKDSrbrqXd7TJ335 NTNbEEg5QaxCgMgGkS0F6sF5JPw6fh3N74DATv43zef5GBiQphT58xo55ax/5x1D 2k8DpQglLigAmJefCneI81Hb7but5yuGbXf9ylP32uRC0q4PAQf/vurxmQ6IT+SQ biwWK0fuhuwD0XPXZyo1ZrUKjsfmiimy76i+Ql5irGPQAKKT84MXkkuABhYwuQmJ XaSe2TPcfQA4JPXmFYwIC6jcxsX4g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudelgedgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Oct 2021 09:13:42 -0400 (EDT) From: Thomas Monjalon To: Konstantin Ananyev Cc: dev@dpdk.org, xiaoyun.li@intel.com, 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, haiyue.wang@intel.com, johndale@cisco.com, hyonkim@cisco.com, qi.z.zhang@intel.com, xiao.w.wang@intel.com, humin29@huawei.com, yisen.zhuang@huawei.com, oulijun@huawei.com, beilei.xing@intel.com, jingjing.wu@intel.com, qiming.yang@intel.com, 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, chenbo.xia@intel.com, ferruh.yigit@intel.com, mdr@ashroe.eu, jay.jayatheerthan@intel.com Date: Tue, 05 Oct 2021 15:13:39 +0200 Message-ID: <2488441.iy33XtL31i@thomas> In-Reply-To: <20211004135603.20593-6-konstantin.ananyev@intel.com> References: <20211001140255.5726-1-konstantin.ananyev@intel.com> <20211004135603.20593-1-konstantin.ananyev@intel.com> <20211004135603.20593-6-konstantin.ananyev@intel.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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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. [...] > +* **Add new function into ethdev lib.** > + > + * Added ``rte_eth_macaddrs_get`` to allow user to retrieve all Ethernet > + addresses aasigned to given ethernet port. typo above > +/** > + * 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? > + */ > +__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); Another approach would be to get addresses one by one by passing an index.