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 CFFD4A0032; Wed, 14 Sep 2022 04:57:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 689C04021D; Wed, 14 Sep 2022 04:57:42 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 3800E40151 for ; Wed, 14 Sep 2022 04:57:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663124260; x=1694660260; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Z/UiHeVGUDrkIT66Gn0F01FFIb7i/48kFJ3leVXCbBE=; b=gV9xSb3zmlXMvf/nVVWyrIezKcClSRfKpvCTfqfZMH1tYo4TB9NWNapc GbEXioEEzBVjmuaqb65u5tD4J3XH/AsPi5L/OZAZEQUiaj8N39iO9yJon 6HcDRyphF0Lss/p3sd1eJBMsRcFVIdb0eA31moSaL3ZzdHb1gBdeOTucu AYBe7WRF9Ad1MkqzRgqt9wVzkJvzWIVkwdmt0yO8zFykJe9a9EFvImRPm Ih/TR9/cqSo0X9EA9h3wvbrtz+qiMf94f8/ZJMBQdbeE7Vx504fQbze1k 3IWX8iMfxFrrv6Eua0aDr+7WNtJsuJpNAaEK2/fZkr4Xbtt+P3PaAGwMJ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10469"; a="281351753" X-IronPort-AV: E=Sophos;i="5.93,313,1654585200"; d="scan'208";a="281351753" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2022 19:57:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,313,1654585200"; d="scan'208";a="861785742" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga006.fm.intel.com with ESMTP; 13 Sep 2022 19:57:30 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 13 Sep 2022 19:57:30 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 13 Sep 2022 19:57:29 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 13 Sep 2022 19:57:29 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.103) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 13 Sep 2022 19:57:28 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YyhMOpcVVF5sytuG4Kavf8UwwDpRDJHEnHx8yLlIEYDR92MQFN/5dBH6fqoTJ/z4RgwrzgmzyyGlUmacDyelYGoWCezc2hB0OfDM3An9SmIcvl4VxsgYvep8W01eqHbU/RMFc9nbBIFt6tgfCcXf7+smrFNhPy2WodeRw560IBwap5plYgp9Se/zpHVHHVNLVAU3hL2A35J7/9bBw9jP+90gKZVKARXr8Hk2PIb1Lb7m9sdJRnWPKRUtAPX99f+nwoYW7OFifgEwZ2byTYMTvdAptS3TjPabzTDerYj6KAlLIGCBd2PmsL9+wJjju0iEV8mXnPp/b9FKSAqGpam4jg== 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=vcVeGbvIhjU2631m9TRncEGQiZmu+xG17YJVE247qLg=; b=mGM6XyJIbTU5LYOL1cvc0JwAScPCAucBvdt6SaJE94RYsx8HEpWMiKLFXrlBaPqh57Idv3Lwpj6fMIdDHPu565u/taTi1MGxTDUYISvjb1MZZ9669onyP2RDWS19vz44c8QuqHMXHMjO/vc+RxhRt45m9o67WAZmshi6nNS0P/v5sEBOq2pjxwSEPnjQ78zhXb6cpPpmiivoq+N0WCEja5dby5nymmEIAHCNACKvaqL9z0Mui6E+zev6L/Eh549+1X/wSeEPeNgvSD1C2zQK5VtlDdMOyCneysCsQ5Cv0UsJEK1UV1DX4UnQsrVjeHjQp6ix1kFJLfUp9hnOnUNVCg== 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 DM6PR11MB3530.namprd11.prod.outlook.com (2603:10b6:5:72::19) by SJ0PR11MB4941.namprd11.prod.outlook.com (2603:10b6:a03:2d2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Wed, 14 Sep 2022 02:57:27 +0000 Received: from DM6PR11MB3530.namprd11.prod.outlook.com ([fe80::5c54:f535:6ab0:20ed]) by DM6PR11MB3530.namprd11.prod.outlook.com ([fe80::5c54:f535:6ab0:20ed%7]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 02:57:27 +0000 From: "Huang, Wei" To: "Xia, Chenbo" , "Pei, Andy" , "dev@dpdk.org" CC: "Xu, Rosen" , "Cao, Gang" , "maxime.coquelin@redhat.com" , Huang Wei Subject: RE: [PATCH v2 5/8] vdpa/ifc: only configure enabled queue Thread-Topic: [PATCH v2 5/8] vdpa/ifc: only configure enabled queue Thread-Index: AQHYw0dZ8/ldBlSZq024ba6/7F4Gza3eNJSAgAAQINA= Date: Wed, 14 Sep 2022 02:57:27 +0000 Message-ID: References: <1661229305-240952-2-git-send-email-andy.pei@intel.com> <1662616458-164613-1-git-send-email-andy.pei@intel.com> <1662616458-164613-6-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-reaction: no-action dlp-version: 11.6.500.17 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB3530:EE_|SJ0PR11MB4941:EE_ x-ms-office365-filtering-correlation-id: c8adbab3-321f-420d-7ba4-08da95fcdb8b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +RpkdQ+64HX/877twFts8Pjj/EiuN5g6Do58boNeouI5R/7PYeunEFOVv0kjJf/NIqrgm6rHDV9zFF+YnMPQthjLyE3g6NYJmp/GAFU0RLCqoxwPbrUQ8hvddHmmSi5xZDDEzYkYcyccThw4KgLMU2iau3jSqDjufLcNHyUK0FDvsc2ai/ldsv4WZdQH7TopPrn8dP8ABkt4ue/8ZKWXcBxySGjelshMX48F/upU6M3i2XqKgUxiAKKSXz2u++wAcVeb154LjRrWI4UNkvHy4wQZI1Dc/9a+Vpm2tIt874W+eX84uoll3RnRM5iZQp1nFYxJfMe8lvm949l4ANZhC/L5cCed2LTtZ6CbhItsPBo0+aFMQAqX95YOwn1tRRpeWDkaEQVje6GhGeY1fdA8GYtz55d1CEbeUqH4wI/baBtuE1RDSXOet5N1LTsX+1oAwHdIwTYKClHrChnsayH8pseeI3wt7WbQVx1Cv2FvCgxP7NzgIg7JsQAYc/Xuwdmt68eqiAZqvcJSyKNQbIsU4U2wBYeqDuGly/cBCpcKYRm1rTwfF9dpXtPiAWbqFNpXPBN9ALWbf8Yu0AbUaDUZmMPYD3WP94GUIA/O+2dFIE7pc8XWbVIm4dz6sfmn0Cb89CPDCN5DKIR4cgE7XK0e8j2/WdEwmo2HkBjLXsK6XBia37p+l5TxxpRPZl9NC5cPgRYXquxmmJFsuFDEmQzl0e3Acmy64S9rhqsIuv64eHzJ5gDuuSyrF2xOZLEr+wKsJ/8EvPiyiqRqndd7qayt7A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3530.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(346002)(136003)(39860400002)(366004)(376002)(451199015)(9686003)(186003)(82960400001)(41300700001)(38100700002)(122000001)(8936002)(66556008)(64756008)(8676002)(4326008)(66446008)(5660300002)(26005)(107886003)(66476007)(76116006)(66946007)(33656002)(55016003)(86362001)(38070700005)(2906002)(83380400001)(316002)(110136005)(478600001)(71200400001)(6506007)(7696005)(52536014)(53546011)(54906003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?P+XlpzgnY+xqY3Yk1ckL39Jqu/rhMbFatIhS5qEdPVF7yEUTWp11z7mazg5V?= =?us-ascii?Q?7/B7ERGhktiVzrSzoimnD8q8aNZ5rYXIhEZ7ql57N2zAvv6FEm7VnI/KxUOa?= =?us-ascii?Q?oXAf0DPbFUsSmBdWRQKR+3icdgcczqXlDBZBIUPMYtfLRzDAy7u4Gwz+zUHi?= =?us-ascii?Q?0NumjoZ7EPlIzhWzJoCIlMPveWd2JNf67xZZtNtzkewlV28LdHhfoAxvhSFf?= =?us-ascii?Q?aVMfMzvXr+rWQaFS8dw2BV6qx35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hBLTV?= =?us-ascii?Q?Q/OMxBPsJClumC6Eq/XsiOp3IqSzH5P/mf4YRw6jKt8Cxfgupjm1LTTUuipI?= =?us-ascii?Q?New0k43aiRdeuC2D/qLc+/NE34HkGjJk2TtTc0NS4pv3Vg+Debn+t7/LBpA/?= =?us-ascii?Q?fluN2BaLH6cw2CPq+OJbseN7Z0wtlQFWex5eBlkdsG8nYoMPVN27HWylfHGC?= =?us-ascii?Q?UtEIr9gA+OaBXfv9Y1IvzWu/Thfrc3YSXcrr5xzi1yA0sM1xCWpURAIbWwnM?= =?us-ascii?Q?qEbIqKkJks58NFzJ23hC0sylRx2cmdf8T4DLi0XTshap+mqpm+dc+Qa0RaCK?= =?us-ascii?Q?H0DVl0shB18lCAfvOQicCQ2Eizhq6h2IsvrmQRp20FOvqvA2QGIgCsObC8iB?= =?us-ascii?Q?yt7zPEw0NtxHST2gcc7RPMSCVnLRh52FImqAtR5AugLOFSA60s/rRGjj3rPl?= =?us-ascii?Q?w5zkrBQ51qPbTEcMWbgu+GL23kqa8gyEkivoJGkh?= 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: DM6PR11MB3530.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8adbab3-321f-420d-7ba4-08da95fcdb8b X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Sep 2022 02:57:27.3682 (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: 0eXvjsOfTMoq+8qUfIIPZU0zm/16wjUO6+KLzrNvc5XSvunZGQB2cKWQnA9KGtk+JQtd8rX4kK+HwFtfmjCUIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4941 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: Xia, Chenbo > Sent: Wednesday, September 14, 2022 09:59 > To: Pei, Andy ; dev@dpdk.org > Cc: Xu, Rosen ; Huang, Wei ; Cao= , > Gang ; maxime.coquelin@redhat.com; Huang Wei > > Subject: RE: [PATCH v2 5/8] vdpa/ifc: only configure enabled queue >=20 > > -----Original Message----- > > From: Pei, Andy > > Sent: Thursday, September 8, 2022 1:54 PM > > To: dev@dpdk.org > > Cc: Xia, Chenbo ; Xu, Rosen > > ; Huang, Wei ; Cao, Gang > > ; maxime.coquelin@redhat.com; Huang Wei > > > > Subject: [PATCH v2 5/8] vdpa/ifc: only configure enabled queue > > > > when configure the hardware queue, we only configure queues which have > > been enabled by vhost. > > > > Signed-off-by: Andy Pei > > Signed-off-by: Huang Wei > > --- > > drivers/vdpa/ifc/base/ifcvf.c | 6 +++++- > > drivers/vdpa/ifc/ifcvf_vdpa.c | 16 ++++++++++++++-- > > 2 files changed, 19 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/vdpa/ifc/base/ifcvf.c > > b/drivers/vdpa/ifc/base/ifcvf.c index 0444d74..4875ea1 100644 > > --- a/drivers/vdpa/ifc/base/ifcvf.c > > +++ b/drivers/vdpa/ifc/base/ifcvf.c > > @@ -249,6 +249,9 @@ > > > > ifcvf_enable_multiqueue(hw); > > for (i =3D 0; i < hw->nr_vring; i++) { > > + if (!hw->vring[i].enable) > > + continue; > > + > > IFCVF_WRITE_REG16(i, &cfg->queue_select); > > io_write64_twopart(hw->vring[i].desc, &cfg->queue_desc_lo, > > &cfg->queue_desc_hi); > > @@ -283,7 +286,8 @@ > > notify_off =3D IFCVF_READ_REG16(&cfg->queue_notify_off); > > hw->notify_addr[i] =3D (void *)((u8 *)hw->notify_base + > > notify_off * hw->notify_off_multiplier); > > - IFCVF_WRITE_REG16(1, &cfg->queue_enable); > > + if (hw->vring[i].enable) >=20 > Seems useless check as it already checked when the for loop starts Yes, it should be removed. >=20 > Thanks, > Chenbo >=20 > > + IFCVF_WRITE_REG16(1, &cfg->queue_enable); > > } > > > > return 0; > > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c > > b/drivers/vdpa/ifc/ifcvf_vdpa.c index 2b42850..48f1a89 100644 > > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c > > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c > > @@ -290,6 +290,8 @@ struct rte_vdpa_dev_info { > > rte_vhost_get_negotiated_features(vid, &hw->req_features); > > > > for (i =3D 0; i < nr_vring; i++) { > > + if (!hw->vring[i].enable) > > + continue; > > rte_vhost_get_vhost_vring(vid, i, &vq); > > gpa =3D hva_to_gpa(vid, (uint64_t)(uintptr_t)vq.desc); > > if (gpa =3D=3D 0) { > > @@ -505,6 +507,8 @@ struct rte_vdpa_dev_info { > > > > vring.kickfd =3D -1; > > for (qid =3D 0; qid < q_num; qid++) { > > + if (!hw->vring[qid].enable) > > + continue; > > ev.events =3D EPOLLIN | EPOLLPRI; > > rte_vhost_get_vhost_vring(internal->vid, qid, &vring); > > ev.data.u64 =3D qid | (uint64_t)vring.kickfd << 32; @@ -1064,6 > > +1068,8 @@ struct rte_vdpa_dev_info { > > struct rte_vdpa_device *vdev; > > struct internal_list *list; > > struct ifcvf_internal *internal; > > + struct ifcvf_hw *hw; > > + uint16_t i; > > > > vdev =3D rte_vhost_get_vdpa_device(vid); > > list =3D find_internal_resource_by_vdev(vdev); > > @@ -1077,11 +1083,17 @@ struct rte_vdpa_dev_info { > > rte_atomic32_set(&internal->dev_attached, 1); > > update_datapath(internal); > > > > - if (rte_vhost_host_notifier_ctrl(vid, RTE_VHOST_QUEUE_ALL, true) !=3D > > 0) > > - DRV_LOG(NOTICE, "vDPA (%s): software relay is used.", > > + hw =3D &internal->hw; > > + for (i =3D 0; i < hw->nr_vring; i++) { > > + if (!hw->vring[i].enable) > > + continue; > > + if (rte_vhost_host_notifier_ctrl(vid, i, true) !=3D 0) > > + DRV_LOG(NOTICE, "vDPA (%s): software relay is used.", > > vdev->device->name); > > + } > > > > internal->configured =3D 1; > > + DRV_LOG(INFO, "vDPA device %s is configured", vdev->device->name); > > return 0; > > } > > > > -- > > 1.8.3.1