mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
net: bcmgenet: complete Tx NAPI after one reclaim pass
After reclaiming, the Tx poll asks to be polled again. That extra poll finds nothing to do and does not reduce the interrupt rate. Complete the NAPI and unmask the ring interrupt right after the reclaim. On a CM4 this raises 60 byte pktgen Tx from about 187k to 224k pps and saves about 5% of one core at TCP line rate. Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20260928121454.901306-1-nb@tipi-net.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
679950fede
commit
a58cdf56b6
|
|
@ -2020,25 +2020,20 @@ static int bcmgenet_tx_poll(struct napi_struct *napi, int budget)
|
|||
{
|
||||
struct bcmgenet_tx_ring *ring =
|
||||
container_of(napi, struct bcmgenet_tx_ring, napi);
|
||||
unsigned int work_done = 0;
|
||||
struct netdev_queue *txq;
|
||||
|
||||
spin_lock(&ring->lock);
|
||||
work_done = __bcmgenet_tx_reclaim(ring->priv->dev, ring);
|
||||
__bcmgenet_tx_reclaim(ring->priv->dev, ring);
|
||||
if (ring->free_bds > (MAX_SKB_FRAGS + 1)) {
|
||||
txq = netdev_get_tx_queue(ring->priv->dev, ring->index);
|
||||
netif_tx_wake_queue(txq);
|
||||
}
|
||||
spin_unlock(&ring->lock);
|
||||
|
||||
if (work_done == 0) {
|
||||
napi_complete(napi);
|
||||
if (budget && napi_complete_done(napi, 0))
|
||||
bcmgenet_tx_ring_int_enable(ring);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return budget;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void bcmgenet_tx_reclaim_all(struct net_device *dev)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user