Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16f62d9b authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller
Browse files

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: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 412bce83
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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)