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 2F9251B650 for ; Tue, 3 Apr 2018 09:35:02 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9B52A21199; Tue, 3 Apr 2018 03:35:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 03 Apr 2018 03:35:01 -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=/SoVWK1LkaTtZ/RxvU0KGgLawt cxe0DARgUyav22Rv4=; b=LXhGUemlhAjP++xtK9qQQawxuFhyzjGD72ADj6tao9 H0RRZNO4zGViKn5KlGOzE9VNQpddmUgyCOjs2SCE6VbFvdB/Sp4q13Hb4kQ4xy0F eNTivHOf0/r5xJBZfS6Sy6xUj6DQM2QYfLCRyB/+/1sTwj3yyV02Tlnb+VlshB0j 4= 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=/SoVWK 1LkaTtZ/RxvU0KGgLawtcxe0DARgUyav22Rv4=; b=HleESA0A9AaTlkQKg12Gxx hdHOCwPiy0unLO+oUtwdkWaJXqaM8B7jnhX1cp06wcEhqfj8jAlNNp2wIPO8ZqjZ v0C8Kgla3wSMT530Lq+0jhvz1A+S81Ig5B2Z+Nkxi2BeftbYc17NIpRdV9NVdkTG JeW2G6PB51xDljOZiDMAV3JgXR2BORMDMdsb1MBVaiS3zAfjwrS8yQ4a7dJbOLXy jyDN54jOjG/4sOobz8Snl5IN2DGX7eBLNR5oNE0nDJIZBrHuzm0fcjnYzjD4yz20 bgHZ3Zznmt981Z8lLeqJYQQvos7qVZVjE3fWwzQoc+Lqel7r3su89qRbBfHvd4Zg == 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 B534EE4472; Tue, 3 Apr 2018 03:35:00 -0400 (EDT) From: Thomas Monjalon To: Hemant Agrawal Cc: dev@dpdk.org, bruce.richardson@intel.com, anatoly.burakov@intel.comm, xiao.w.wang@intel.com, junjie.j.chen@intel.com Date: Tue, 03 Apr 2018 09:34:58 +0200 Message-ID: <8959415.YrdPqVfVHk@xps> In-Reply-To: <61905017-5c93-87f7-032d-e0b1907f56c0@nxp.com> References: <1521014434-3399-1-git-send-email-hemant.agrawal@nxp.com> <1882630.IHjtNmfOsM@xps> <61905017-5c93-87f7-032d-e0b1907f56c0@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] eal/vfio: export internal vfio functions 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: Tue, 03 Apr 2018 07:35:02 -0000 03/04/2018 08:27, Hemant Agrawal: > On 3/27/2018 9:23 PM, Thomas Monjalon wrote: > > 14/03/2018 09:00, Hemant Agrawal: > >> This patch moves some of the internal vfio functions from > >> eal_vfio.h to rte_vfio.h for common uses with "rte_" prefix. > >> > >> This patch also change the FSLMC bus usages from the internal > >> VFIO functions to external ones with "rte_" prefix > >> > >> Signed-off-by: Hemant Agrawal > >> --- > >> --- a/lib/librte_eal/common/include/rte_vfio.h > >> +++ b/lib/librte_eal/common/include/rte_vfio.h > >> @@ -28,6 +28,12 @@ > >> +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) > >> +#define RTE_VFIO_NOIOMMU 8 > >> +#else > >> +#define RTE_VFIO_NOIOMMU VFIO_NOIOMMU_IOMMU > >> +#endif > > I know this is just a move of an existing code, > > but do you know why this check is against a version number (4.5.0), > > instead of #ifdef VFIO_NOIOMMU_IOMMU which would be backport-safe? > Agreed. please check it in v3. Yes, in v2. > >> +/** > >> + * Parse IOMMU group number for a device > >> + * > >> + * This function is only relevant to linux and will return > >> + * an error on BSD. > >> + * > >> + * @return > >> + * 1 on success > >> + * 0 for non-existent group > >> + * <0 for errors > >> + */ > >> +int __rte_experimental > >> +rte_vfio_get_group_no(const char *sysfs_base, > >> + const char *dev_addr, int *iommu_group_no); > >> + > >> +/** > >> + * Open VFIO container fd or get an existing one > >> + * > >> + * This function is only relevant to linux and will return > >> + * an error on BSD. > >> + * > >> + * @return > >> + * > 0 container fd > >> + * < 0 for errors > >> + */ > >> +int __rte_experimental > >> +rte_vfio_get_container_fd(void); > >> + > >> +/** > >> + * Open VFIO group fd or get an existing one > >> + * > >> + * This function is only relevant to linux and will return > >> + * an error on BSD. > >> + * > >> + * @return > >> + * > 0 group fd > >> + * < 0 for errors > >> + */ > >> +int __rte_experimental > >> +rte_vfio_get_group_fd(int iommu_group_no); > > > > All these new functions should have some @param documentation. > > added the @param > > > This file is not included in doxygen, probably because @file is missing. > > most of these functions are internal functions. do you think we should > add it in doxygen as well? I think yes. It is an exported header of EAL. The @file is missing to make it visible in doxygen. > > About the naming, are you sure about "group_no" instead of "group_num"? > > Agree, but this is already in many places. I feel this change will be > unnecessary. I don't see any other function using "_no". What about naming the function "rte_vfio_get_group_no" as "rte_vfio_get_group_num"?