All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: "Michael S. Tsirkin" <mst@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: netdev <netdev@vger.kernel.org>,
	Andy Lutomirski <luto@amacapital.net>,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()
Date: Tue, 14 Oct 2014 12:51:47 +1030	[thread overview]
Message-ID: <877g03crwk.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20140907072032.GA25143@redhat.com>

"Michael S. Tsirkin" <mst@redhat.com> writes:
> On Fri, Sep 05, 2014 at 12:40:50PM +0200, Paolo Bonzini wrote:
>> Il 03/09/2014 06:29, Rusty Russell ha scritto:
>> > +	sg_init_table(rq->sg, MAX_SKB_FRAGS + 2);
>> 
>> I think 2 is enough here.  That said...
>> 
>> >  	sg_set_buf(rq->sg, &hdr->hdr, sizeof hdr->hdr);
>> > -
>> >  	skb_to_sgvec(skb, rq->sg + 1, 0, skb->len);
>> >  
>> >  	err = virtqueue_add_inbuf(rq->vq, rq->sg, 2, skb, gfp);
>> 
>> ... skb_to_sgvec will already make the sg well formed, so the
>> sg_init_table is _almost_ redundant; it is only there to remove
>> intermediate end marks.  The block layer takes care to remove
>> them, but skb_to_sgvec doesn't.

sg_init_table is still needed if CONFIG_DEBUG_SG, so I don't
think it's worth it.

Thanks,
Rusty.

  reply	other threads:[~2014-10-14  2:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03  4:29 [PATCH 0/3] virtio: simplify virtio_ring Rusty Russell
2014-09-03  4:29 ` [PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*() Rusty Russell
2014-09-05 10:40   ` Paolo Bonzini
2014-09-07  7:20     ` Michael S. Tsirkin
2014-10-14  2:21       ` Rusty Russell [this message]
2014-09-03  4:29 ` Rusty Russell
2014-09-03  4:54   ` Andy Lutomirski
2014-09-03  4:54   ` Andy Lutomirski
2014-09-03 10:23   ` Jesper Dangaard Brouer
2014-09-03 10:23   ` Jesper Dangaard Brouer
2014-09-03  4:29 ` [PATCH 2/3] virtio_ring: assume sgs are always well-formed Rusty Russell
2014-09-03  4:29 ` Rusty Russell
2014-09-03  4:29 ` [PATCH 3/3] virtio_ring: unify direct/indirect code paths Rusty Russell
2014-09-04  1:59   ` Andy Lutomirski
2014-09-05  2:55     ` Rusty Russell
2014-09-05 10:55   ` Paolo Bonzini
2014-09-08 17:32     ` Andy Lutomirski
2014-09-05 21:27 ` [PATCH 0/3] virtio: simplify virtio_ring David Miller
2014-09-05 21:27 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2014-09-11  0:47 [PATCH 0/3] virtio_net/virtio_ring Rusty Russell
2014-09-11  0:47 ` [PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*() Rusty Russell
2014-09-12 21:54   ` David Miller
2014-09-13  5:40     ` Rusty Russell
2014-09-13 16:53       ` David Miller
2014-09-16  0:48         ` Rusty Russell

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=877g03crwk.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=luto@amacapital.net \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pbonzini@redhat.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.