From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C1B9DA034F; Wed, 6 May 2020 12:27:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A27381D8E0; Wed, 6 May 2020 12:27:23 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id D529F1D8D9 for ; Wed, 6 May 2020 12:27:21 +0200 (CEST) IronPort-SDR: DYl0oKycZSEdwoYYaq2gLosQpfNakuZSAlI8UA6Atf4ooKxyxoRLE7DpfY3qHzP+Yhlnbl/NHb R1p1MsK2B3CA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2020 03:27:20 -0700 IronPort-SDR: vIhCXt/2YgFPaWRoHtduYy4cM4IEFyBIcRCBV4BL+jl2MPFeBy2RAE0d9kNufHCdfUYCKMv0q9 He9NULLf2QZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,358,1583222400"; d="scan'208";a="338963933" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.209.121.37]) ([10.209.121.37]) by orsmga001.jf.intel.com with ESMTP; 06 May 2020 03:27:19 -0700 To: Haiyue Wang , dev@dpdk.org, thomas@monjalon.net, jerinj@marvell.com, david.marchand@redhat.com References: <20200305043311.17065-1-vattunuru@marvell.com> <20200505103440.38455-1-haiyue.wang@intel.com> <20200505103440.38455-3-haiyue.wang@intel.com> From: "Burakov, Anatoly" Message-ID: Date: Wed, 6 May 2020 11:27:19 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200505103440.38455-3-haiyue.wang@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v12 2/2] eal: support for VFIO-PCI VF token 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 05-May-20 11:34 AM, Haiyue Wang wrote: > The kernel module vfio-pci introduces the VF token to enable SR-IOV > support since 5.7. > > The VF token can be set by a vfio-pci based PF driver and must be known > by the vfio-pci based VF driver in order to gain access to the device. > > Signed-off-by: Haiyue Wang > --- > diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c > index 540b7d38c..00b02855e 100644 > --- a/lib/librte_eal/freebsd/eal.c > +++ b/lib/librte_eal/freebsd/eal.c > @@ -1002,6 +1002,11 @@ rte_eal_vfio_intr_mode(void) > return RTE_INTR_MODE_NONE; > } > > +void rte_eal_vfio_vf_token(rte_uuid_t vf_token) > +{ > + memset(vf_token, 0, sizeof(rte_uuid_t)); > +} What's the purpose of memset(0) here? Presumably, if the API is not supposed to be supported, the function should have no effect? > + > int rte_vfio_setup_device(__rte_unused const char *sysfs_base, > __rte_unused const char *dev_addr, > __rte_unused int *vfio_dev_fd, > diff --git a/lib/librte_eal/include/rte_eal.h b/lib/librte_eal/include/rte_eal.h > index 2f9ed298d..d9040ce14 100644 > --- a/lib/librte_eal/include/rte_eal.h > +++ b/lib/librte_eal/include/rte_eal.h > @@ -21,6 +21,7 @@ > #include > > #include > +#include > > #ifdef __cplusplus > extern "C" { > @@ -438,6 +439,17 @@ int rte_eal_create_uio_dev(void); > */ > enum rte_intr_mode rte_eal_vfio_intr_mode(void); > > + > +/** > + * The user-configured vfio VF token. The description is unclear. Suggested rewording: Copy the user-configured vfio VF token. > + * > + * @param vf_token > + * vfio VF token configured with the command line is copied > + * into this parameter, zero uuid by default. > + */ > +__rte_experimental > +void rte_eal_vfio_vf_token(rte_uuid_t vf_token); Maybe rte_eal_vfio_get_vf_token()? I imagine this would be a more descriptive name for this API. Once all of the above is addressed (or explained), Acked-by: Anatoly Burakov -- Thanks, Anatoly