Thread (23 messages) 23 messages, 4 authors, 2022-03-15

Re: [PATCH net-next v2 9/9] net: ethernet: mtk-star-emac: separate tx/rx handling with two NAPIs

From: Jakub Kicinski <kuba@kernel.org>
Date: 2022-03-14 15:57:13
Also in: linux-arm-kernel, linux-devicetree, linux-mediatek, lkml

On Mon, 14 Mar 2022 15:01:23 +0800 Biao Huang wrote:
quoted
Drivers are expected to stop their queues at the end of xmit routine
if
the ring can't accommodate another frame. It's more efficient to stop
the queues early than have to put skbs already dequeued from the
qdisc
layer back into the qdiscs.  
Yes, if descriptors ring is full, it's meaningful to stop the queue 
at the end of xmit; 
But driver seems hard to know how many descriptors the next skb will
request, e.g. 3 descriptors are available for next round send, but the
next skb may need 4 descriptors, in this case, we still need judge
whether descriptors are enough for skb transmission, then decide stop
the queue or not, at the beginning of xmit routine.

Maybe we should judge ring is full or not at the beginning and the end
of xmit routine(seems a little redundancy).
Assume the worst case scenario. You set the default ring size to 512,
skb can have at most MAX_SKB_FRAGS fragments (usually 17) so the max
number of descriptors should not be very high, hard to pre-compute,
or problematic compared to the total ring size.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help