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 A19CDA00C3; Fri, 13 May 2022 09:38:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54568410EF; Fri, 13 May 2022 09:38:27 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 2EED1410EE for ; Fri, 13 May 2022 09:38:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652427505; x=1683963505; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=xjizFEzV9cugXCRnzm0lHb2FCQuHVYwXX4vHCSVUhxo=; b=DkUL145nxhzMTlA3rqciFGMDTkdAFGU6ZMImXs/hEedVRbP0PjbxA3ND 87jgUjvGOkWV/yEFNy9VWlpXCZvmqv1k7h0uYGzf5J8WgrTr1o8XwsvS7 sVVQZNWABgosNY4nhDvbe4lGSqo9/Wxyv/j6rplrJr3u9rgYndqciyNgO vjd5BOmBBZ0wMOUigYt+mtkxZeVh7HZV4ysoZsp3F8hpjvr6cVPuE6jK4 F8CZNSivc5jtq+3K8pmLL5wjkUGLB6qHabjLByEJd8MpOSoXdjpP7ERzL IAKUTlZgUjAdM7O12VlQW24dsfQMJUVexEYDn+UNWb1JDUJXuZkXenOCH w==; X-IronPort-AV: E=McAfee;i="6400,9594,10345"; a="250773361" X-IronPort-AV: E=Sophos;i="5.91,221,1647327600"; d="scan'208";a="250773361" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 00:38:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,221,1647327600"; d="scan'208";a="658987459" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by FMSMGA003.fm.intel.com with ESMTP; 13 May 2022 00:38:23 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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; Fri, 13 May 2022 00:38:23 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 13 May 2022 00:38:22 -0700 Received: from fmsmsx612.amr.corp.intel.com ([10.18.126.92]) by fmsmsx612.amr.corp.intel.com ([10.18.126.92]) with mapi id 15.01.2308.027; Fri, 13 May 2022 00:38:22 -0700 From: "Pei, Andy" To: "Xia, Chenbo" , "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" , "Cao, Gang" , "Liu, Changpeng" Subject: RE: [PATCH v7 08/18] vdpa/ifc: add get device type ops to ifc driver Thread-Topic: [PATCH v7 08/18] vdpa/ifc: add get device type ops to ifc driver Thread-Index: AQHYWheFPgG+LFiGMkWmoyHmrHUSKq0bUJ7wgAAGTvCAAS1boA== Date: Fri, 13 May 2022 07:38:22 +0000 Message-ID: References: <1643093258-47258-2-git-send-email-andy.pei@intel.com> <1651048206-282372-1-git-send-email-andy.pei@intel.com> <1651048206-282372-9-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 x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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. I will implement a function "ifcvf_get_device_type" for both ifc net and bl= k ops. "ifcvf_get_device_type" will return device type according to internal->devi= ce_type. > -----Original Message----- > From: Xia, Chenbo > Sent: Thursday, May 12, 2022 9:41 PM > To: Xia, Chenbo ; Pei, Andy ; > dev@dpdk.org > Cc: maxime.coquelin@redhat.com; Cao, Gang ; Liu, > Changpeng > Subject: RE: [PATCH v7 08/18] vdpa/ifc: add get device type ops to ifc dr= iver >=20 > > -----Original Message----- > > From: Xia, Chenbo > > Sent: Thursday, May 12, 2022 9:22 PM > > To: Pei, Andy ; dev@dpdk.org > > Cc: maxime.coquelin@redhat.com; Cao, Gang ; Liu, > > Changpeng > > Subject: RE: [PATCH v7 08/18] vdpa/ifc: add get device type ops to ifc > > driver > > > > > -----Original Message----- > > > From: Pei, Andy > > > Sent: Wednesday, April 27, 2022 4:30 PM > > > To: dev@dpdk.org > > > Cc: Xia, Chenbo ; maxime.coquelin@redhat.com; > > > Cao, Gang ; Liu, Changpeng > > > > > > Subject: [PATCH v7 08/18] vdpa/ifc: add get device type ops to ifc > > driver > > > > > > Add get device type ops to ifc driver. > > > > > > Signed-off-by: Andy Pei > > > --- > > > drivers/vdpa/ifc/ifcvf_vdpa.c | 10 ++++++++++ > > > 1 file changed, 10 insertions(+) > > > > > > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c > > b/drivers/vdpa/ifc/ifcvf_vdpa.c > > > index 8a260b7..99a6ab0 100644 > > > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c > > > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c > > > @@ -1300,6 +1300,15 @@ struct rte_vdpa_dev_info { > > > return 0; > > > } > > > > > > +static int > > > +ifcvf_blk_get_device_type(struct rte_vdpa_device *vdev, > > > + uint32_t *type) > > > +{ > > > + RTE_SET_USED(vdev); > > > + *type =3D VDPA_DEVICE_TYPE_BLK; > > > + return 0; > > > > This is not right. Remember net and blk are both using the driver? > > This will lead to using net also returns BLK. >=20 > Correct a bit for above: will lead to net not working. So implement callb= ack > for both (although in the API, NULL callback can return NET type) >=20 > Thanks, > Chenbo >=20 > > > > And I suggest the patch-set validated with both blk and net... > > > > Besides, ifcvf_blk_get_device_type should be ifcvf_get_device_type > > > > Thanks, > > Chenbo > > > > > +} > > > + > > > static struct rte_vdpa_dev_ops ifcvf_blk_ops =3D { > > > .get_queue_num =3D ifcvf_get_queue_num, > > > .get_features =3D ifcvf_get_vdpa_features, @@ -1313,6 +1322,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_blk_get_device_type, > > > }; > > > > > > struct rte_vdpa_dev_info dev_info[] =3D { > > > -- > > > 1.8.3.1 >=20