Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1549428
| From | John Fastabend <john.fastabend@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH net 9/9] virtio-net: XDP support for small buffers |
| Date | 2017-01-02 23:50 +0100 |
| Message-ID | <sVjAt-5dr-15@gated-at.bofh.it> (permalink) |
| References | <sRzaN-833-3@gated-at.bofh.it> <sRzku-86G-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 16-12-23 06:37 AM, Jason Wang wrote:
> Commit f600b6905015 ("virtio_net: Add XDP support") leaves the case of
> small receive buffer untouched. This will confuse the user who want to
> set XDP but use small buffers. Other than forbid XDP in small buffer
> mode, let's make it work. XDP then can only work at skb->data since
> virtio-net create skbs during refill, this is sub optimal which could
> be optimized in the future.
>
> Cc: John Fastabend <john.r.fastabend@intel.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> drivers/net/virtio_net.c | 112 ++++++++++++++++++++++++++++++++++++-----------
> 1 file changed, 87 insertions(+), 25 deletions(-)
>
Hi Jason,
I was doing some more testing on this what do you think about doing this
so that free_unused_bufs() handles the buffer free with dev_kfree_skb()
instead of put_page in small receive mode. Seems more correct to me.
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 783e842..27ff76c 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1898,6 +1898,10 @@ static void free_receive_page_frags(struct virtnet_info *vi)
static bool is_xdp_queue(struct virtnet_info *vi, int q)
{
+ /* For small receive mode always use kfree_skb variants */
+ if (!vi->mergeable_rx_bufs)
+ return false;
+
if (q < (vi->curr_queue_pairs - vi->xdp_queue_pairs))
return false;
else if (q < vi->curr_queue_pairs)
patch is untested just spotted doing code review.
Thanks,
John
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH net 0/9] several fixups for virtio-net XDP Jason Wang <jasowang@redhat.com> - 2016-12-23 15:40 +0100
[PATCH net 4/9] virtio-net: correctly handle XDP_PASS for linearized packets Jason Wang <jasowang@redhat.com> - 2016-12-23 15:40 +0100
Re: [PATCH net 4/9] virtio-net: correctly handle XDP_PASS for linearized packets John Fastabend <john.fastabend@gmail.com> - 2016-12-23 17:00 +0100
Re: [PATCH net 4/9] virtio-net: correctly handle XDP_PASS for linearized packets Jason Wang <jasowang@redhat.com> - 2016-12-26 03:40 +0100
[PATCH net 2/9] virtio-net: correctly xmit linearized page on XDP_TX Jason Wang <jasowang@redhat.com> - 2016-12-23 15:40 +0100
Re: [PATCH net 2/9] virtio-net: correctly xmit linearized page on XDP_TX John Fastabend <john.fastabend@gmail.com> - 2016-12-23 16:50 +0100
[PATCH net 8/9] virtio-net: remove big packet XDP codes Jason Wang <jasowang@redhat.com> - 2016-12-23 15:40 +0100
[PATCH net 9/9] virtio-net: XDP support for small buffers Jason Wang <jasowang@redhat.com> - 2016-12-23 15:50 +0100
Re: [PATCH net 9/9] virtio-net: XDP support for small buffers John Fastabend <john.fastabend@gmail.com> - 2016-12-23 18:00 +0100
Re: [PATCH net 9/9] virtio-net: XDP support for small buffers John Fastabend <john.fastabend@gmail.com> - 2017-01-02 23:50 +0100
Re: [PATCH net 9/9] virtio-net: XDP support for small buffers Jason Wang <jasowang@redhat.com> - 2017-01-03 07:20 +0100
Re: [PATCH net 9/9] virtio-net: XDP support for small buffers John Fastabend <john.fastabend@gmail.com> - 2017-01-03 17:50 +0100
[PATCH net 5/9] virtio-net: unbreak csumed packets for XDP_PASS Jason Wang <jasowang@redhat.com> - 2016-12-23 15:50 +0100
Re: [PATCH net 5/9] virtio-net: unbreak csumed packets for XDP_PASS John Fastabend <john.fastabend@gmail.com> - 2016-12-23 17:00 +0100
Re: [PATCH net 0/9] several fixups for virtio-net XDP John Fastabend <john.fastabend@gmail.com> - 2016-12-23 18:20 +0100
Re: [PATCH net 0/9] several fixups for virtio-net XDP Jason Wang <jasowang@redhat.com> - 2016-12-26 03:40 +0100
Re: [PATCH net 0/9] several fixups for virtio-net XDP David Miller <davem@davemloft.net> - 2016-12-23 19:50 +0100
csiph-web