]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/6.6.26/net-ravb-let-ip-specific-receive-function-to-interro.patch
Linux 6.6.26
[thirdparty/kernel/stable-queue.git] / releases / 6.6.26 / net-ravb-let-ip-specific-receive-function-to-interro.patch
CommitLineData
7e19d03b
SL
1From 569935a575dfc3a49adb4c9929cb8b4f169b4013 Mon Sep 17 00:00:00 2001
2From: Sasha Levin <sashal@kernel.org>
3Date: Fri, 2 Feb 2024 10:41:22 +0200
4Subject: net: ravb: Let IP-specific receive function to interrogate
5 descriptors
6
7From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
8
9[ Upstream commit 2b993bfdb47b3aaafd8fe9cd5038b5e297b18ee1 ]
10
11ravb_poll() initial code used to interrogate the first descriptor of the
12RX queue in case gPTP is false to determine if ravb_rx() should be called.
13This is done for non-gPTP IPs. For gPTP IPs the driver PTP-specific
14information was used to determine if receive function should be called. As
15every IP has its own receive function that interrogates the RX descriptors
16list in the same way the ravb_poll() was doing there is no need to double
17check this in ravb_poll(). Removing the code from ravb_poll() leads to a
18cleaner code.
19
20Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
21Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
22Signed-off-by: Paolo Abeni <pabeni@redhat.com>
23Stable-dep-of: 596a4254915f ("net: ravb: Always process TX descriptor ring")
24Signed-off-by: Sasha Levin <sashal@kernel.org>
25---
26 drivers/net/ethernet/renesas/ravb_main.c | 13 ++-----------
27 1 file changed, 2 insertions(+), 11 deletions(-)
28
29diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
30index 8fec0dbbbe7bb..b87e9252ea176 100644
31--- a/drivers/net/ethernet/renesas/ravb_main.c
32+++ b/drivers/net/ethernet/renesas/ravb_main.c
33@@ -1288,25 +1288,16 @@ static int ravb_poll(struct napi_struct *napi, int budget)
34 struct net_device *ndev = napi->dev;
35 struct ravb_private *priv = netdev_priv(ndev);
36 const struct ravb_hw_info *info = priv->info;
37- bool gptp = info->gptp || info->ccc_gac;
38- struct ravb_rx_desc *desc;
39 unsigned long flags;
40 int q = napi - priv->napi;
41 int mask = BIT(q);
42 int quota = budget;
43- unsigned int entry;
44
45- if (!gptp) {
46- entry = priv->cur_rx[q] % priv->num_rx_ring[q];
47- desc = &priv->gbeth_rx_ring[entry];
48- }
49 /* Processing RX Descriptor Ring */
50 /* Clear RX interrupt */
51 ravb_write(ndev, ~(mask | RIS0_RESERVED), RIS0);
52- if (gptp || desc->die_dt != DT_FEMPTY) {
53- if (ravb_rx(ndev, &quota, q))
54- goto out;
55- }
56+ if (ravb_rx(ndev, &quota, q))
57+ goto out;
58
59 /* Processing TX Descriptor Ring */
60 spin_lock_irqsave(&priv->lock, flags);
61--
622.43.0
63