lkml.org 
[lkml]   [2023]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH net] r8152: avoid the driver drops a lot of packets
Date
Paolo Abeni <pabeni@redhat.com>
> Sent: Tuesday, September 5, 2023 6:11 PM
[...]
> > - /* limit the skb numbers for rx_queue */
> > - if (unlikely(skb_queue_len(&tp->rx_queue) >=
> 1000))
> > - break;
> > -
>
> Dropping this check looks dangerous to me. What if pause frames are
> disabled on the other end or dropped? It looks like this would cause
> unlimited memory consumption?!?

When the driver stops submitting rx, the driver wouldn't get any packet
from the device after the previous urbs which have been submitted return.
That is, skb_queue_len(&tp->rx_queue) wouldn't increase any more until
the driver starts submitting rx again.

Now, the driver stops submitting rx when the skb_queue_len more than 256,
so the check becomes redundant. The skb_queue_len has been limited less
than 1000.

Besides, if the flow control is disabled, the packets may be dropped by
the hardware when the FIFO of the device is full, after the driver stops
submitting rx.

Best Regards,
Hayes

\
 
 \ /
  Last update: 2023-09-05 18:25    [W:0.095 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site