]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/6.6.26/net-ravb-always-update-error-counters.patch
Linux 6.1.85
[thirdparty/kernel/stable-queue.git] / releases / 6.6.26 / net-ravb-always-update-error-counters.patch
1 From f14b03aca18d32e65d2bb0bba8a950de59b8dcf4 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Tue, 2 Apr 2024 15:53:05 +0100
4 Subject: net: ravb: Always update error counters
5
6 From: Paul Barker <paul.barker.ct@bp.renesas.com>
7
8 [ Upstream commit 101b76418d7163240bc74a7e06867dca0e51183e ]
9
10 The error statistics should be updated each time the poll function is
11 called, even if the full RX work budget has been consumed. This prevents
12 the counts from becoming stuck when RX bandwidth usage is high.
13
14 This also ensures that error counters are not updated after we've
15 re-enabled interrupts as that could result in a race condition.
16
17 Also drop an unnecessary space.
18
19 Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper")
20 Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
21 Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
22 Link: https://lore.kernel.org/r/20240402145305.82148-2-paul.barker.ct@bp.renesas.com
23 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
24 Signed-off-by: Sasha Levin <sashal@kernel.org>
25 ---
26 drivers/net/ethernet/renesas/ravb_main.c | 17 +++++++++--------
27 1 file changed, 9 insertions(+), 8 deletions(-)
28
29 diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
30 index 14595d23b1903..c6897e6ea362d 100644
31 --- a/drivers/net/ethernet/renesas/ravb_main.c
32 +++ b/drivers/net/ethernet/renesas/ravb_main.c
33 @@ -1307,6 +1307,15 @@ static int ravb_poll(struct napi_struct *napi, int budget)
34 netif_wake_subqueue(ndev, q);
35 spin_unlock_irqrestore(&priv->lock, flags);
36
37 + /* Receive error message handling */
38 + priv->rx_over_errors = priv->stats[RAVB_BE].rx_over_errors;
39 + if (info->nc_queues)
40 + priv->rx_over_errors += priv->stats[RAVB_NC].rx_over_errors;
41 + if (priv->rx_over_errors != ndev->stats.rx_over_errors)
42 + ndev->stats.rx_over_errors = priv->rx_over_errors;
43 + if (priv->rx_fifo_errors != ndev->stats.rx_fifo_errors)
44 + ndev->stats.rx_fifo_errors = priv->rx_fifo_errors;
45 +
46 if (!unmask)
47 goto out;
48
49 @@ -1323,14 +1332,6 @@ static int ravb_poll(struct napi_struct *napi, int budget)
50 }
51 spin_unlock_irqrestore(&priv->lock, flags);
52
53 - /* Receive error message handling */
54 - priv->rx_over_errors = priv->stats[RAVB_BE].rx_over_errors;
55 - if (info->nc_queues)
56 - priv->rx_over_errors += priv->stats[RAVB_NC].rx_over_errors;
57 - if (priv->rx_over_errors != ndev->stats.rx_over_errors)
58 - ndev->stats.rx_over_errors = priv->rx_over_errors;
59 - if (priv->rx_fifo_errors != ndev->stats.rx_fifo_errors)
60 - ndev->stats.rx_fifo_errors = priv->rx_fifo_errors;
61 out:
62 return budget - quota;
63 }
64 --
65 2.43.0
66