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 D1032A04F2; Sun, 7 Jun 2020 12:38:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 58AA91C002; Sun, 7 Jun 2020 12:38:04 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70073.outbound.protection.outlook.com [40.107.7.73]) by dpdk.org (Postfix) with ESMTP id CEAE01BF83 for ; Sun, 7 Jun 2020 12:38:02 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dsWKBLx9HVyJ71oYS2XcsPDqqAJGAODUkPEdkqPA5Lxc0d3C61c+ydOkRYBMh+JyJETmIdmLnP0yleg6xZondgIQfnXb2+Oq2c4xVuX2kdwBdgceWvlZQ/E+jQqrEoO0/QPO8F0VhbVK0FU7e1pefLumr2PDn50JklcUlquD1VPm3YILIrPtJfbVPgpxY3WBe4nxpudBv7WNBVw3dbfBMxnu8pXu5DBJW1UHyUi4TpvDnVtRC72IYRkEiDsav7B9xoF0vS4be6ASLtoPy/hOJrpIzMyCtNUK7Ip0OecfCxTf8CFKwcNuLESc/s9qaHXDrqCUow0Mlyf0C5/NUcyc4g== 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=P+O43Pb6L8nvMFP22odANr0caimVtt3EUPw000BIotM=; b=T8F3RuFy/C/UyCt6kDT1JPPnX7R83u7louOgPStXJV9hMOsymZBaAXIRgvEHFMYmncvgsfETDL52MkdtIQYLrlPsUiVkFXkDWqMvcMuJKD7KMhirkc76TsnXJeSmnK2cMPxl+A6e+x5/pdbMbvmuIyUPip4aftG7/7/hwFDLA3waUUbrDpfa5kXPuMm2RDt+VKMHd8Mcfvcl4cFOKR0gp4CivxJQHv0xFnlzvzUvfntvND5qTdmlcJ8Pk2Zd4W21PJ4t0sL01kRei6plPW+FtEAbFFysWOrZRbqdd2Ku3msjtvtYrHihF6R4KnaGwsTDimi5o/NJbmSIB7bWbjOvTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P+O43Pb6L8nvMFP22odANr0caimVtt3EUPw000BIotM=; b=tdKmvzCijkLUfltxIk5kXuTVp0ZJM9T5MXC1JjnvTLoUV4Yio27RCvKdcQ2Pt0vs9pQ0lavyetzH3B0b85shPkP8UZHhIaFlIbN2kszeMkfELbTB9MTNXe75ifMjlpH7jQ/sM8a/faQ9pIBYksRqMasQ+INAHqAuygE6DoJUPGg= Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com (2603:10a6:208:f::11) by AM0PR0502MB3905.eurprd05.prod.outlook.com (2603:10a6:208:1b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.23; Sun, 7 Jun 2020 10:38:01 +0000 Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::b189:d782:4c74:7998]) by AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::b189:d782:4c74:7998%7]) with mapi id 15.20.3066.023; Sun, 7 Jun 2020 10:38:01 +0000 From: Matan Azrad To: Maxime Coquelin , "xiaolong.ye@intel.com" , Shahaf Shuler , "amorenoz@redhat.com" , "xiao.w.wang@intel.com" , Slava Ovsiienko , "dev@dpdk.org" CC: "jasowang@redhat.com" , "lulu@redhat.com" Thread-Topic: [PATCH 9/9] vhost: only use vDPA config workaround if needed Thread-Index: AQHWKcYg67JP6PpHo0+Nx4qLJ7aEAqjNF8jQ Date: Sun, 7 Jun 2020 10:38:01 +0000 Message-ID: References: <20200514080218.1435344-1-maxime.coquelin@redhat.com> <20200514080218.1435344-10-maxime.coquelin@redhat.com> In-Reply-To: <20200514080218.1435344-10-maxime.coquelin@redhat.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [87.68.154.208] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 616173b0-56fa-42f9-3e76-08d80aceda17 x-ms-traffictypediagnostic: AM0PR0502MB3905: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 04270EF89C x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pL53aM+Qtogf5XPj6UlRpVhYpXippX+d8A4M0NZUaJL0EGR7ejNFiMrA9G0uIh0pdY/ldoJUY0TLqJuEBBqbZ37TUDZeoFO2w58zKJDXxJQeo/gICo1tPjwBKomPP41WlYDbOe30iU2qjqL7sRVHJjcyXAknfDXVkuUX603yd84VRWfqot7LTTnGyNKX9XXHnCpqnhVfVZEFtM8TVcs+Grb8Y1VDcDXJZndMBgigjk5ezn9KFNuIBcY5YopY9ScpJNpJMngkZ8gTfh5+vyelUsOBoIFl2JeozoRNg0xUdZSvVdWg+QBlL8f9UtsDzGMDexz9tJLUVlGVFZPL1mS2Fw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR0502MB4019.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(376002)(346002)(396003)(366004)(4326008)(6506007)(316002)(52536014)(86362001)(66946007)(64756008)(66556008)(66476007)(66446008)(76116006)(33656002)(55016002)(7696005)(8936002)(478600001)(26005)(83380400001)(71200400001)(54906003)(8676002)(5660300002)(186003)(2906002)(110136005)(9686003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: bPKl56tuQ/5M64XSEFMDYP/XLk3bGg6iGmyvJx3HF8kcQD+TJMzTLvdTEfe7Ya7figNFCzc7sZbByfgYB3AhCCCALQ8o4/WvqJ+smNdUX5zaEH35JKFroASOmu2tJOKNOAb0WM1BZQa8Oa+ocGIA8Gm+WlzSOYCnLw/Hh9Ib8KYiszpgT1Iw/HXVbe2zUvKeN50gC3fQptsXeSfCqtDcB1tXKErTZpJhqlqt1JIpr/x6R8ysiNKPOQ2v2U0CruVRZ0gnI8/myVA12bXb9tbYJiHIuGc0vjJJWDkSu32f8rYDBWeDCZp8YwQcCCfP+PrE91mAFQ9m8Ip8aDm3MFHLQ7PB55gdvZoaxCQaGywrVr4EJGh7R+mDlH4iMcONsmQZ1SX8dzXNuOjoNYtKUsF1JDLKX0trp1WqrFPxl/44NmPcaY2PitCisL/kmVV2GkW9z1RNRjEK1LHBYEqyjN2Uj2oKGJOcFGXHqSpkZ7aoCyU= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 616173b0-56fa-42f9-3e76-08d80aceda17 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jun 2020 10:38:01.0252 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: KPcU1u14tKmGzec3KYZpn1Asdx652YrhdYVIcIF0DDT6gxxZHW6HqpcfQRQN0B7sPfLMo8ysvs2YnP8oMP2jTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3905 Subject: Re: [dpdk-dev] [PATCH 9/9] vhost: only use vDPA config workaround if needed 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" Hi Maxime Thanks for the huge work. Please see a suggestion inline. From: Maxime Coquelin: > Sent: Thursday, May 14, 2020 11:02 AM > To: xiaolong.ye@intel.com; Shahaf Shuler ; Matan > Azrad ; amorenoz@redhat.com; > xiao.w.wang@intel.com; Slava Ovsiienko ; > dev@dpdk.org > Cc: jasowang@redhat.com; lulu@redhat.com; Maxime Coquelin > > Subject: [PATCH 9/9] vhost: only use vDPA config workaround if needed >=20 > Now that we have Virtio device status support, let's only use the vDPA > workaround if it is not supported. >=20 > This patch also document why Virtio device status protocol feature suppor= t is > strongly advised. >=20 > Signed-off-by: Maxime Coquelin > --- > lib/librte_vhost/vhost_user.c | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) >=20 > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.= c > index e5a44be58d..67e96a872a 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -2847,8 +2847,20 @@ vhost_user_msg_handler(int vid, int fd) > if (!vdpa_dev) > goto out; >=20 > - if (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED) && > - request =3D=3D VHOST_USER_SET_VRING_CALL) { > + if (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED)) { > + /* > + * Workaround when Virtio device status protocol > + * feature is not supported, wait for SET_VRING_CALL > + * request. This is not ideal as some frontends like > + * Virtio-user may not send this request, so vDPA device > + * may never be configured. Virtio device status support > + * on frontend side is strongly advised. > + */ > + if (!(dev->protocol_features & > + (1ULL << > VHOST_USER_PROTOCOL_F_STATUS)) && > + (request !=3D > VHOST_USER_SET_VRING_CALL)) > + goto out; > + When status protocol feature is not supported, in the current code, the vDP= A configuration triggering depends in: 1. Device is ready - all the queues are configured (datapath addresses, cal= lfd and kickfd) . 2. last command is callfd. The code doesn't take into account that some queues may stay disabled. Maybe the correct timing is: 1. Device is ready - all the enabled queues are configured and MEM table is= configured. 2. no need callfd to be last. Queues that will be configured later will be configured to the HW when the = virtq becoming enabled. What do think?=20 > if (vdpa_dev->ops->dev_conf(dev->vid)) > VHOST_LOG_CONFIG(ERR, > "Failed to configure vDPA device\n"); > -- > 2.25.4