From: Tetsuya Mukawa <mukawa@igel.co.jp>
To: dev@dpdk.org
Cc: ann.zhuangyanying@huawei.com
Subject: [dpdk-dev] [PATCH v2] vhost: Fix wrong handling of virtqueue array index
Date: Wed, 28 Oct 2015 11:59:39 +0900 [thread overview]
Message-ID: <1446001179-27443-1-git-send-email-mukawa@igel.co.jp> (raw)
The patch fixes wrong handling of virtqueue array index when
GET_VRING_BASE message comes.
---
lib/librte_vhost/vhost_user/virtio-net-user.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/lib/librte_vhost/vhost_user/virtio-net-user.c b/lib/librte_vhost/vhost_user/virtio-net-user.c
index a998ad8..d07452a 100644
--- a/lib/librte_vhost/vhost_user/virtio-net-user.c
+++ b/lib/librte_vhost/vhost_user/virtio-net-user.c
@@ -300,13 +300,9 @@ user_get_vring_base(struct vhost_device_ctx ctx,
* sent and only sent in vhost_vring_stop.
* TODO: cleanup the vring, it isn't usable since here.
*/
- if (dev->virtqueue[state->index + VIRTIO_RXQ]->kickfd >= 0) {
- close(dev->virtqueue[state->index + VIRTIO_RXQ]->kickfd);
- dev->virtqueue[state->index + VIRTIO_RXQ]->kickfd = -1;
- }
- if (dev->virtqueue[state->index + VIRTIO_TXQ]->kickfd >= 0) {
- close(dev->virtqueue[state->index + VIRTIO_TXQ]->kickfd);
- dev->virtqueue[state->index + VIRTIO_TXQ]->kickfd = -1;
+ if (dev->virtqueue[state->index]->kickfd >= 0) {
+ close(dev->virtqueue[state->index]->kickfd);
+ dev->virtqueue[state->index]->kickfd = -1;
}
return 0;
--
2.1.4
next reply other threads:[~2015-10-28 2:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-28 2:59 Tetsuya Mukawa [this message]
2015-10-28 3:35 ` Xie, Huawei
2015-10-28 3:45 ` Tetsuya Mukawa
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=1446001179-27443-1-git-send-email-mukawa@igel.co.jp \
--to=mukawa@igel.co.jp \
--cc=ann.zhuangyanying@huawei.com \
--cc=dev@dpdk.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).