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 B208142BE6 for ; Tue, 30 May 2023 15:47:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AE0AA410FB; Tue, 30 May 2023 15:47:44 +0200 (CEST) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id DB32A406BC; Tue, 30 May 2023 15:47:41 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 6AE60320016F; Tue, 30 May 2023 09:47:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 30 May 2023 09:47:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1685454460; x=1685540860; bh=W4tSUguS5hug6tPQQjsmUQl1PeSQfxVX0MU M1aYPcek=; b=M6DBetrNTBrPUwyjJLLZS546fZ7Ic9rl9sWP3Vv5uZvqu1TEjzJ 4TYxmgcYUe6P0hgCGl0QHZqcSx2mkILbnYLLi+y83Bz8xcij/Rv7vhc0cjfHW1Zn 9VuB1ssRsHZ7L+7FmQZP1M0ziw4jrDK+gFWM1CbPLGTsRmbnMhfNk51RJ8FIgeVj zjFQVfV0oh6g2eZ9yXPLwN/GibhK+Uckeur9vZLZCBwj8p6Rhjydc73OWZps7497 gEvbVHc/VOftz/4BFd/amXJ9WyDCrGlFMvneUTYJWlv2EkMvYdtnn/RTL4cuowVh qJst1fuhtAVdZsuqLk7XKIg6PDwbBwGpbYg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1685454460; x=1685540860; bh=W4tSUguS5hug6tPQQjsmUQl1PeSQfxVX0MU M1aYPcek=; b=SzDp406T1Mr3QROsW2IR4VIpoaiKfiwvHGKBsKMjtafiJiRQ4z3 e13YKf3d5oNObJB9U35x3tRD8XQ7exygGSjSGwep+E0T5QFoxD/vX0fHpBZvyuzO GK3LeO9rfEYojazEhFPlGGEhEQHaOZyvYsNedi7/mQEQEr8kzv37Z4kjN3Tvwfvy Zue1SiXlRhdCG0gFqVNJjllYL0ET6KvI+dw7cC20gReRUf1VkyEn04lpBkXlCIdq s4sBHJrHyJeQQKrOxt5L81JQmi2e9vhgyExEJ2rwZVV/aOmYjIzMZHfgodtpULn7 JVm+/N5hfzEg/pi9OE4LQe5khm0se40fiog== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeekjedgieejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedtjeeiieefhedtfffgvdelteeufeefheeujefgueetfedttdei kefgkeduhedtgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 30 May 2023 09:47:39 -0400 (EDT) From: Thomas Monjalon To: Elena Agostini Cc: dev@dpdk.org, stable@dpdk.org, david.marchand@redhat.com, bingz@nvidia.com Subject: Re: [PATCH v1] bus/pci: get PCI address from rte_device Date: Tue, 30 May 2023 15:47:37 +0200 Message-ID: <11314359.MucGe3eQFb@thomas> In-Reply-To: <20230530114202.850814-1-eagostini@nvidia.com> References: <20230530114202.850814-1-eagostini@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 30/05/2023 13:42, eagostini@nvidia.com: > This patch introduces a get function to retrieve a PCI address > from an rte_device handler. [...] > +const struct rte_pci_addr * > +rte_pci_get_addr(const struct rte_device *dev) > +{ > + const struct rte_pci_device *pci_dev; > + > + if (!dev) { Please compare pointer with == NULL > + rte_errno = EINVAL; > + return NULL; > + } Can we check the bus type here? > + > + pci_dev = RTE_DEV_TO_PCI_CONST(dev); > + > + return &pci_dev->addr; > +} [...] > +/** > + * Return PCI device address of an rte_device You can replace rte_device with "generic device" and add a dot :) > + * > + * @param dev > + * A pointer to a rte_device structure describing the device > + * to use Do it simpler: pointer to the generic device structure. > + * > + * @return > + * PCI address of the device on success, NULL if no driver > + * is found for the device. Not exactly, it can return NULL if the device is not PCI. > + */ > +const struct rte_pci_addr * rte_pci_get_addr(const struct rte_device *dev);