DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: dev@dpdk.org, yliu@fridaylinux.org
Cc: i.dyukov@samsung.com, jianfeng.tan@intel.com, stable@dpdk.org,
	Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: [dpdk-dev] [PATCH] vhost: fix MTU device feature check
Date: Thu, 29 Jun 2017 09:58:10 +0200	[thread overview]
Message-ID: <20170629075810.4225-1-maxime.coquelin@redhat.com> (raw)

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 <maxime.coquelin@redhat.com>
---

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

             reply	other threads:[~2017-06-29  7:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29  7:58 Maxime Coquelin [this message]
2017-06-29  8:01 ` Tan, Jianfeng
2017-07-01 23:36   ` Yuanhan Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170629075810.4225-1-maxime.coquelin@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=i.dyukov@samsung.com \
    --cc=jianfeng.tan@intel.com \
    --cc=stable@dpdk.org \
    --cc=yliu@fridaylinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).