Skip to content

Commit

Permalink
virtio-net: remove the warning before XDP linearizing
Browse files Browse the repository at this point in the history
Since we use EWMA to estimate the size of rx buffer. When rx buffer
size is underestimated, it's usual to have a packet with more than one
buffers. Consider this is not a bug, remove the warning and correct
the comment before XDP linearizing.

Cc: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jason Wang authored and David S. Miller committed Dec 23, 2016
1 parent d3a51d6 commit 73b62bd
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,14 +552,8 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
struct page *xdp_page;
u32 act;

/* No known backend devices should send packets with
* more than a single buffer when XDP conditions are
* met. However it is not strictly illegal so the case
* is handled as an exception and a warning is thrown.
*/
/* This happens when rx buffer size is underestimated */
if (unlikely(num_buf > 1)) {
bpf_warn_invalid_xdp_buffer();

/* linearize data for XDP */
xdp_page = xdp_linearize_page(rq, num_buf,
page, offset, &len);
Expand Down

0 comments on commit 73b62bd

Please sign in to comment.