Re: [PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()

2014-10-14 Thread Rusty Russell
Michael S. Tsirkin m...@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); -

Re: [PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()

2014-09-07 Thread Michael S. Tsirkin
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,

Re: [PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()

2014-09-05 Thread Paolo Bonzini
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,

Re: [PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()

2014-09-05 Thread Jesper Dangaard Brouer
On Wed, 3 Sep 2014 13:59:14 +0930 Rusty Russell ru...@rustcorp.com.au wrote: pktgen results: modprobe pktgen echo 'add_device eth0' /proc/net/pktgen/kpktgend_0 echo nowait 1 /proc/net/pktgen/eth0 Maybe your pktgen nowait (patch) should be a flag instead? echo flag

[PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()

2014-09-02 Thread Rusty Russell
This is the only driver which doesn't hand virtqueue_add_inbuf and virtqueue_add_outbuf a well-formed, well-terminated sg. Fix it, so we can make virtio_add_* simpler. pktgen results: modprobe pktgen echo 'add_device eth0' /proc/net/pktgen/kpktgend_0 echo nowait 1

Re: [PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()

2014-09-02 Thread Andy Lutomirski
On Tue, Sep 2, 2014 at 9:29 PM, Rusty Russell ru...@rustcorp.com.au wrote: This is the only driver which doesn't hand virtqueue_add_inbuf and virtqueue_add_outbuf a well-formed, well-terminated sg. Fix it, so we can make virtio_add_* simpler. OK, I get it now: you're reinitializing the table