From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 544BB8DB5 for ; Wed, 9 May 2018 04:58:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 May 2018 19:58:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,379,1520924400"; d="scan'208";a="44346115" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 08 May 2018 19:58:07 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 8 May 2018 19:58:07 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 8 May 2018 19:58:07 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.40]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.240]) with mapi id 14.03.0319.002; Wed, 9 May 2018 10:58:05 +0800 From: "Yao, Lei A" To: "Hu, Jiayu" , "dev@dpdk.org" CC: "Bie, Tiwei" , "Yang, Zhiyong" , "maxime.coquelin@redhat.com" Thread-Topic: [PATCH v2] net/virtio-user: fix feature setting with vhost-net backend Thread-Index: AQHT5qOsS5JocOUuqEGg5XHIPa0QeaQmtU6g Date: Wed, 9 May 2018 02:58:04 +0000 Message-ID: <2DBBFF226F7CF64BAFCA79B681719D953A43E809@SHSMSX101.ccr.corp.intel.com> References: <1525675806-22387-1-git-send-email-jiayu.hu@intel.com> <1525767284-130484-1-git-send-email-jiayu.hu@intel.com> In-Reply-To: <1525767284-130484-1-git-send-email-jiayu.hu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMmNjOTRkNDItYjM5OS00MGU1LWIwODAtNThjZGQxM2IwNDA1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjBmNVhGZkxLaHo2emVtQkFNNWdjd0tNSHhHQ3NMK21LNVN6UUo5QnVSOFE9In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] net/virtio-user: fix feature setting with vhost-net backend 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: , X-List-Received-Date: Wed, 09 May 2018 02:58:09 -0000 > -----Original Message----- > From: Hu, Jiayu > Sent: Tuesday, May 8, 2018 4:15 PM > To: dev@dpdk.org > Cc: Bie, Tiwei ; Yang, Zhiyong > ; maxime.coquelin@redhat.com; Yao, Lei A > ; Hu, Jiayu > Subject: [PATCH v2] net/virtio-user: fix feature setting with vhost-net > backend >=20 > When the backend is vhost-net, virtio-user must work in client mode and > needs to request features from the backend in virtio_user_dev_init(). > But currently, virtio-user is assigned to default features in this case. >=20 > This patch is to fix this inappropriate feature setting. >=20 > Fixes: bd8f50a45d0f ("net/virtio-user: support server mode") > Signed-off-by: Jiayu Hu Tested-by: Lei Yao Tested this patch based on 18.05-rc2. This patch fixed the vhost-net kernel backend issue with DPDK.=20 Basic test with virtio-user server mode is also pass.=20 > --- > changes in v2: > - remove unnecessary indent change. > - change commit log. >=20 > drivers/net/virtio/virtio_user/virtio_user_dev.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c > b/drivers/net/virtio/virtio_user/virtio_user_dev.c > index 38b8bc9..2d80188 100644 > --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c > +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c > @@ -353,7 +353,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, > char *path, int queues, > return -1; > } >=20 > - if (dev->vhostfd >=3D 0) { > + if (!dev->is_server) { > if (dev->ops->send_request(dev, > VHOST_USER_SET_OWNER, > NULL) < 0) { > PMD_INIT_LOG(ERR, "set_owner fails: %s", > @@ -367,6 +367,8 @@ virtio_user_dev_init(struct virtio_user_dev *dev, > char *path, int queues, > strerror(errno)); > return -1; > } > + if (dev->mac_specified) > + dev->device_features |=3D (1ull << > VIRTIO_NET_F_MAC); > } else { > /* We just pretend vhost-user can support all these features. > * Note that this could be problematic that if some feature is > @@ -376,9 +378,6 @@ virtio_user_dev_init(struct virtio_user_dev *dev, > char *path, int queues, > dev->device_features =3D > VIRTIO_USER_SUPPORTED_FEATURES; > } >=20 > - if (dev->mac_specified) > - dev->device_features |=3D (1ull << VIRTIO_NET_F_MAC); > - > if (cq) { > /* device does not really need to know anything about CQ, > * so if necessary, we just claim to support CQ > -- > 2.7.4