Re: [PATCH net-next 2/4] atl1c: improve performance by avoiding unnecessary pcie writes on xmit

From: Gatis Peisenieks
Date: Wed May 12 2021 - 03:54:02 EST




On 2021-05-12 00:39, Eric Dumazet wrote:
@@ -2270,8 +2272,11 @@ static netdev_tx_t atl1c_xmit_frame(struct sk_buff *skb,
atl1c_tx_rollback(adapter, tpd, type);
dev_kfree_skb_any(skb);
} else {
- netdev_sent_queue(adapter->netdev, skb->len);
- atl1c_tx_queue(adapter, skb, tpd, type);
+ bool more = netdev_xmit_more();
+
+ __netdev_sent_queue(adapter->netdev, skb->len, more);


This is probably buggy.

You must check and use the return code of this function,
as in :

bool door_bell = __netdev_sent_queue(adapter->netdev, skb->len,
netdev_xmit_more());

if (door_bell)
atl1c_tx_queue(adapter, type);


Eric, thank you for taking your time to look at this!

You are correct, tx queue can get stopped in __netdev_sent_queue
and if there were more packets coming the submit to HW would be
missed / unnecessarily delayed.



+ if (!more)
+ atl1c_tx_queue(adapter, type);
}

return NETDEV_TX_OK;