1
0
Fork 0

net: systemport: fix TX NAPI work done return value

Although we do not limit the number of packets the TX completion
function bcm_sysport_tx_reclaim() is allowed to reclaim, we were still
using its return value as-is. This means that we could hit the WARN() in
net/core/dev.c where work_done >= budget.

Make sure we do exit the NAPI context when the TX ring is empty, and
pretend there was no work to do.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
hifive-unleashed-5.1
Florian Fainelli 2014-06-26 10:06:46 -07:00 committed by David S. Miller
parent 412bce83ac
commit 16f62d9bed
1 changed files with 2 additions and 2 deletions

View File

@ -654,13 +654,13 @@ static int bcm_sysport_tx_poll(struct napi_struct *napi, int budget)
work_done = bcm_sysport_tx_reclaim(ring->priv, ring);
if (work_done < budget) {
if (work_done == 0) {
napi_complete(napi);
/* re-enable TX interrupt */
intrl2_1_mask_clear(ring->priv, BIT(ring->index));
}
return work_done;
return 0;
}
static void bcm_sysport_tx_reclaim_all(struct bcm_sysport_priv *priv)