From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ivan Dyukov Subject: Re: [PATCH] vhost: fix checking of device features Date: Thu, 29 Jun 2017 09:07:41 +0300 Message-ID: References: <1498653631-15307-1-git-send-email-i.dyukov@samsung.com> <3b44a715-612d-2ef7-aac2-15f74ac4aa07@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: i.maximets@samsung.com, heetae82.ahn@samsung.com, stable@dpdk.org To: Maxime Coquelin , yliu@fridaylinux.org, dev@dpdk.org Return-path: In-reply-to: <3b44a715-612d-2ef7-aac2-15f74ac4aa07@redhat.com> Content-language: en-GB List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 06/28/2017 03:54 PM, Maxime Coquelin wrote: > > > 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? I didn't see any breakages. It's just 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; >> > > > >