All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wanlong Gao <wanlong.gao@gmail.com>
To: Wang Sheng-Hui <shhuiw@gmail.com>
Cc: rusty@rustcorp.com.au, mst@redhat.com,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] virtio: fix size computation according to the definition of struct vring_used in vring_size
Date: Sat, 27 Aug 2011 10:49:59 +0800	[thread overview]
Message-ID: <1314413399.1913.1.camel@Allen> (raw)
In-Reply-To: <4E584365.1010806@gmail.com>

On Sat, 2011-08-27 at 09:07 +0800, Wang Sheng-Hui wrote:
> The patch is against 3.1-rc3.
> 
> struct vring_used has two __u16 fields plus array of struct vring_used_elem.
> Current vring_size counts the __u16 fields to 3. Fix it to 2 in the patch.
> 
> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
> ---
>  include/linux/virtio_ring.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
> index 4a32cb6..fcda152 100644
> --- a/include/linux/virtio_ring.h
> +++ b/include/linux/virtio_ring.h
> @@ -143,7 +143,7 @@ static inline unsigned vring_size(unsigned int num, unsigned long align)
>  {
>  	return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num)
>  		 + align - 1) & ~(align - 1))
> -		+ sizeof(__u16) * 3 + sizeof(struct vring_used_elem) * num;
> +		+ sizeof(__u16) * 2 + sizeof(struct vring_used_elem) * num;
>  }
>  
>  /* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */

Hi:
I'm not deep into it, but I think you can see this:
http://marc.info/?l=git-commits-head&m=130687915816130&w=2

Thanks
-Wanlong Gao


  reply	other threads:[~2011-08-27  2:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-27  1:07 [PATCH] virtio: fix size computation according to the definition of struct vring_used in vring_size Wang Sheng-Hui
2011-08-27  2:49 ` Wanlong Gao [this message]
2011-08-27  9:34   ` Wang Sheng-Hui
2011-08-27  9:52     ` Wang Sheng-Hui
2011-08-27  9:52     ` Wang Sheng-Hui
2011-08-28 11:31       ` Michael S. Tsirkin
2011-08-28 12:48         ` Wang Sheng-Hui
2011-08-28 12:48         ` Wang Sheng-Hui
2011-08-28 11:31       ` Michael S. Tsirkin
2011-08-29  2:53       ` Rusty Russell
2011-08-29  6:51         ` Wang Sheng-Hui
2011-08-29  6:51         ` Wang Sheng-Hui
2011-08-29  7:55         ` Wang Sheng-Hui
2011-08-30  0:12           ` Rusty Russell
2011-08-30  0:12           ` Rusty Russell
2011-08-29  7:55         ` Wang Sheng-Hui
2011-08-29  2:53       ` Rusty Russell
2011-08-27  9:34   ` Wang Sheng-Hui
2011-08-27  2:49 ` Wanlong Gao
  -- strict thread matches above, loose matches on Subject: below --
2011-08-27  1:07 Wang Sheng-Hui

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=1314413399.1913.1.camel@Allen \
    --to=wanlong.gao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=rusty@rustcorp.com.au \
    --cc=shhuiw@gmail.com \
    --cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.