From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 67FBC2C13; Wed, 28 Jun 2017 14:54:48 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8CAC761D22; Wed, 28 Jun 2017 12:54:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8CAC761D22 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=maxime.coquelin@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8CAC761D22 Received: from [10.36.112.58] (ovpn-112-58.ams2.redhat.com [10.36.112.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C903F1822F; Wed, 28 Jun 2017 12:54:45 +0000 (UTC) To: Ivan Dyukov , yliu@fridaylinux.org, dev@dpdk.org Cc: i.maximets@samsung.com, heetae82.ahn@samsung.com, stable@dpdk.org References: <1498653631-15307-1-git-send-email-i.dyukov@samsung.com> From: Maxime Coquelin Message-ID: <3b44a715-612d-2ef7-aac2-15f74ac4aa07@redhat.com> Date: Wed, 28 Jun 2017 14:54:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <1498653631-15307-1-git-send-email-i.dyukov@samsung.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 28 Jun 2017 12:54:47 +0000 (UTC) Subject: Re: [dpdk-stable] [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: Wed, 28 Jun 2017 12:54:48 -0000 On 06/28/2017 02:40 PM, Ivan Dyukov wrote: > To compare enabled features in current device we must use bit > mask instead of bit position. > > CC: stable@dpdk.org > Fixes: c843af3aa13e ("vhost: access header only") > > Signed-off-by: Ivan Dyukov > --- > lib/librte_vhost/virtio_net.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) Thanks for the fix Ivan, and sorry for introducing this bug. Out of curiosity, did you noticed it because it broke offloading, or just by code review? Reviewed-by: Maxime Coquelin > 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))) > return true; > > return false; >