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 6C255A04FD; Mon, 23 May 2022 06:34:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 108E040156; Mon, 23 May 2022 06:34:01 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 28F384014F for ; Mon, 23 May 2022 06:33:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653280439; x=1684816439; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=9oU3k9HiNqVow3WPc2eHXoSPibHTiGps9TCH41etAG4=; b=ipDKpHg0BPRE7BfUIFLIV2JbBk7ZUg94y9QpcmvLIqVBNOWxemfztPyv 2nEHMJJZTm/mzS+/A2jtxiCXIX+PktReSJk4Ckg1FE64h8IiTbxdKERTi 4S4rnmnwqPrWPVWPkBvxDR3yeLAf8JZ+xoRpYvyaA5j3WhrzKeT9ZP4WM W7XlmiSdhdTMfErMUWwR91CyNc+xX1JzcFHuv+8cSnM64D8CP0ctqMSUi v1kLT0f7mvozP5EiCzdrvw3jvVqrn+RMqIbJleLo/C0BoY6LRci37WAHT fc7ZQrdj+7jktLVcqg2SkvCHuU4baL6YbrKlFrABdG2ba6O7PLGncHhsu w==; X-IronPort-AV: E=McAfee;i="6400,9594,10355"; a="271914757" X-IronPort-AV: E=Sophos;i="5.91,245,1647327600"; d="scan'208";a="271914757" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2022 21:33:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,245,1647327600"; d="scan'208";a="702799800" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga004.jf.intel.com with ESMTP; 22 May 2022 21:33:56 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 22 May 2022 21:33:55 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Sun, 22 May 2022 21:33:55 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.107) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Sun, 22 May 2022 21:33:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bbx1tDQbOJv2rgE7qhs/pPKrFeiGDIkTl534SFJyKOlQ/6zuMkUjdQSWnXjopVyVsjKjvF0i+BTauaC46Em3IqMQ0M7c5zMPofC9cjoKGtkTCmsjcmRJ3MifeqqIyGheJvq9hM+eCEKUhoXj22XHmul+vkYdtiTTO4OhPAP/VoTsGXNe7hB3rpPpLA+jcHyEl1KGiOmnWp/+czMZQ464cDf84P8js+4aqT8Il0KdNCmLz/RPnE++6nXW3r+Dhuov2oPhGDrGIBeyQjQ2H+lJNR25I2liev8YMz2eHZMw7ypN+BIRtYPj4oq/twBOfMS31EbhZY0kKshzVXWUfcl0jg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DSM462EBsdkqYpVFM1SviMNLyUGgGClZ10sd8g29vL0=; b=JIdq8J0rKLdSFasB53Ys3aRlL4Fm8fBjOMYmgpbzpnCDITaKAP2/AGqbjhnnL6svp+0Z9KPU3VPdUzbtulVcX7pIB20gWRPDE3JLJ3c2oazMzue5p006B1wcyVySRTPlgUYiCVPxtq8FSPAYCA3492iPwSGW8jCC81cyy83y8UCLCbXWk2pU317S2ELzMHWuz+tZx/+l76pEGgQPiml2Gc5snby+5yUSTq5cyBTrYQKfwjMxSEbsEaposNAbJyqzzPYHGNWcRYTa5ildXzzWKufpxJs1Eck7Lqe50pecoD+Kmx2fjQMl8hNQ/ITvmNZnTroLKLBYI18yTCopJNAiFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM5PR11MB1739.namprd11.prod.outlook.com (2603:10b6:3:111::22) by DM5PR1101MB2106.namprd11.prod.outlook.com (2603:10b6:4:54::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.18; Mon, 23 May 2022 04:33:47 +0000 Received: from DM5PR11MB1739.namprd11.prod.outlook.com ([fe80::8c3b:8a54:d186:b555]) by DM5PR11MB1739.namprd11.prod.outlook.com ([fe80::8c3b:8a54:d186:b555%11]) with mapi id 15.20.5273.022; Mon, 23 May 2022 04:33:47 +0000 From: "Pei, Andy" To: "Xia, Chenbo" , "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" , "Cao, Gang" , "Liu, Changpeng" , "Xu, Rosen" , "Xiao, QimaiX" Subject: RE: [PATCH v8 01/13] vdpa/ifc: add support for virtio blk device Thread-Topic: [PATCH v8 01/13] vdpa/ifc: add support for virtio blk device Thread-Index: AQHYardRH/jdXeBNe0asLm3tRlKF760r1xiwgAAO+1A= Date: Mon, 23 May 2022 04:33:47 +0000 Message-ID: References: <1643093258-47258-2-git-send-email-andy.pei@intel.com> <1652876035-70513-1-git-send-email-andy.pei@intel.com> <1652876035-70513-2-git-send-email-andy.pei@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.401.20 dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 04688f41-4237-4bb8-7983-08da3c756d76 x-ms-traffictypediagnostic: DM5PR1101MB2106:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pspqzCXQPJrJRqh8zDtm1t6kLEOnRD+G27QgdGq8qMn4ijlxBsJmQajZ7IpOUs5tn010ruvUwOafjKJ4VjIOrcUlY65neq70QG935wF1BqW5ezo5y3wp7Oq9DGOs4a59qoXNjCKMCnPemHr/tYUjaesYhMol2oBp2m9kXyu4YDD8UGzwnPmQUz1s/l6kaLq5ujCyL21069zyrWpiM/L9NAJaX0p/gQ5tB9DcCoGZiRWH7YDDxqyEz5AKV8b7/eo67Dm9efx52xe2oyEDdN5Q7o3yZnUmNt9dEMQ6NY6yHhQ2E2/a8L/TK/hYpGD6q+a7maBGBnNNkTfJ5LyoZyb7EggjkxJp/1bOPb/FUVXlrHbgFX6TWWSbPSEtjzH9pwDu0wBAJde8J/AVjcMRDP1W5P8kPbXumSwLea7fZSCgfcgK/BoDUGdZ78V8fIipgr08iJ73+wrodCoeuwOpaCtuun+hX0+H6Co2KTxrjBYIcMHH6OEBQcy2RZdgRbG5RK08EReltn4Uf1xZ9J6HOg36AKe8NOEtEwGg066qCV5xYJvoPYJe7MyvdVyGkx0Ph1LFCjmRHLubpKM77G/iAkdmc83RBuxs8Jrysn0c/4dBFOVs5VW7jfJnMRcSe22SH1rbKdG44LIuVAlO6Hq1E4WV/IeHv8yr2sDNH4u9OvLQ+jHtSr3fNsGLd//YBxmUTAz03rPbCB9vjnesuva5jCO3pQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR11MB1739.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(55016003)(316002)(53546011)(38100700002)(26005)(9686003)(508600001)(83380400001)(186003)(71200400001)(107886003)(6506007)(7696005)(54906003)(110136005)(33656002)(64756008)(66556008)(76116006)(66476007)(86362001)(4326008)(8676002)(66946007)(66446008)(5660300002)(8936002)(52536014)(38070700005)(2906002)(82960400001)(122000001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BF6WOYAqVehg9CdiIMfS7/UrLlC3JRwgmVA3awQo+YdfN8JiA140pQvLBPbD?= =?us-ascii?Q?nktJ6G1HVTwwWZrK+fAUlma2KJCy9at3gM3NckXo8V49JKUW1UGmc/yMw1q4?= =?us-ascii?Q?q+E80kzFojEPU6zpbT3iFtyMKUC2GPqF4UCOTc4133oASfz8Oh+hHOtOpZwi?= =?us-ascii?Q?rCtKuH6u3o9TWvmHvbc6NDnjAUkTKqi+tlyXeB8lLsKLEXvf6BNsg8yzI9ii?= =?us-ascii?Q?4odBlwnaEbuc2Su4LMyoLzgy8hvxRIWpr/ZNsuE6S283ALzsqmATFln9Hsoo?= =?us-ascii?Q?ax8tWIkuyJDORxIpkzOmf5EIf+1U2DIfCTzjqEtlRfcK9nmQ2OEW5/d7P0eL?= =?us-ascii?Q?JfqeFijBNMUZzfpRoagLkn8LCI0A3R84nPQ9rYGgXeJYJr4ZunM4aWTE6RFg?= =?us-ascii?Q?fjz5bVTauqTRWow5fn+ttXUoKqGsmcGwxDq0ndqoT/cpz/x4YAgCtlm4mNZU?= =?us-ascii?Q?3qPBCgMfbu5guVG6yA5BfJRe+NxsWtjayspNwFeHZen10yilOrqhNO3OrK3v?= =?us-ascii?Q?LFRTEBTzUxiIxgEkN90jdK9SyyvWg1OmQTb+pfOmxTaO7Qc+fvlYtRIRifaR?= =?us-ascii?Q?G9H4V/886i3WSrYTsAHHexLhhI/ASBM9rs65RPp4TUmp8+/LtmWs5MjiXgcY?= =?us-ascii?Q?sY/CxX4XmbobGix28eDN7nY/rlEaOIwM08Pqjk2wbhI1ObPqvLAyS8L3BtBD?= =?us-ascii?Q?M2fHknBRglUrid7oRzycULKsnPXiknoln+lptkCU7FYGaWNP4qAVbSo06npP?= =?us-ascii?Q?Ums8aup1GyDByWiTTzoJylqzP0nVR16z4eftuXN3N98YLh1Bud2ZLvNghQF9?= =?us-ascii?Q?VcTC7L+h74hMNVdMhG7Nd5mHmB4e6HbKGkDmcrjv3BNzLhrWLjRQigSVC24t?= =?us-ascii?Q?d6wSK8fX/tvKcLUCRHjdT2d9X+Hg665V8/Ws8iscajXcaFj9beYC0q+oaanm?= =?us-ascii?Q?3tqgi+uUGPZ1O/L2X0GOi12LPRqxQz6wUDKc5FkiLcJZk68VE+7Mwh1Oul/q?= =?us-ascii?Q?66TlTpiN1Filngippjyz4HaVJsz0+34/JAxSL772czdutepSIwc77tgWuTeN?= =?us-ascii?Q?bajSdtFvjiJUCHUdwKaM0tyUGOhb/s6SAJDlGP74lfX9SmbCbx89YET07SMY?= =?us-ascii?Q?DCLkBgFDeFwa9CCH0VVU191z3/Jq2eTtK9VgCSr75ZW/HjuZhmptDuEDdiS3?= =?us-ascii?Q?eq0CdZ2RjVXiQBmCvIrykn+OLBXPRripGW00S+Lbsvg6C9wXuUytHKp49mZp?= =?us-ascii?Q?cBbEsyxyBBWscHJnOeoTXdXDym44gNXFKFd29dCUIoGX4kNzByOocutmtIQs?= =?us-ascii?Q?jX2z6+yczHpevCW7/f5wvnwjrzGexFTniOkNHpJQNUTgPR5xQmBYRk2ldlJ7?= =?us-ascii?Q?rUuq83RCQfEnPqlvtPaRWlm8GEyAUfBEK6yzFH7zm6YERuyQYVMCxin/+2f+?= =?us-ascii?Q?WBhToxdjI7Qh6twmdwr0GSUIhKbtbDtPVo67O9Eh2CT4hEVaojBsOhXYqDSm?= =?us-ascii?Q?viv874eRw4AqhayJLzim50XN7rgD7MDtzrjFT4wNbgWr7kmRENoVxAMGwUDp?= =?us-ascii?Q?1IjXg/VSsRpxO5viYQY2DUUrIhh3SkAohUJzjYLsfu/7pCWEQnOLoWO1XAxd?= =?us-ascii?Q?/2abiy6BlG47pPZ+RvA+u+W4LEm4486dVtCvBS+aPgJ2MW3snayaqM3LOKm3?= =?us-ascii?Q?ed4VSg/cFN0wAWnlBYKWBgLJAE84ZaaLBDUkL527++XVgzSiKZAWU5MZIqwR?= =?us-ascii?Q?4gGSqnZYdg=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM5PR11MB1739.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 04688f41-4237-4bb8-7983-08da3c756d76 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 May 2022 04:33:47.1511 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jA9/nHGtppAToEf12Uw6b8X46QfGZxnFEHkmhjub/6jrjSiMwFLWN9crnosg3v8yMLZcbY1X6EshZnuhqx/dRg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2106 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Chenbo, Thanks for your reply, my reply is inline. > -----Original Message----- > From: Xia, Chenbo > Sent: Monday, May 23, 2022 11:42 AM > To: Pei, Andy ; dev@dpdk.org > Cc: maxime.coquelin@redhat.com; Cao, Gang ; Liu, > Changpeng ; Xu, Rosen ; > Xiao, QimaiX > Subject: RE: [PATCH v8 01/13] vdpa/ifc: add support for virtio blk device >=20 > Hi Andy, >=20 > > -----Original Message----- > > From: Pei, Andy > > Sent: Wednesday, May 18, 2022 8:14 PM > > To: dev@dpdk.org > > Cc: Xia, Chenbo ; maxime.coquelin@redhat.com; > > Cao, Gang ; Liu, Changpeng > > ; Xu, Rosen ; Xiao, > > QimaiX > > Subject: [PATCH v8 01/13] vdpa/ifc: add support for virtio blk device > > > > Re-use the vdpa/ifc code, distinguish blk and net device by pci_device_= id. > > Blk and net device are implemented with proper feature and ops. > > > > Signed-off-by: Andy Pei > > --- > > drivers/vdpa/ifc/base/ifcvf.h | 16 +++++++- > > drivers/vdpa/ifc/ifcvf_vdpa.c | 91 > > +++++++++++++++++++++++++++++++++++++++---- > > 2 files changed, 98 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/vdpa/ifc/base/ifcvf.h > > b/drivers/vdpa/ifc/base/ifcvf.h index 573a35f..483d38b 100644 > > --- a/drivers/vdpa/ifc/base/ifcvf.h > > +++ b/drivers/vdpa/ifc/base/ifcvf.h > > @@ -5,8 +5,17 @@ > > #ifndef _IFCVF_H_ > > #define _IFCVF_H_ > > > > +#include > > #include "ifcvf_osdep.h" > > > > +#define IFCVF_NET 0 > > +#define IFCVF_BLK 1 > > + > > +/* for BLK */ > > +#define IFCVF_BLK_TRANSITIONAL_DEVICE_ID 0x1001 > > +#define IFCVF_BLK_MODERN_DEVICE_ID 0x1042 > > +#define IFCVF_BLK_DEVICE_ID 0x0002 > > + > > #define IFCVF_VENDOR_ID 0x1AF4 > > #define IFCVF_DEVICE_ID 0x1041 > > #define IFCVF_SUBSYS_VENDOR_ID 0x8086 >=20 > Let's rename IFCVF_DEVICE_ID to IFCVF_NET_DEVICE_ID as it's only used for > net now. >=20 Sure, I will do it in next version. > > @@ -126,13 +135,18 @@ struct ifcvf_hw { > > u8 notify_region; > > u32 notify_off_multiplier; > > struct ifcvf_pci_common_cfg *common_cfg; > > - struct ifcvf_net_config *dev_cfg; > > + union { > > + struct ifcvf_net_config *net_cfg; > > + struct virtio_blk_config *blk_cfg; > > + void *dev_cfg; > > + }; > > u8 *isr; > > u16 *notify_base; > > u16 *notify_addr[IFCVF_MAX_QUEUES * 2]; > > u8 *lm_cfg; > > struct vring_info vring[IFCVF_MAX_QUEUES * 2]; > > u8 nr_vring; > > + int device_type; > > struct ifcvf_pci_mem_resource > mem_resource[IFCVF_PCI_MAX_RESOURCE]; > > }; > > > > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c > > b/drivers/vdpa/ifc/ifcvf_vdpa.c index 9f05595..be0efd3 100644 > > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c > > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c > > @@ -75,6 +75,12 @@ struct internal_list { > > struct ifcvf_internal *internal; > > }; > > > > +/* vdpa device info includes device features and devcic operation. */ > > +struct rte_vdpa_dev_info { > > + uint64_t features; > > + struct rte_vdpa_dev_ops *ops; > > +}; > > + > > TAILQ_HEAD(internal_list_head, internal_list); static struct > > internal_list_head internal_list =3D > > TAILQ_HEAD_INITIALIZER(internal_list); > > @@ -1167,6 +1173,48 @@ struct internal_list { > > return 0; > > } > > > > +static int16_t > > +ifcvf_pci_get_device_type(struct rte_pci_device *pci_dev) { > > + uint16_t pci_device_id =3D pci_dev->id.device_id; > > + uint16_t device_id; > > + > > + if (pci_device_id < 0x1000 || pci_device_id > 0x107f) { > > + DRV_LOG(ERR, "Probe device is not a virtio device\n"); > > + return -1; > > + } > > + > > + if (pci_device_id < 0x1040) { > > + /* Transitional devices: use the PCI subsystem device id as > > + * virtio device id, same as legacy driver always did. > > + */ > > + device_id =3D pci_dev->id.subsystem_device_id; > > + } else { > > + /* Modern devices: simply use PCI device id, > > + * but start from 0x1040. > > + */ > > + device_id =3D pci_device_id - 0x1040; > > + } > > + > > + return device_id; > > +} > > + > > +struct rte_vdpa_dev_info dev_info[] =3D { > > + { > > + .features =3D (1ULL << VIRTIO_NET_F_GUEST_ANNOUNCE) | > > + (1ULL << VIRTIO_NET_F_CTRL_VQ) | > > + (1ULL << VIRTIO_NET_F_STATUS) | > > + (1ULL << VHOST_USER_F_PROTOCOL_FEATURES) | > > + (1ULL << VHOST_F_LOG_ALL), > > + .ops =3D &ifcvf_ops, >=20 > Rename ifcvf_ops -> ifcvf_net_ops >=20 > Overall the patch LGTM. With above fixed: >=20 > Reviewed-by: Chenbo Xia >=20 OK, I will do this in next version. > > + }, > > + { > > + .features =3D (1ULL << VHOST_USER_F_PROTOCOL_FEATURES) > | > > + (1ULL << VHOST_F_LOG_ALL), > > + .ops =3D NULL, > > + }, > > +}; > > + > > static int > > ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, > > struct rte_pci_device *pci_dev) > > @@ -1178,6 +1226,7 @@ struct internal_list { > > int sw_fallback_lm =3D 0; > > struct rte_kvargs *kvlist =3D NULL; > > int ret =3D 0; > > + int16_t device_id; > > > > if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) > > return 0; > > @@ -1227,13 +1276,24 @@ struct internal_list { > > internal->configured =3D 0; > > internal->max_queues =3D IFCVF_MAX_QUEUES; > > features =3D ifcvf_get_features(&internal->hw); > > - internal->features =3D (features & > > - ~(1ULL << VIRTIO_F_IOMMU_PLATFORM)) | > > - (1ULL << VIRTIO_NET_F_GUEST_ANNOUNCE) | > > - (1ULL << VIRTIO_NET_F_CTRL_VQ) | > > - (1ULL << VIRTIO_NET_F_STATUS) | > > - (1ULL << VHOST_USER_F_PROTOCOL_FEATURES) | > > - (1ULL << VHOST_F_LOG_ALL); > > + > > + device_id =3D ifcvf_pci_get_device_type(pci_dev); > > + if (device_id < 0) { > > + DRV_LOG(ERR, "failed to get device %s type", pci_dev- > >name); > > + goto error; > > + } > > + > > + if (device_id =3D=3D VIRTIO_ID_NET) { > > + internal->hw.device_type =3D IFCVF_NET; > > + internal->features =3D features & > > + ~(1ULL << > VIRTIO_F_IOMMU_PLATFORM); > > + internal->features |=3D dev_info[IFCVF_NET].features; > > + } else if (device_id =3D=3D VIRTIO_ID_BLOCK) { > > + internal->hw.device_type =3D IFCVF_BLK; > > + internal->features =3D features & > > + ~(1ULL << > VIRTIO_F_IOMMU_PLATFORM); > > + internal->features |=3D dev_info[IFCVF_BLK].features; > > + } > > > > list->internal =3D internal; > > > > @@ -1245,7 +1305,8 @@ struct internal_list { > > } > > internal->sw_lm =3D sw_fallback_lm; > > > > - internal->vdev =3D rte_vdpa_register_device(&pci_dev->device, > > &ifcvf_ops); > > + internal->vdev =3D rte_vdpa_register_device(&pci_dev->device, > > + dev_info[internal->hw.device_type].ops); > > if (internal->vdev =3D=3D NULL) { > > DRV_LOG(ERR, "failed to register device %s", pci_dev->name); > > goto error; > > @@ -1313,6 +1374,20 @@ struct internal_list { > > .subsystem_device_id =3D IFCVF_SUBSYS_DEVICE_ID, > > }, > > > > + { .class_id =3D RTE_CLASS_ANY_ID, > > + .vendor_id =3D IFCVF_VENDOR_ID, > > + .device_id =3D IFCVF_BLK_TRANSITIONAL_DEVICE_ID, > > + .subsystem_vendor_id =3D IFCVF_SUBSYS_VENDOR_ID, > > + .subsystem_device_id =3D IFCVF_BLK_DEVICE_ID, > > + }, > > + > > + { .class_id =3D RTE_CLASS_ANY_ID, > > + .vendor_id =3D IFCVF_VENDOR_ID, > > + .device_id =3D IFCVF_BLK_MODERN_DEVICE_ID, > > + .subsystem_vendor_id =3D IFCVF_SUBSYS_VENDOR_ID, > > + .subsystem_device_id =3D IFCVF_BLK_DEVICE_ID, > > + }, > > + > > { .vendor_id =3D 0, /* sentinel */ > > }, > > }; > > -- > > 1.8.3.1