]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-6.6/net-ravb-let-ip-specific-receive-function-to-interro.patch
Linux 6.1.85
[thirdparty/kernel/stable-queue.git] / queue-6.6 / net-ravb-let-ip-specific-receive-function-to-interro.patch
1 From 569935a575dfc3a49adb4c9929cb8b4f169b4013 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Fri, 2 Feb 2024 10:41:22 +0200
4 Subject: net: ravb: Let IP-specific receive function to interrogate
5 descriptors
6
7 From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
8
9 [ Upstream commit 2b993bfdb47b3aaafd8fe9cd5038b5e297b18ee1 ]
10
11 ravb_poll() initial code used to interrogate the first descriptor of the
12 RX queue in case gPTP is false to determine if ravb_rx() should be called.
13 This is done for non-gPTP IPs. For gPTP IPs the driver PTP-specific
14 information was used to determine if receive function should be called. As
15 every IP has its own receive function that interrogates the RX descriptors
16 list in the same way the ravb_poll() was doing there is no need to double
17 check this in ravb_poll(). Removing the code from ravb_poll() leads to a
18 cleaner code.
19
20 Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
21 Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
22 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
23 Stable-dep-of: 596a4254915f ("net: ravb: Always process TX descriptor ring")
24 Signed-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
29 diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
30 index 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 --
62 2.43.0
63