Re: [RFC PATCH 1/2] net: Add new network device function to allow for MMIO batching
From: Eric Dumazet <hidden>
Date: 2012-07-13 16:18:38
On Fri, 2012-07-13 at 08:49 -0700, Alexander Duyck wrote:
On 07/13/2012 12:19 AM, Eric Dumazet wrote:quoted
On Wed, 2012-07-11 at 17:26 -0700, Alexander Duyck wrote:quoted
+static inline void netdev_complete_xmit(struct netdev_queue *txq) +{ + struct net_device *dev = txq->dev; + const struct net_device_ops *ops = dev->netdev_ops; + + if (txq->dispatch_pending < txq->dispatch_limit) { + if (netif_tx_queue_delayed(txq)) { + txq->dispatch_pending++; + return; + } + + /* start of delayed write sequence */ + netif_tx_delay_queue(txq);I dont understand this part. Isnt a return missing here ?quoted
+ } + + txq->dispatch_pending = 0; + + ops->ndo_complete_xmit(dev, txq - &dev->_tx[0]); +} +There is intentionally no return there. The idea is that the first packet always gets through. It is what is going to later force the interrupt that will force the final flush if it is needed. That is one of the ways I am helping to reduce the latency of things such as TSO which will only be using one or two frames per interrupt anyway.
So for a single packet, we only trigger TX softirq do do nothing at all, or worse the ndo_complete_xmit() is done twice ? It looks like you need to add comments, because if I dont understand this code, who will ?