[net,1/9] virtio-net: remove the warning before XDP linearizing
diff mbox series

Message ID 1482503852-12438-2-git-send-email-jasowang@redhat.com
State New, archived
Headers show
Series
  • several fixups for virtio-net XDP
Related show

Commit Message

Jason Wang Dec. 23, 2016, 2:37 p.m. UTC
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>
---
 drivers/net/virtio_net.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Daniel Borkmann Dec. 23, 2016, 7:31 p.m. UTC | #1
Hi Jason,

On 12/23/2016 03:37 PM, Jason Wang wrote:
> 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>
> ---
>   drivers/net/virtio_net.c | 8 +-------
>   1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 08327e0..1067253 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -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();

Could you also remove the bpf_warn_invalid_xdp_buffer(), which got added
just for this?

Thanks.

>   			/* linearize data for XDP */
>   			xdp_page = xdp_linearize_page(rq, num_buf,
>   						      page, offset, &len);
>
Jason Wang Dec. 27, 2016, 3:08 a.m. UTC | #2
On 2016年12月24日 03:31, Daniel Borkmann wrote:
> Hi Jason,
>
> On 12/23/2016 03:37 PM, Jason Wang wrote:
>> 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>
>> ---
>>   drivers/net/virtio_net.c | 8 +-------
>>   1 file changed, 1 insertion(+), 7 deletions(-)
>>
>> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
>> index 08327e0..1067253 100644
>> --- a/drivers/net/virtio_net.c
>> +++ b/drivers/net/virtio_net.c
>> @@ -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();
>
> Could you also remove the bpf_warn_invalid_xdp_buffer(), which got added
> just for this?
>
> Thanks. 

Posted.

Thanks

Patch
diff mbox series

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 08327e0..1067253 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -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);