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 994B9A04FD; Mon, 23 May 2022 09:30:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 506B94014F; Mon, 23 May 2022 09:30:21 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id CEBD540041 for ; Mon, 23 May 2022 09:30:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653291020; x=1684827020; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=1fSpzcMF88QYUGhz2vfYrTks+LAQMT9kcpaEMwMhkog=; b=axcD3dGU7n8vs7iiBVmDwIGpvA195HTF6ACna3Dff0efrFRHUc0ipBwm 8xJ+LYzEbVdT1ywCABx1K+Mj7brAn+2HuBb2RAvh5RiVRLQaT1VYrZWCI /HBh+Mr045uU/PfEwqjhVEeFHT0k3Mm94AqKHGWvJZyCEABFlwhRv3AuH QUIsJWF54vMm6Tu9w53sK4bUdoNfYiiOoeJaTj4b84y0CS19EZ0ysAAhG aZP7qaeDGL4bts2Azo88B7/a2pJz4oTeov6FufMEojLtGjCrq9nnSakkt x9QUtaDg9RPb+he9ioAlwlSulcmeHwSLQFX99kONRL0XuaaHhOOzQ7uCr Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10355"; a="333778794" X-IronPort-AV: E=Sophos;i="5.91,245,1647327600"; d="scan'208";a="333778794" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2022 00:30:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,245,1647327600"; d="scan'208";a="716575573" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga001.fm.intel.com with ESMTP; 23 May 2022 00:30:18 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 23 May 2022 00:30:18 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) 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; Mon, 23 May 2022 00:30:17 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Mon, 23 May 2022 00:30:17 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.105) 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; Mon, 23 May 2022 00:30:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZUc/HvjCBePMwMO8QTQpE7XOnJfALymmnz36bVMITnl6/SoF4xBQGH1fQFVGRcl00oy3ZgUPjkfG590KDX4F3vYtQHDHrVc8yWoBUqoM7d2cDmmVOr/X8G0FqGMk2CzftHyZsOx7/IqI2xm5bKVXGgILmsvH4az6PnG147Ir23DZa3cJvluZzqF7wh/BriR85Ik31ti7whMpmljyM8cnEvCimWcJcE0MdgwcKS/Tl3HARoSqNHu95QVHlXX84JBvVX9MGVYHpJr7YwzmQku7gA/k6Aexqh7+Eytn7ZdoNMCg8QSDTT9FUyP2/79xLYt4vS7K0oHiRvtFrKDA/uyFAQ== 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=N71wx6hxKfmlQq8/prTq9HZcF/3yyg0R0yWCbwYKUpk=; b=gHDbMqnlsfCQ6KnlpqU1e8NzeFC398r6HeSD1nWSIZJHiobLOIMewYAy75T/52zH2chUepn+HA6tL1Oh/VpOIzKbjjtZOW5Q3g4f9diAzynsstxaM4KTWX8OvPXTnIyUMzVA3fyVryMcXMfP4fXDvPESTyqo/V5nH0D1FBdkEqiTfPE+TIKkXW3nKWk9MmUzPQxwgdroqHpsTVCzmyE3lonTYirwLzB2g5QefElD6T6KOpYkFU4S/7AfoJvwxva2kGqiC+/pCakXKiYuPVs2UcLiJ7eCT6ezSJMC26MiTCan89gqgavULuwiQkZ4r8i5tgmeO0TJXyw1v5FO8G6NqQ== 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 SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by MN2PR11MB4614.namprd11.prod.outlook.com (2603:10b6:208:268::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.13; Mon, 23 May 2022 07:30:10 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54e1:e802:17c8:93f]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54e1:e802:17c8:93f%7]) with mapi id 15.20.5273.023; Mon, 23 May 2022 07:30:10 +0000 From: "Xia, Chenbo" To: "Pei, Andy" , "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" , "Cao, Gang" , "Liu, Changpeng" , "Xu, Rosen" , "Xiao, QimaiX" Subject: RE: [PATCH v8 08/13] vdpa/ifc: add get device type ops to ifc driver Thread-Topic: [PATCH v8 08/13] vdpa/ifc: add get device type ops to ifc driver Thread-Index: AQHYarda8EX/UTF3hUa2C41tZJdM6a0sGB6g Date: Mon, 23 May 2022 07:30:10 +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-9-git-send-email-andy.pei@intel.com> In-Reply-To: <1652876035-70513-9-git-send-email-andy.pei@intel.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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: 3c3b38f6-96d7-4f46-215d-08da3c8e11aa x-ms-traffictypediagnostic: MN2PR11MB4614: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: 6Im2ck9IWZrzhFqLs9T4SOpCkJEWm2eT7PndynSWJJZu8lTPR2Bp+zApz0aFx1KBBgccwz+4itcEzvjRnxDMjYkbQEFE1GOEltQ31GrpkUuv+sL7FSUp5vEbXxeaMHqrmymfXeEzxU27uPwxeuiMeAAeN89Cgk4HYD1UZh6APrT0TF/AXOwVnwlFITN+aKSwhgSAXxQvWBl6849Xrr/AsdMxMpHWo22XDHg0G1GzulmJ1om4+/gCOWdu84PISNAQYwKJlLNPo6o0tBaTgHCkvUaMkzJt9V1lriJOVHP/mpLMrF89L3xqMTQtjN6V7af5D/s6Fb4j/EbXoekp+y0JxvrpLAtQ+nsKKU3UUXYbtTCC0sbRVbUKxVi2lci6XGBIXkoo8nmzu1PtzeWSZ/6K6wV49CHU7LEkrUW4uLNrDIbgt13rJSWRpjqaVKhYW9Uc9EldWNfo9Su7DcDSojM5D1EcXvooWUxt5SCvLU23rvJB0OyAvLohkFAUCCFgB38QRO7hggqV98P1yr/4zyncDVaXaXUGChs14XBK+alR3B0m8hk10QHMgke5i+8DeeHHFdH+hxyZ6jgbIP3d+MD//5TyLCoFb6lXTXcUyX0/oDgIXAPBR39wBn0PK51LFNk+orNAFpdp2mG6i6+5wAN7civqxbNMYuLZp6/wr+7Tp+mgUH0+6IJtK1CQ3psix5L0uxZtDG1KtZzHmcBtmrmDmQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(71200400001)(54906003)(110136005)(107886003)(6506007)(186003)(53546011)(26005)(9686003)(33656002)(508600001)(55016003)(83380400001)(76116006)(2906002)(8936002)(5660300002)(66446008)(64756008)(66946007)(66556008)(8676002)(4326008)(66476007)(82960400001)(316002)(38070700005)(7696005)(86362001)(52536014)(38100700002)(122000001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?7X888rlNIbGFI08OQXXItwohNS2fP8AOI158rsy4rKTCg+qvokohbtpGyIXE?= =?us-ascii?Q?qb9uIUTdQMuIKdLwH18pXVROsLXByMaAJogf28epp14J4E72VMO8/nAEWmDt?= =?us-ascii?Q?qRzciEwIHshHNOFu62P7Z2hySkmip22u89uG2P0ogywz5DxVmFoJ7pjJef/u?= =?us-ascii?Q?u8s/G+c6czJTZb9quObZzdbEPp+S3CNk5is+d15eSwjfQ+ViB4Vf10IcvddQ?= =?us-ascii?Q?S4DGAasF8U9woyOj9j3nRijgATie7nfvX04UaonO6s4yeIH6f38BHe1S3pr7?= =?us-ascii?Q?Pi5U59/zeCO5Zej4Rg9m1baHScmNym2lNUSjK/EtcGnWk/MP+mEb2rtYpbpu?= =?us-ascii?Q?45tJcUugypKkWa4ZuhFTaXZu7Mw0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Q?mHrHuGXGxPOXy/6+s0MttkPkc8uvIxeo5DuJaiZcjvekTSz+6BaBSqoD9Gsv?= =?us-ascii?Q?ehOLhUXVYFcNUow7bX6F2MHope4B3gzdKrkD6IQSThUWwC/OApz8zhUgfIRa?= =?us-ascii?Q?MDd8c/c01Lap1OWeFcQj2b0Iue+RGROG2HCIJfeZB0aR+QcSTCkWZ7sc9IhZ?= =?us-ascii?Q?nLcSZusPYJxYSqnx8SVHcgpcb/uT7PU4I8bZUekuIBRE+8/tHv+ZtUHonQVE?= =?us-ascii?Q?KREXX0R1sl2q6WzCxYQvkgKX+/XzaXVNW8T7050kyNUV0OobW1muaR7BGHIc?= =?us-ascii?Q?4RA72KUFZ+zF4LnZoXJHKfpGkUQEvznZky4vWFcn3oxWuHuPDoVquI/PeFuy?= =?us-ascii?Q?SO6L8S1HTsQIA1DG65fJ8pRbHq4NPW90KdjX+pgmeHYRYwoOZlOoi7+F5BUj?= =?us-ascii?Q?KVeH1ixA86ImlBRzHHw2GU1v0koqUrNPXvkrmJ7LP0qdz+ur7BcWNZ1Lc9mX?= =?us-ascii?Q?8t5skWp2Bw=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: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c3b38f6-96d7-4f46-215d-08da3c8e11aa X-MS-Exchange-CrossTenant-originalarrivaltime: 23 May 2022 07:30:10.5418 (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: LwSmx1Gtvvh2QKl8quhcqZnKssMnjECCFs0z84V+JJN3YyXrR96C/3Lmn0M8GnGMkUVGGyiailxFxnDR7UvAvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4614 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 > -----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 08/13] vdpa/ifc: add get device type ops to ifc driver >=20 > Add get device type ops to ifc driver. >=20 > Signed-off-by: Andy Pei > --- > drivers/vdpa/ifc/ifcvf_vdpa.c | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) >=20 > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.= c > index 3e78c7d..0acfa8c 100644 > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c > @@ -1189,6 +1189,29 @@ struct rte_vdpa_dev_info { > return 0; > } >=20 > +static int > +ifcvf_get_device_type(struct rte_vdpa_device *vdev, > + uint32_t *type) > +{ > + struct ifcvf_internal *internal; > + struct internal_list *list; > + > + list =3D find_internal_resource_by_vdev(vdev); > + if (list =3D=3D NULL) { > + DRV_LOG(ERR, "Invalid vDPA device: %p", vdev); > + return -1; > + } > + > + internal =3D list->internal; > + > + if (internal->hw.device_type =3D=3D IFCVF_BLK) > + *type =3D VDPA_DEVICE_TYPE_BLK; > + else > + *type =3D VDPA_DEVICE_TYPE_NET; > + > + return 0; > +} > + > static struct rte_vdpa_dev_ops ifcvf_ops =3D { > .get_queue_num =3D ifcvf_get_queue_num, > .get_features =3D ifcvf_get_vdpa_features, > @@ -1201,6 +1224,7 @@ struct rte_vdpa_dev_info { > .get_vfio_group_fd =3D ifcvf_get_vfio_group_fd, > .get_vfio_device_fd =3D ifcvf_get_vfio_device_fd, > .get_notify_area =3D ifcvf_get_notify_area, > + .get_dev_type =3D ifcvf_get_device_type, > }; >=20 > static inline int > @@ -1327,6 +1351,7 @@ struct rte_vdpa_dev_info { > .get_vfio_device_fd =3D ifcvf_get_vfio_device_fd, > .get_notify_area =3D ifcvf_get_notify_area, > .get_config =3D ifcvf_blk_get_config, > + .get_dev_type =3D ifcvf_get_device_type, > }; >=20 > struct rte_vdpa_dev_info dev_info[] =3D { > -- > 1.8.3.1 With renaming fixed mentioned in patch 7: Reviewed-by: Chenbo Xia