From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 38529AAC2 for ; Wed, 21 Mar 2018 21:45:06 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A175B21127; Wed, 21 Mar 2018 16:45:05 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 21 Mar 2018 16:45:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=ELk5mKtBTbO9RhCHvxTkTZ6l28 jCG9+1a0C/ai4Cb9I=; b=O5Or3s0EuzXLzeDAtnNupvbJA75xa03H9HahzPyQPS +CcLaTy+vBhLvhqXtaifvlwA8jbSyOG7BeifyHBj83S3O8JDI9fCOobqi4/fVFb3 yoD9Ro6B8fHcjScoaQGkqVbwLXbEYIBsoC6C/dWCLke1CYcpQIEj+QBg6ubWR0yt c= 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-sender:x-me-sender:x-sasl-enc; s=fm2; bh=ELk5mK tBTbO9RhCHvxTkTZ6l28jCG9+1a0C/ai4Cb9I=; b=LMzH3iPh9bF53iOavzGZJK Dp3kwLN+GWT0YPf+CJ6pEu96MNdMDndGNq4OvWigUt6McC31G8rHSWPa4MVwziyf uQpqWGpOQd6AZM9f0ey26Lg1Iu600vaVoZM+f8yESPttXGpViYVTDE0nyNvI1KBN 6AFgNQ29T33tZx507fI8sot78Nqw8o71pbaVjxI5dMjAnimz6fiycl4i+q6tPqKl PndwkAzx62prcWafYLYiHnjPntlvItugJqgqoB5z1tNNL0KGLqsyfkusBOKjPqOU WyjGve252JkL2a3n4lVj6VP8dNQuG7xI0LCMZmPTLcLEN6OXyNfkzaYmlDWw8f4A == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 1B4267E13F; Wed, 21 Mar 2018 16:45:04 -0400 (EDT) From: Thomas Monjalon To: Xiao Wang Cc: dev@dpdk.org, maxime.coquelin@redhat.com, yliu@fridaylinux.org, zhihong.wang@intel.com, tiwei.bie@intel.com, junjie.j.chen@intel.com, rosen.xu@intel.com, dan.daly@intel.com, cunming.liang@intel.com, anatoly.burakov@intel.com, gaetan.rivet@6wind.com Date: Wed, 21 Mar 2018 21:44:48 +0100 Message-ID: <63424504.iVi4kYAKMf@xps> In-Reply-To: <20180321132108.52464-3-xiao.w.wang@intel.com> References: <20180309230809.63361-3-xiao.w.wang@intel.com> <20180321132108.52464-1-xiao.w.wang@intel.com> <20180321132108.52464-3-xiao.w.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2 2/3] bus/pci: expose sysfs parsing API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2018 20:45:06 -0000 21/03/2018 14:21, Xiao Wang: > Some existing sysfs parsing functions are helpful for the later vDPA > driver, this patch make them global and expose them to shared lib. > > Signed-off-by: Xiao Wang > --- > /* parse driver */ > snprintf(filename, sizeof(filename), "%s/driver", dirname); > - ret = pci_get_kernel_driver_by_path(filename, driver); > + ret = rte_pci_device_kdriver_name(addr, driver); I guess the snprintf above becomes useless. > + * @param dri_name > + * Output buffer pointer. Parameter name and comment can be improved here: "kdrv_name" would be more meaningful. As a comment, "Output buffer for kernel driver name" > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice > + * > + * Parse the "resource" sysfs file. > + * > + * @param filename > + * The PCI resource file path. > + * @dev > + * Pointer of rte_pci_device object, into which the parse result is recorded. > + * @return > + * 0 on success, -1 on error, 1 on no driver found. > + */ > +int __rte_experimental > +rte_pci_parse_sysfs_resource(const char *filename, struct rte_pci_device *dev); This is a Linux specific API. Maybe remove "sysfs" and replace "filename" by "resource"?