DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
To: "Xie, Huawei" <huawei.xie@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] virtio: fix used ring address calculation
Date: Mon, 21 Sep 2015 09:19:19 +0000	[thread overview]
Message-ID: <ED26CBA2FAD1BF48A8719AEF02201E365C801B@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1442806742-32547-1-git-send-email-huawei.xie@intel.com>



-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Huawei Xie
Sent: Monday, September 21, 2015 11:39 AM
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] virtio: fix used ring address calculation

used event idx is put at the end of available ring. It isn't taken into account when we calculate the address of used ring. Fortunately, it doesn't introduce the bug with fixed queue number 256 and 4KB alignment.

Signed-off-by: hxie5 <huawei.xie@intel.com>
---
 drivers/net/virtio/virtio_ring.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_ring.h b/drivers/net/virtio/virtio_ring.h
index a16c499..92e430d 100644
--- a/drivers/net/virtio/virtio_ring.h
+++ b/drivers/net/virtio/virtio_ring.h
@@ -145,7 +145,7 @@ vring_init(struct vring *vr, unsigned int num, uint8_t *p,
 	vr->avail = (struct vring_avail *) (p +
 		num * sizeof(struct vring_desc));
 	vr->used = (void *)
-		RTE_ALIGN_CEIL((uintptr_t)(&vr->avail->ring[num]), align);
+		RTE_ALIGN_CEIL((uintptr_t)(&vr->avail->ring[num + 1]), align);
 }
 
 /*
--

Acked-by: Jianfeng Tan <Jianfeng.tan@intel.com>

1.9.3

  reply	other threads:[~2015-09-21  9:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-21  3:39 Huawei Xie
2015-09-21  9:19 ` Tan, Jianfeng [this message]
2015-09-24  7:30 ` Xie, Huawei
2015-09-24 16:36   ` Stephen Hemminger
2015-09-24 18:35     ` Xie, Huawei
2015-09-24 21:01       ` Stephen Hemminger
2015-09-25 15:46         ` Xie, Huawei
2015-09-25 17:48           ` Stephen Hemminger

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=ED26CBA2FAD1BF48A8719AEF02201E365C801B@SHSMSX103.ccr.corp.intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=dev@dpdk.org \
    --cc=huawei.xie@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).