From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: [PATCH] vhost: fix MTU device feature check Date: Thu, 29 Jun 2017 09:58:10 +0200 Message-ID: <20170629075810.4225-1-maxime.coquelin@redhat.com> Cc: i.dyukov@samsung.com, jianfeng.tan@intel.com, stable@dpdk.org, Maxime Coquelin To: dev@dpdk.org, yliu@fridaylinux.org Return-path: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The MTU feature support check has to be done against MTU feature bit mask, and not bit position. Cc: stable@dpdk.org Fixes: 72e8543093df ("vhost: add API to get MTU value") Signed-off-by: Maxime Coquelin --- This is a follow-up of Ivan's patch, which made me check I didn't introduced same bug elsewhere. lib/librte_vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index 19c5a43..653152f 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; -- 2.9.4