From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7BC8FA052B; Wed, 29 Jul 2020 08:09:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4EE1010A3; Wed, 29 Jul 2020 08:09:50 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 249711023 for ; Wed, 29 Jul 2020 08:09:47 +0200 (CEST) IronPort-SDR: PrENtJYOzukj2rWAv0bJTYgFFLo8HQfxOYPq+FDIEr0vAzRqf8UUqMr7nryjK+tbbQbcHNQ5rU SXDq+kY8zQaA== X-IronPort-AV: E=McAfee;i="6000,8403,9696"; a="130922624" X-IronPort-AV: E=Sophos;i="5.75,409,1589266800"; d="scan'208";a="130922624" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2020 23:09:47 -0700 IronPort-SDR: C5xBefjI6Fm7ZqDmRqs14rs569Dt06C9CXxVtgUq9BLgAHhVfYGyEWf3fwhWyt77XFmhuo5auj KuDXALxIbNxA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,409,1589266800"; d="scan'208";a="490177431" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga006.fm.intel.com with ESMTP; 28 Jul 2020 23:09:47 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 28 Jul 2020 23:09:47 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.172) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 28 Jul 2020 23:09:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Od9uRN8H3XESFIc+uRK6rCvv+RTfZEI8e2PqPSz+Pl3Fil7MmSxL7p8qn4l7lZAYuDQ+jZ1DDaCjVpU1ui40Ez/b5wQsOWo4qBJaUQoRl8TNqwyaB0/PsZL6XMFA0us+c2J/ENBZaeZwGqpfiOwpNUIy6EtAU4nfp5pHAEwTjgwxCPGAbb4ciYZ4vqk8QRmXx42YoGWDcV0IvO3CIKOlbkZLjsysYnUalbsPOT973Y6vr3gBL8fKDkLGI/cyZ5/KOlq5NO7+ywixJjH7AKwqVqEYviSGJlN9ec9E8fk70f41zT+isbDGyescnaoMWzCkRFAJlbtpWw/ZvHTK87yc3w== 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-SenderADCheck; bh=880vEca58w48R26B/K6PZfr2/o4/JX3F3ziQhsmVYc8=; b=In0+KeLK75CddVYmj7CAgaoRm9qd4k/LEJRJzovJ5JDNfXCXJ/2SWLdUs6sMeG9/gocsAPX5HzoY0mFMJ1QM/VddEfqs7HxVMOZ14d6DaieyIHSXr4hqQjbaJ9S3S0FAxZtXCEEeNg7M/BNFZjlUSzatE7CLGjJYUVojH3P6+NxPOISkvOO+uTtMp83uYfqPca2VAKG00z5n2StQLQ1NpD4zV+Xyx1V5XWdSfu6nhRWwwzKwXM4I290/3CDFaCg/iJ0tj/LVt1rHk5+D/GS2Ff7I4iE5eFlYCrhkGm31dBug4RuXSjEU3nQ5Xs82MVKkTPgZf75vFIcrCYKsrZgh+w== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=880vEca58w48R26B/K6PZfr2/o4/JX3F3ziQhsmVYc8=; b=ORnd0FtSnTyfKI23dKT1l+ps2wMFIhyyH0tBhxzAeLUd1m3s600c+hYCKRMfAdpA7CiZZoHaAx5aPM+l9uwLX7J1WW2llnfYig2iUBikl/nw+iyWriXNZ1byDDZki1f1W27g4xhoDMUZsEGyyNt2vOz6otwdilscWuO83pshBiA= Received: from BYAPR11MB2648.namprd11.prod.outlook.com (2603:10b6:a02:c7::10) by BYAPR11MB3845.namprd11.prod.outlook.com (2603:10b6:a03:b4::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.16; Wed, 29 Jul 2020 06:09:44 +0000 Received: from BYAPR11MB2648.namprd11.prod.outlook.com ([fe80::a14f:c6b5:5aed:84f]) by BYAPR11MB2648.namprd11.prod.outlook.com ([fe80::a14f:c6b5:5aed:84f%7]) with mapi id 15.20.3216.034; Wed, 29 Jul 2020 06:09:44 +0000 From: "Wang, Yinan" To: "Xia, Chenbo" , Maxime Coquelin , "dev@dpdk.org" , "matan@mellanox.com" , "Liu, Yong" CC: "thomas@monjalon.net" , "Yigit, Ferruh" , "david.marchand@redhat.com" Thread-Topic: [PATCH v2 2/3] net/vhost: fix queue update Thread-Index: AQHWZP9QwkX6qaaf4UqtM8zWuTufD6kd3LcAgAA2zxA= Date: Wed, 29 Jul 2020 06:09:44 +0000 Message-ID: References: <20200728165021.216291-1-maxime.coquelin@redhat.com> <20200728165021.216291-3-maxime.coquelin@redhat.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.206] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9a00c49b-4765-4f81-59d9-08d83385fd16 x-ms-traffictypediagnostic: BYAPR11MB3845: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2CT2hn7VWfv7pzbwDzbND0gze9DxE3c+mt4QsaPq9KuYMN/NOM01hANf6zgBnk1q2amjwb0lTUqajrcCiYmOFqtd6qHAqX81KOz4mbcmcu8Iq85Tg0jAM0SNIG5B5jABYxEJJ4l/nD7E5lmymoemed/mtKUiZzEI1GU1YVnzaymtMNni2XZ7R5fhjIf3HPV5W4PlEufFkZm1JYGmMVP5ghA3LRO/1xUAQNwRTwTXsVtsui0ZLXTD7EoStDnGzF+aPtSesStA/fCIBruldS/SUlATNPS7CQp+uiwL83C3n4xNR0y71iMTl6q/g8syuucOQTFnYKoVBkC3kt2A4Gn87w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB2648.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(376002)(39850400004)(396003)(346002)(136003)(26005)(15650500001)(186003)(2906002)(66946007)(83380400001)(8676002)(76116006)(54906003)(6636002)(33656002)(55016002)(9686003)(52536014)(53546011)(4326008)(478600001)(6506007)(5660300002)(86362001)(8936002)(71200400001)(66476007)(64756008)(66446008)(7696005)(66556008)(110136005)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: lagjL09oJFT7JJgJ8Ws27mzxlImBlOgYdScrcNyZ34j3yZABodrA27szZwP2Rbbslh5HzJa9z/+PLn7XWKhN6aItx8z16W/1xo02nKzMBTjKbQjkMKR5DOb424g3Y0GiEe+c3zH6/e63/mZUdf8tnR9e5ltpzVP3pvzc9Lzzj3AJsXiPLIE3q3QMOwy4IyUJxrZinkHILR35SQncKfDwetb3VvxKFrZMx3svf/8QujevbwuCqRAwguN3dgNzCmcXT8pfd6RQPlqKc8X2PmzFnayzpvWS62SO16uFeTLCkLuCRzDE3CtYMOPxfkUTKo3Bq6WTuUdMwUvy3BHexdgBFlJ3OlgwiORVL2nRfxHuxgaMcZSsHR2/N0QPZ3nueTDza96oJSMAiqFlBjUdyjgcrlV8ng+Ttv40g9xIgwd33pmqgPucySSY6i1esTS/e1XvcGsnDm7NIU2oldJ0BsVEi4Q6FCVvz06A3ZQ5rRVgcUWlN2do77o5jyEhubkZkOOfLNn9Q10dwZRfBZi65LQFlJwNxhtavS/Qdd2urNuQmfC1tEpgcz8+oaVxcc7XDgYKq7POMt4xMUaZup3U97/116xURXSuU5DTdatZvQlZ7d93oQPdTHlKXs/btPtAiyG4DZl2Zaxut0HmaSdFlPbTRQ== Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB2648.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a00c49b-4765-4f81-59d9-08d83385fd16 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jul 2020 06:09:44.1553 (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: KiwPExjKulVtqYP4IuSQTPNrCCtFyhk1SlcNtrwVPgBxsXG74Q8v5aiZpfLEWjWHKt0mii+LPfl45QS9sdHrgQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3845 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 2/3] net/vhost: fix queue update X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Xia, Chenbo > Sent: 2020?7?29? 10:53 > To: Maxime Coquelin ; dev@dpdk.org; > matan@mellanox.com; Liu, Yong ; Wang, Yinan > > Cc: thomas@monjalon.net; Yigit, Ferruh ; > david.marchand@redhat.com > Subject: RE: [PATCH v2 2/3] net/vhost: fix queue update >=20 >=20 > > -----Original Message----- > > From: Maxime Coquelin > > Sent: Wednesday, July 29, 2020 12:50 AM > > To: dev@dpdk.org; matan@mellanox.com; Xia, Chenbo > > ; Liu, Yong ; Wang, Yinan > > > > Cc: thomas@monjalon.net; Yigit, Ferruh ; > > david.marchand@redhat.com; Maxime Coquelin > > > > Subject: [PATCH v2 2/3] net/vhost: fix queue update > > > > Now that the vhost library saves the guest notifications enablement val= ue > in its > > virtqueues metadata, it is not necessary to do it in the vring_state_ch= anged > > callback. > > > > One effect of the patch is also to prevent possible deadlock happening = in > vhost > > library. > > > > Fixes: 604052ae5395 ("net/vhost: support queue update") > > > > Reported-by: Yinan Wang > > Tested-by: Yinan Wang > > Signed-off-by: Maxime Coquelin > > --- > > drivers/net/vhost/rte_eth_vhost.c | 28 +++++++++------------------- > > 1 file changed, 9 insertions(+), 19 deletions(-) > > > > diff --git a/drivers/net/vhost/rte_eth_vhost.c > > b/drivers/net/vhost/rte_eth_vhost.c > > index bbf79b2c0e..951929c663 100644 > > --- a/drivers/net/vhost/rte_eth_vhost.c > > +++ b/drivers/net/vhost/rte_eth_vhost.c > > @@ -94,7 +94,6 @@ struct vhost_queue { > > struct rte_mempool *mb_pool; > > uint16_t port; > > uint16_t virtqueue_id; > > - bool intr_en; > > struct vhost_stats stats; > > }; > > > > @@ -547,8 +546,6 @@ eth_rxq_intr_enable(struct rte_eth_dev *dev, > uint16_t > > qid) > > rte_vhost_enable_guest_notification(vq->vid, (qid << 1) + 1, 1); > > rte_wmb(); > > > > - vq->intr_en =3D true; > > - > > return ret; > > } > > > > @@ -574,8 +571,6 @@ eth_rxq_intr_disable(struct rte_eth_dev *dev, > uint16_t > > qid) > > rte_vhost_enable_guest_notification(vq->vid, (qid << 1) + 1, 0); > > rte_wmb(); > > > > - vq->intr_en =3D false; > > - > > return 0; > > } > > > > @@ -841,7 +836,6 @@ vring_conf_update(int vid, struct rte_eth_dev > *eth_dev, > > uint16_t vring_id) > > struct rte_eth_conf *dev_conf =3D ð_dev->data->dev_conf; > > struct pmd_internal *internal =3D eth_dev->data->dev_private; > > struct rte_vhost_vring vring; > > - struct vhost_queue *vq; > > int rx_idx =3D vring_id % 2 ? (vring_id - 1) >> 1 : -1; > > int ret =3D 0; > > > > @@ -853,21 +847,17 @@ vring_conf_update(int vid, struct rte_eth_dev > > *eth_dev, uint16_t vring_id) > > rte_atomic32_read(&internal->dev_attached) && > > rte_atomic32_read(&internal->started) && > > dev_conf->intr_conf.rxq) { > > - vq =3D eth_dev->data->rx_queues[rx_idx]; > > ret =3D rte_vhost_get_vhost_vring(vid, vring_id, &vring); > > - if (!ret) { > > - if (vring.kickfd !=3D > > - eth_dev->intr_handle->efds[rx_idx]) { > > - VHOST_LOG(INFO, > > - "kickfd for rxq-%d was changed.\n", > > - rx_idx); > > - eth_dev->intr_handle->efds[rx_idx] =3D > > - vring.kickfd; > > - } > > + if (ret) { > > + VHOST_LOG(ERR, "Failed to get vring %d > > information.\n", > > + vring_id); > > + return ret; > > + } > > > > - rte_vhost_enable_guest_notification(vid, vring_id, > > - vq->intr_en); > > - rte_wmb(); > > + if (vring.kickfd !=3D eth_dev->intr_handle->efds[rx_idx]) { > > + VHOST_LOG(INFO, "kickfd for rxq-%d was > changed.\n", > > + rx_idx); > > + eth_dev->intr_handle->efds[rx_idx] =3D vring.kickfd; > > } > > } > > > > -- > > 2.26.2 >=20 > Reviewed-by: Chenbo Xia Tested-by: Yinan Wang