From: Xiao Wang <xiao.w.wang@intel.com>
To: maxime.coquelin@redhat.com
Cc: jianfeng.tan@intel.com, zhihong.wang@intel.com, dev@dpdk.org,
Xiao Wang <xiao.w.wang@intel.com>
Subject: [dpdk-dev] [PATCH] vhost: fix vDPA set features
Date: Wed, 25 Apr 2018 10:18:27 +0800 [thread overview]
Message-ID: <20180425021827.28240-1-xiao.w.wang@intel.com> (raw)
We should call set_features callback after setting features in virtio_net
structure, otherwise vDPA driver cannot get the right features.
Fixes: 07718b4f87aa ("vhost: adapt library for selective datapath")
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
lib/librte_vhost/vhost_user.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 90194bf09..7244e1c06 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -214,11 +214,6 @@ vhost_user_set_features(struct virtio_net *dev, uint64_t features)
dev->notify_ops->features_changed(dev->vid, features);
}
- did = dev->vdpa_dev_id;
- vdpa_dev = rte_vdpa_get_device(did);
- if (vdpa_dev && vdpa_dev->ops->set_features)
- vdpa_dev->ops->set_features(dev->vid);
-
dev->features = features;
if (dev->features &
((1 << VIRTIO_NET_F_MRG_RXBUF) | (1ULL << VIRTIO_F_VERSION_1))) {
@@ -252,6 +247,11 @@ vhost_user_set_features(struct virtio_net *dev, uint64_t features)
}
}
+ did = dev->vdpa_dev_id;
+ vdpa_dev = rte_vdpa_get_device(did);
+ if (vdpa_dev && vdpa_dev->ops->set_features)
+ vdpa_dev->ops->set_features(dev->vid);
+
return 0;
}
--
2.15.1
next reply other threads:[~2018-04-25 2:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 2:18 Xiao Wang [this message]
2018-04-26 5:51 ` Wang, Zhihong
2018-04-26 8:07 ` Maxime Coquelin
2018-04-27 14:54 ` Ferruh Yigit
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=20180425021827.28240-1-xiao.w.wang@intel.com \
--to=xiao.w.wang@intel.com \
--cc=dev@dpdk.org \
--cc=jianfeng.tan@intel.com \
--cc=maxime.coquelin@redhat.com \
--cc=zhihong.wang@intel.com \
/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).