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 6AFB2A04FF; Tue, 24 May 2022 05:02:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C1F9427F3; Tue, 24 May 2022 05:02:35 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 06BD2427EC for ; Tue, 24 May 2022 05:02:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653361353; x=1684897353; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=59c+Fvja4U1znvFmXqzYzuAd+Y3ZQ31yKn/yLgqUNAU=; b=cvN8hyBwHT/1YvxI0a7WvDid2dzXc/fg0px8+3umdIwS8mpWajfvtMWe S4pf1RoxdaXKUNfoDYWJSeORb4a1RlxMzIBznAOtMVLL/gMY+Zs8ZYBjd OaxpRCgvXt3ClFQYrrcy8MMBvO4sFsqXZeB26grgHzAqUe1jSkEnFWwmj PmCbdLzFZogFN9Is9JsivFO/pm7+l5U6x0k0nDi99d7s5pygb4AM9JIc+ AHuIE6ra+CPRKxB1C2OFfpwtTAzBWNg+d9gCSADx1RwY5wvo4OC8JXi+i gosonOTGWwgywy70rCNIOL0bzbKs+KCKBtWRyWl/+j3BQoeDS8mNp8L2z g==; X-IronPort-AV: E=McAfee;i="6400,9594,10356"; a="334062492" X-IronPort-AV: E=Sophos;i="5.91,247,1647327600"; d="scan'208";a="334062492" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2022 20:02:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,247,1647327600"; d="scan'208";a="577704358" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga007.fm.intel.com with ESMTP; 23 May 2022 20:02:30 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx606.amr.corp.intel.com (10.18.126.86) 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 20:02:29 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx611.amr.corp.intel.com (10.18.126.91) 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 20:02:29 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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 20:02:29 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.107) by edgegateway.intel.com (192.55.55.71) 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 20:02:28 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bml8xvgSdF7/6fkAKEEjkWl0ezfgn55hsyqOLVEbEj8HcBdPEJuG9DepnUpyFwhWWIIAn4yacm5OCZZ4GGpSNZENI83EChOGZSqLuAxlTguZkffmG+x6Lw+6JCZPunZIzQXbO5pQevxJh4LRY/GQ2hrebrKTzI5njme9PIu4kfcYe6eyUNgZEQJWl0vmLxqRtkVwvxnud2z/Ylr08ZkqUUTBFbcOwDOd/8AJknOTbXMmdud5w7L1iP0r9CQ4DzS5qitUop3mfbvm0KeruyqdnAVmv56m/e0CPUSegW8kaz3MM2KKynlecbMQksT6R9YFIVBJ2yuWIkH/d+tArWwb6g== 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=tKRhnNlM3EH9GMr5SK79CoOaOtIEJeP4zCgr+Dh8drY=; b=gGfposv9CCJy4vcABgCpuKlZ+BnPOUAUGRexvEgSdF/s+S5z5s0IP1rRDTX3bZcrh9e11+QkiAie1uPaI3eSEscW1FN9MXKBpLP6qc12hjw0ofxP53BEkcuoMADRVFasUKqZ+HRqHEkWiLehzWo5JcWPIVh95MOJ0H8F+xN8jDQzxvSXVJYXTO1XZZSylnPxh84mwKwqKAu/Ivwq9kno8p95ZboBl1bGggXez3QDhz0XRHDVo3NcUwogpRkfsLJOKT7E1oK2WWjbtwObfr02xp44ZbF8zXHcDzMYwWnn2RqesMLyQuPcCwJnmIA4OhoMEJB6YMpKO3dGxJjcfKLufg== 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 CH0PR11MB5267.namprd11.prod.outlook.com (2603:10b6:610:e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16; Tue, 24 May 2022 03:02:27 +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; Tue, 24 May 2022 03:02:27 +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 v9 08/13] vdpa/ifc: add get device type ops to ifc driver Thread-Topic: [PATCH v9 08/13] vdpa/ifc: add get device type ops to ifc driver Thread-Index: AQHYbo8W6QuFVZt2eE2WHAR7y+2iGq0tWD4g Date: Tue, 24 May 2022 03:02:27 +0000 Message-ID: References: <1643093258-47258-2-git-send-email-andy.pei@intel.com> <1653298524-232138-1-git-send-email-andy.pei@intel.com> <1653298524-232138-9-git-send-email-andy.pei@intel.com> In-Reply-To: <1653298524-232138-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: 29072225-03bd-4d1e-8101-08da3d31d5b4 x-ms-traffictypediagnostic: CH0PR11MB5267: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: ayV+Tt5Bp/tshPQZTUiDjcyIWqLVP56be5HukX0PklGt7QRpbcHA/0mlTIEwHh295GJ046So3DpEdGFAxQrnH47qsxizAgMRO6RlRFUE90qSq7zD1lXdkA9KSf7wSANfGSvfv+G5nrEuXVMRgqxBzfZq/r/YjeL4Q420nLGff/RnBPUoZwEm/vrkIXTz9gAt+jj1To+ctP87sa54+ZJhmuDfJZbvABjQgdCMdmkYkDv+f7WiYCfLLtlZcRSRsDFyNbdZ2urFmXjHvqpR/zkFgCHqz6sVmk85YoMwjO+tY77W/rCyvyfIXdkaL3QBaSepIcBVXxhVJ6ay/Fc1HVCb+t269QpBy0blGt0PCSDe3zJAB59fPkCnFzdf/sqeeBB4xKidLh9gnFbQvrveEyLJEjh+iRz8oTavESKJZ0yRwxpb5IEgpLl6bkhPp0KQyFJUaHZTezd7vPiP+ncW/Rjttvff1ubgKwYfBjMl83I3Hnvoq/MFVYbY7kf3IAgTJgRsA6UTksxCrCiruDdmFk318GLiOr6je4dY1sIFNfA+hKmc0eTDHLKJ4wGgH0kfs3xw51pWPRTSgh/gxq/oQ8xW8pw7j4YcI218y3E258FZNIEjZ9hXL/poLbLtQKxamR5AHktHnn3QWL8aAJpx2f5+W72t7HPwYRjq7PiD6gPoRWVVmlNi6OpC+NXap5862e6W+ap9/Lg5GpEeXHB8bt20bQ== 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)(38070700005)(71200400001)(55016003)(122000001)(33656002)(82960400001)(52536014)(5660300002)(8936002)(83380400001)(86362001)(7696005)(9686003)(26005)(53546011)(6506007)(508600001)(2906002)(4326008)(186003)(54906003)(316002)(8676002)(76116006)(110136005)(66556008)(64756008)(66946007)(66446008)(66476007)(107886003)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?g8O+7QxBd2MoehYxpYaraheRK4igMnx8+Gsph0X2EkNzD83HdPeYbF65nrnD?= =?us-ascii?Q?VXWpKdNQypTHy/mobwddD/Dnk+JQZkdqCc1JsKRetfizxk8SGm11Cp7Bm7tC?= =?us-ascii?Q?RMOCA6zZx8L/mdeCOcVkOhEuJ8z8KvUArKFHpIUGbjW6nRk8BsCHQRoQOig3?= =?us-ascii?Q?UCN2rQG54k9AKFLkQWdNKOX93CZbgOOck7EM0R3NPISeWV/AOOwqLxFvl2PS?= =?us-ascii?Q?k0P7RveGx6yPnA8xxNXiHOCctYhTaWdx3yy7vRqW3t/0KkJM694PzxFd2vCZ?= =?us-ascii?Q?lg6W2OL+dO7yI7poavAApxOp9CtKMKPNmlx/OLVHtbfn8aanbTSWjVHFu9Tn?= =?us-ascii?Q?H7u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1AWc?= =?us-ascii?Q?Bbfu/8W7mIWLyXQIguWHZtbpEf/sBh5Q9XGRNvkhEFVEU58/qDOqytTEhV+3?= =?us-ascii?Q?BtHPG9ypEc/ouuqmi//ZFY9Gc0QE+oPCWcl9EjEx51GaTWUM6rOKafobJ8gZ?= =?us-ascii?Q?qJPg085xPxDFJ/1J9jKo6HoMPyg97En3lB5E7CCPpuq0Ywcw8WG2iayc/CJd?= =?us-ascii?Q?HAUZS0JR6r2rd/bA8wnIaKIaNEazGRO9jNauYNOkVuEI7Voof19DdcX/IhZX?= =?us-ascii?Q?QaXyvDVinyrHMxPybUneCPXrV6Uj2bt09lQiByyQvyf1/FgBYWvgkiJtefr6?= =?us-ascii?Q?NXJi2U2cwd5blfGmncuiKlX6wZq7A9VyMF9nvpeeeVlVbyc/v6dzbIRViUF/?= =?us-ascii?Q?cGbh4s/QVpcJoYrdyBCTY3Ebclh2/G3FE2Yut6gICfYP2vdw1vBNHRHpOrJE?= =?us-ascii?Q?zOJnBLjBOOkp1kvN/c6rv12Fa6AFdWAneZu5yjZFR/DBGp9IIvlspi0SdM5v?= =?us-ascii?Q?vIu4lFFI8g=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: 29072225-03bd-4d1e-8101-08da3d31d5b4 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2022 03:02:27.3789 (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: a5Pmtd1vm66m6bUSUt1kiySRJ/5+uIltS/cqztKNvIiJWe7JxL/+PAfeFxVM4kKDtymvTKFztBk4l2JZRS0Guw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5267 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: Monday, May 23, 2022 5:35 PM > To: dev@dpdk.org > Cc: Xia, Chenbo ; maxime.coquelin@redhat.com; Cao, > Gang ; Liu, Changpeng ; Xu, > Rosen ; Xiao, QimaiX > Subject: [PATCH v9 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 7a0bdb4..1c5746a 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 RTE_VHOST_VDPA_DEVICE_TYPE_BLK; > + else > + *type =3D RTE_VHOST_VDPA_DEVICE_TYPE_NET; > + > + return 0; > +} > + > static struct rte_vdpa_dev_ops ifcvf_net_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 Reviewed-by: Chenbo Xia