r8169: add support for xmit_more
Delay update of hw tail descriptor if we know that another skb is going to be sent. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4a71d0548c
commit
0bec3b700d
@ -7049,6 +7049,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
|
|||||||
u32 status, len;
|
u32 status, len;
|
||||||
u32 opts[2];
|
u32 opts[2];
|
||||||
int frags;
|
int frags;
|
||||||
|
bool stop_queue;
|
||||||
|
|
||||||
if (unlikely(!TX_FRAGS_READY_FOR(tp, skb_shinfo(skb)->nr_frags))) {
|
if (unlikely(!TX_FRAGS_READY_FOR(tp, skb_shinfo(skb)->nr_frags))) {
|
||||||
netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n");
|
netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n");
|
||||||
@ -7105,11 +7106,16 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
|
|||||||
|
|
||||||
tp->cur_tx += frags + 1;
|
tp->cur_tx += frags + 1;
|
||||||
|
|
||||||
RTL_W8(TxPoll, NPQ);
|
stop_queue = !TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS);
|
||||||
|
|
||||||
mmiowb();
|
if (!skb->xmit_more || stop_queue ||
|
||||||
|
netif_xmit_stopped(netdev_get_tx_queue(dev, 0))) {
|
||||||
|
RTL_W8(TxPoll, NPQ);
|
||||||
|
|
||||||
if (!TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) {
|
mmiowb();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stop_queue) {
|
||||||
/* Avoid wrongly optimistic queue wake-up: rtl_tx thread must
|
/* Avoid wrongly optimistic queue wake-up: rtl_tx thread must
|
||||||
* not miss a ring update when it notices a stopped queue.
|
* not miss a ring update when it notices a stopped queue.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user