From: Maxime Coquelin Date: Thu, 29 Jun 2017 07:58:10 +0000 (+0200) Subject: vhost: fix MTU device feature check X-Git-Tag: spdx-start~2709 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=02f62392ffcaf1617e0749fe3d6e0263c077ef79;p=dpdk.git vhost: fix MTU device feature check The MTU feature support check has to be done against MTU feature bit mask, and not bit position. Fixes: 72e8543093df ("vhost: add API to get MTU value") Cc: stable@dpdk.org Signed-off-by: Maxime Coquelin Reviewed-by: Jianfeng Tan Acked-by: Yuanhan Liu --- diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index 19c5a43a51..653152fc7d 100644 --- a/lib/librte_vhost/vhost.c +++ b/lib/librte_vhost/vhost.c @@ -272,7 +272,7 @@ rte_vhost_get_mtu(int vid, uint16_t *mtu) if (!(dev->flags & VIRTIO_DEV_READY)) return -EAGAIN; - if (!(dev->features & VIRTIO_NET_F_MTU)) + if (!(dev->features & (1ULL << VIRTIO_NET_F_MTU))) return -ENOTSUP; *mtu = dev->mtu;