Re: [PATCH 3/5] virtio_net: Add XDP support

2016-11-18 Thread John Fastabend
On 16-11-18 03:21 PM, Eric Dumazet wrote: > On Fri, 2016-11-18 at 11:00 -0800, John Fastabend wrote: > > >> static void free_receive_bufs(struct virtnet_info *vi) >> { >> +struct bpf_prog *old_prog; >> int i; >> >> for (i = 0; i < vi->max_queue_pairs; i++) { >>

Re: [PATCH 3/5] virtio_net: Add XDP support

2016-11-18 Thread John Fastabend
On 16-11-18 03:23 PM, Eric Dumazet wrote: > On Fri, 2016-11-18 at 11:00 -0800, John Fastabend wrote: >> From: Shrijeet Mukherjee > > >> #include >> @@ -81,6 +82,8 @@ struct receive_queue { >> >> struct napi_struct napi; >> >> +struct bpf_prog *xdp_prog; > >

Re: [PATCH 3/5] virtio_net: Add XDP support

2016-11-18 Thread Eric Dumazet
On Fri, 2016-11-18 at 11:00 -0800, John Fastabend wrote: > From: Shrijeet Mukherjee > #include > @@ -81,6 +82,8 @@ struct receive_queue { > > struct napi_struct napi; > > + struct bpf_prog *xdp_prog; Please add proper sparse annotation, as in

Re: [PATCH 3/5] virtio_net: Add XDP support

2016-11-18 Thread Eric Dumazet
On Fri, 2016-11-18 at 11:00 -0800, John Fastabend wrote: > static void free_receive_bufs(struct virtnet_info *vi) > { > + struct bpf_prog *old_prog; > int i; > > for (i = 0; i < vi->max_queue_pairs; i++) { > while (vi->rq[i].pages) >

[PATCH 3/5] virtio_net: Add XDP support

2016-11-18 Thread John Fastabend
From: Shrijeet Mukherjee This adds XDP support to virtio_net. Some requirements must be met for XDP to be enabled depending on the mode. First it will only be supported with LRO disabled so that data is not pushed across multiple buffers. The MTU must be less than a page size