Skip to content

Commit 101b764

Browse files
pbrkrPaolo Abeni
authored andcommitted
net: ravb: Always update error counters
The error statistics should be updated each time the poll function is called, even if the full RX work budget has been consumed. This prevents the counts from becoming stuck when RX bandwidth usage is high. This also ensures that error counters are not updated after we've re-enabled interrupts as that could result in a race condition. Also drop an unnecessary space. Fixes: c156633 ("Renesas Ethernet AVB driver proper") Signed-off-by: Paul Barker <[email protected]> Reviewed-by: Sergey Shtylyov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 596a425 commit 101b764

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

drivers/net/ethernet/renesas/ravb_main.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,15 @@ static int ravb_poll(struct napi_struct *napi, int budget)
13391339
netif_wake_subqueue(ndev, q);
13401340
spin_unlock_irqrestore(&priv->lock, flags);
13411341

1342+
/* Receive error message handling */
1343+
priv->rx_over_errors = priv->stats[RAVB_BE].rx_over_errors;
1344+
if (info->nc_queues)
1345+
priv->rx_over_errors += priv->stats[RAVB_NC].rx_over_errors;
1346+
if (priv->rx_over_errors != ndev->stats.rx_over_errors)
1347+
ndev->stats.rx_over_errors = priv->rx_over_errors;
1348+
if (priv->rx_fifo_errors != ndev->stats.rx_fifo_errors)
1349+
ndev->stats.rx_fifo_errors = priv->rx_fifo_errors;
1350+
13421351
if (!unmask)
13431352
goto out;
13441353

@@ -1355,14 +1364,6 @@ static int ravb_poll(struct napi_struct *napi, int budget)
13551364
}
13561365
spin_unlock_irqrestore(&priv->lock, flags);
13571366

1358-
/* Receive error message handling */
1359-
priv->rx_over_errors = priv->stats[RAVB_BE].rx_over_errors;
1360-
if (info->nc_queues)
1361-
priv->rx_over_errors += priv->stats[RAVB_NC].rx_over_errors;
1362-
if (priv->rx_over_errors != ndev->stats.rx_over_errors)
1363-
ndev->stats.rx_over_errors = priv->rx_over_errors;
1364-
if (priv->rx_fifo_errors != ndev->stats.rx_fifo_errors)
1365-
ndev->stats.rx_fifo_errors = priv->rx_fifo_errors;
13661367
out:
13671368
return budget - quota;
13681369
}

0 commit comments

Comments
 (0)