From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 871962B96; Thu, 29 Jun 2017 08:13:32 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2017 23:13:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,279,1496127600"; d="scan'208";a="104992125" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga002.jf.intel.com with ESMTP; 28 Jun 2017 23:13:30 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 28 Jun 2017 23:13:30 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 28 Jun 2017 23:13:30 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.122]) with mapi id 14.03.0319.002; Thu, 29 Jun 2017 14:13:28 +0800 From: "Tan, Jianfeng" To: Ivan Dyukov , "yliu@fridaylinux.org" , "maxime.coquelin@redhat.com" , "dev@dpdk.org" CC: "i.maximets@samsung.com" , "heetae82.ahn@samsung.com" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] vhost: fix checking of device features Thread-Index: AQHS8AvWZUSl23fzqkOAKAFKoMKFfKI7XPqQ Date: Thu, 29 Jun 2017 06:13:28 +0000 Message-ID: References: <1498653631-15307-1-git-send-email-i.dyukov@samsung.com> In-Reply-To: <1498653631-15307-1-git-send-email-i.dyukov@samsung.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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-stable] [dpdk-dev] [PATCH] vhost: fix checking of device features X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 06:13:33 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ivan Dyukov > Sent: Wednesday, June 28, 2017 8:41 PM > To: yliu@fridaylinux.org; maxime.coquelin@redhat.com; dev@dpdk.org > Cc: i.maximets@samsung.com; heetae82.ahn@samsung.com; Ivan Dyukov; > stable@dpdk.org > Subject: [dpdk-dev] [PATCH] vhost: fix checking of device features >=20 > To compare enabled features in current device we must use bit > mask instead of bit position. >=20 > CC: stable@dpdk.org > Fixes: c843af3aa13e ("vhost: access header only") >=20 > Signed-off-by: Ivan Dyukov > --- > lib/librte_vhost/virtio_net.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) >=20 > diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.= c > index ebfda1c..4fae4c1 100644 > --- a/lib/librte_vhost/virtio_net.c > +++ b/lib/librte_vhost/virtio_net.c > @@ -601,9 +601,11 @@ static inline bool > virtio_net_with_host_offload(struct virtio_net *dev) > { > if (dev->features & > - (VIRTIO_NET_F_CSUM | VIRTIO_NET_F_HOST_ECN | > - VIRTIO_NET_F_HOST_TSO4 | > VIRTIO_NET_F_HOST_TSO6 | > - VIRTIO_NET_F_HOST_UFO)) > + ((1ULL << VIRTIO_NET_F_CSUM) | > + (1ULL << VIRTIO_NET_F_HOST_ECN) | > + (1ULL << VIRTIO_NET_F_HOST_TSO4) | > + (1ULL << VIRTIO_NET_F_HOST_TSO6) | > + (1ULL << VIRTIO_NET_F_HOST_UFO))) Another problem in this piece of code, we don't support VIRTIO_NET_F_HOST_E= CN and VIRTIO_NET_F_HOST_UFO in vhost-user. We might consider to remove tho= se two lines? Thanks, Jianfeng > return true; >=20 > return false; > -- > 2.7.4