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 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 ; 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: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudelgedguddthecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Oct 2021 12:45:22 -0400 (EDT) From: Thomas Monjalon To: "Ananyev, Konstantin" 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" Date: Tue, 05 Oct 2021 18:45:19 +0200 Message-ID: <3664681.X88tCSIGuU@thomas> In-Reply-To: References: <20211001140255.5726-1-konstantin.ananyev@intel.com> <2488441.iy33XtL31i@thomas> 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" 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.