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 0877AA059B; Fri, 10 Apr 2020 09:10:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5FA771C2BF; Fri, 10 Apr 2020 09:10:13 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id C3C071C2BC for ; Fri, 10 Apr 2020 09:10:11 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03A79Vkn027127; Fri, 10 Apr 2020 00:10:10 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=0djDtPh1Uhz6raNo6D7WlTKJthn8htLvIYdcxpwm+OI=; b=bsW5ZRWDG784ikpfvX3GXnS75BAGpimTZJKPe1o/QZATNcCAfkX1gsaT/m7ZoY3WXTMz vZP7egjHLmiD6Red39qYr1W0QWnzK6rN2fpzZ8o5rXcwB4+0lnfcnfv7PDynVb1j8aoA Z92Zy5JCDQiuCnxp8AkvLMdp01P4Fbe5Kn2lOyxLSCXATEReqNPMvQ+UvC4U3ps+8aX7 9Cs7xRYBrYRiuiY+G8M/iJbOdivBv8f9HKZywc184jjt4AS8xv+GTemwXBKvEcvItwMh EgmMCTWqwk3uDNTxTPnJQh3HOIMrWJmVbRxn44NyoiWUMcHX/2uP1d6ngBisfT8JT3HQ 2Q== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 3091jwm6mc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 10 Apr 2020 00:10:10 -0700 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 10 Apr 2020 00:10:09 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.174) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Fri, 10 Apr 2020 00:10:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q9o6wEfgLCPzKlXXltWV2MuluDoeWR3JlytGacAMlw7aZuiwNQP7Va0lm3fpJkPMxv42fuuwZz96EtoHiUoQBDPKt2kJ7qzdT1gVH8IX9+3hYtTGCIVimvO3KY5BFxU7vXg/gq4FerLVP0c+ympuZsj/kD+953C/7k0SQ/a5QpM1946lOzf43ybgTxj0Y42Dutawe1bcodboHn8UYmGZ07fSryA5+giZBk6POMEIvgfYQsymvU4KFFxfFISBmmX8petXwYi/1i4Z5FqvmMss5479eW5dQXnN9rtgH49thifRzEScuIi5ZKCc26CK5kJ6sB694qRHU2JvpEBvCvv2PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0djDtPh1Uhz6raNo6D7WlTKJthn8htLvIYdcxpwm+OI=; b=KApXQIQ2dWWOAIRkI9VgqbLPSX/FAkRyTf9lDZWLfUdrCXeH3CGsK5D7InebmVkKqJnffgIgu5v8aGv+J+bgdpWaVyWBbFUi4YEEMkHYLl+R5r/pZ6tUQqlKq3kDi4BQutyuEpbb0+vas0lDGfq5CbgV5ahKHGOoTBdtTPrq9phlWA3uyow3JS5biFRWq47P0JsvovyFm9QLXyt5OJ6ziPRIalIvZx1/8beMegqf+oVKxgcsDn1qgqDVPPYrc/bSSQqxBm1TZLCyWk4KkgGQsfzelrmsiyoI6awzwP3soSKwvenUVmKg4mwac5qzzt0NjskFXutmbz6Nv8DxGNzQPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0djDtPh1Uhz6raNo6D7WlTKJthn8htLvIYdcxpwm+OI=; b=AwYZWl/kpazGN1Qj+rFR7bGzHjOh5YSFFZLb1YzCwMjKH4nL3/foy8EpWK1FCT53D2mulZ+gy4TEngbN0bu5l5Z3/X4LRC5uHl7eyo6OHSGQFaWHqo56+qwrltB9P9r/MWOavAV3RbViobHhkqXOonhhmLce5mrBZuDSD/UySu4= Received: from MWHPR18MB1645.namprd18.prod.outlook.com (2603:10b6:300:ca::9) by MWHPR18MB1103.namprd18.prod.outlook.com (2603:10b6:300:98::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.18; Fri, 10 Apr 2020 07:10:06 +0000 Received: from MWHPR18MB1645.namprd18.prod.outlook.com ([fe80::34df:bd9:ffe5:ff77]) by MWHPR18MB1645.namprd18.prod.outlook.com ([fe80::34df:bd9:ffe5:ff77%8]) with mapi id 15.20.2878.023; Fri, 10 Apr 2020 07:10:06 +0000 From: Vamsi Krishna Attunuru To: "Varghese, Vipin" , "dev@dpdk.org" CC: Jerin Jacob Kollanukkaran , "alex.williamson@redhat.com" , "thomas@monjalon.net" , "david.marchand@redhat.com" Thread-Topic: [dpdk-dev] [RFC v1 1/1] vfio: set vf token and gain vf device access Thread-Index: AQHV8qc6xT0zyxqXgE6lUpUnglKd+ahjwg+AgA5kMWA= Date: Fri, 10 Apr 2020 07:10:06 +0000 Message-ID: References: <20200305043311.17065-1-vattunuru@marvell.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D499193@BGSMSX101.gar.corp.intel.com> In-Reply-To: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D499193@BGSMSX101.gar.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [157.47.119.179] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 19143a80-d725-4b6a-7ac7-08d7dd1e329a x-ms-traffictypediagnostic: MWHPR18MB1103: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2201; x-forefront-prvs: 0369E8196C x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR18MB1645.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(136003)(366004)(376002)(346002)(39860400002)(478600001)(71200400001)(2906002)(186003)(26005)(7696005)(86362001)(54906003)(110136005)(33656002)(53546011)(316002)(6506007)(64756008)(8936002)(66946007)(66476007)(4326008)(5660300002)(66446008)(55016002)(9686003)(8676002)(52536014)(66556008)(81156014)(76116006); DIR:OUT; SFP:1101; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zTTqBmjKrnOvNvSOqQYoOz6sn9cAJHJwR8UYp6Ba8SnnUEAJ7wQFh7rdoiuQRM/osUmgano37b9fkWWCBSlzhUI36hW7vqvE8kcb65zEgMbcclsIi1/AIHQMO0t05JFBXXWUNcenxRRjULatn73Ozgmi8sFjNe/FYXJyD01oRC3VnE7mM6LxYlySuDmj+4PViwuyRaoTkQmbCoNQLol0Kgk50eHMvbcDNQT5TvgV4MxzBEkDa37EqRcjbdCmXWUUynUDs2EqVUqPtW+z01hr5CeYrlE1uLS/LG8skK1Ethmmxv0XrSfVdD7MY2vS7seon0cvkxZPxe3eryGYKpdqCDSO8WenFwDg4IoU0J8sSyumHRoIC70+s0xBJ4E+XmoTm56jpGelpZfZeGqAXf5fSs2rK/KGTis879uZVlYIiQT/mMROTIw5uZ/hSN3B24Sz x-ms-exchange-antispam-messagedata: SKs7e4P+gckiQCyXQn1z37FwAEnDEEnoZWYpw/KelFVtHiX4JMlnsQgRDzPTwcFZA0Hn+nIAWw1WELbV7pFu3uEAjtbu+YVFdzPb9awg4c5XHnDUsDtETDklL0FB4n6RMJeWdiJOooR5qLuhCp6mLw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 19143a80-d725-4b6a-7ac7-08d7dd1e329a X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2020 07:10:06.1727 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: kaOchKuxwgWoA18R2VdPdXN/6janXKFYnNkWEoRdnS1pknAv+VEhWDRlKvOdLrPqo/2tz5LfXq2OIJxJgELgBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR18MB1103 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-10_02:2020-04-07, 2020-04-10 signatures=0 Subject: Re: [dpdk-dev] [RFC v1 1/1] vfio: set vf token and gain vf device access 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" Hi Vipin, Please see inline. > -----Original Message----- > From: dev On Behalf Of Varghese, Vipin > Sent: Wednesday, April 1, 2020 8:45 AM > To: Vamsi Krishna Attunuru ; dev@dpdk.org > Cc: Jerin Jacob Kollanukkaran ; > alex.williamson@redhat.com; thomas@monjalon.net; > david.marchand@redhat.com > Subject: Re: [dpdk-dev] [RFC v1 1/1] vfio: set vf token and gain vf devic= e > access >=20 > Snipped > > diff --git a/lib/librte_eal/linux/eal/eal_vfio.c > > b/lib/librte_eal/linux/eal/eal_vfio.c > > index 01b5ef3..e2fdd35 100644 > > --- a/lib/librte_eal/linux/eal/eal_vfio.c > > +++ b/lib/librte_eal/linux/eal/eal_vfio.c >=20 > DPDK supports freebsd where `/dev/pci` can be probed like Linux > `/sys/bus/pci`. Will you be adding the functions in > `lib/librte_eal/freebsd/eal/` folder or implement as `NOT supported`? >=20 > What about window ` lib/librte_eal/windows/eal/`? If other kernel (freebsd & windows) drivers also support this vf token sche= me, functions can be added in respective eal implementations. >=20 > snipped > > + snprintf(linkname, sizeof(linkname), > > + "%s/%s/physfn", sysfs_base, dev_addr); >=20 > Would you like to check the pointer sysfs_base or dev_addr? Physfn pointer is being checked here. >=20 > > int > > rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr, > > int *vfio_dev_fd, struct vfio_device_info *device_info) @@ - >=20 > Snipped >=20 > > + ret =3D is_vf_token_required(sysfs_base, dev_addr); >=20 > The return value from the above function is 0 or -1. Function also returns 1. >=20 > > + /* if negative, something failed */ > > + if (ret < 0) > > + return -1; > > + > > + if (ret =3D=3D 0) { >=20 > Will it be ok to skip this check? No, it's a valid case. >=20 > > + /* vf_token required to open device file descriptor */ > > + rte_uuid_unparse(uuid_token, > > + vf_token, sizeof(vf_token)); > > + snprintf(dev, sizeof(dev), > > + "%s vf_token=3D%s", dev_addr, vf_token); > > + } >=20 > snipped >=20 > general comment `can we use EAL LOG for info, warn, error`?