RE: [PATCH net v4 3/4] r8152: support stopping/waking tx queue

2013-11-19 Thread hayeswang
David Miller [mailto:da...@davemloft.net] [...] > > If the situation occurs, it means there is no tx buffer at > that time. If the > > netif_wake_queue() is called, only one more packet would be > queued and the tx > > queue would be stopped again after calling > rtl8152_start_xmit(). That is,

Re: [PATCH net v4 3/4] r8152: support stopping/waking tx queue

2013-11-19 Thread David Miller
From: hayeswang Date: Wed, 20 Nov 2013 11:28:46 +0800 > David Miller [mailto:da...@davemloft.net] > [...] >> This is racy. >> >> You have nothing which synchronizes r8152_tx_agg_fill() and >> rtl8152_start_xmit(), >> therefore: >> >> > + if (netif_queue_stopped(tp->netdev)) >> > +

RE: [PATCH net v4 3/4] r8152: support stopping/waking tx queue

2013-11-19 Thread hayeswang
David Miller [mailto:da...@davemloft.net] [...] > This is racy. > > You have nothing which synchronizes r8152_tx_agg_fill() and > rtl8152_start_xmit(), > therefore: > > > + if (netif_queue_stopped(tp->netdev)) > > + netif_wake_queue(tp->netdev); > > + > > A netif_stop_queue() can

Re: [PATCH net v4 3/4] r8152: support stopping/waking tx queue

2013-11-19 Thread David Miller
From: Hayes Wang Date: Tue, 19 Nov 2013 11:25:10 +0800 > The maximum packet number which a tx aggregation buffer could contain > is the buffer size / (packet size + descriptor size). > > If the tx buffer is empty and the tx queue length is more than the > maximum value which is defined above, st

[PATCH net v4 3/4] r8152: support stopping/waking tx queue

2013-11-18 Thread Hayes Wang
The maximum packet number which a tx aggregation buffer could contain is the buffer size / (packet size + descriptor size). If the tx buffer is empty and the tx queue length is more than the maximum value which is defined above, stop the tx queue. Wake the tx queue after any queued packet is fille