From: Ivan Dyukov Date: Wed, 28 Jun 2017 12:40:31 +0000 (+0300) Subject: vhost: fix checking of device features X-Git-Tag: spdx-start~2710 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c665d9a231945181af0a6e6fbeae7f56657f964a;p=dpdk.git vhost: fix checking of device features To compare enabled features in current device we must use bit mask instead of bit position. Fixes: c843af3aa13e ("vhost: access header only if offloading is supported") Cc: stable@dpdk.org Signed-off-by: Ivan Dyukov Reviewed-by: Maxime Coquelin Acked-by: Yuanhan Liu --- diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 88b74f172c..a5f0eebaa8 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -615,9 +615,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;