From: claudiu beznea <claudiu.beznea@tuxon.dev>
To: Sergey Shtylyov <s.shtylyov@omp.ru>,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, p.zabel@pengutronix.de,
yoshihiro.shimoda.uh@renesas.com, geert+renesas@glider.be,
wsa+renesas@sang-engineering.com, biju.das.jz@bp.renesas.com,
prabhakar.mahadev-lad.rj@bp.renesas.com,
sergei.shtylyov@cogentembedded.com,
mitsuhiro.kimura.kc@renesas.com, masaru.nagai.vx@renesas.com
Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org,
Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: Re: [PATCH 06/13] net: ravb: Let IP specific receive function to interrogate descriptors
Date: Thu, 23 Nov 2023 19:15:54 +0200 [thread overview]
Message-ID: <199ae595-5097-4ec6-bbff-86a3e2260b23@tuxon.dev> (raw)
In-Reply-To: <b626455a-f7a4-2684-725c-c679dd75a515@omp.ru>
On 23.11.2023 18:37, Sergey Shtylyov wrote:
> On 11/20/23 11:45 AM, Claudiu wrote:
>
>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>
>> ravb_poll() initial code used to interrogate the first descriptor of the
>> RX queue in case gptp is false to know if ravb_rx() should be called.
>> This is done for non GPTP IPs. For GPTP IPs the driver PTP specific
>
> It's called gPTP, AFAIK.
>
>> information was used to know if receive function should be called. As
>> every IP has it's own receive function that interrogates the RX descriptor
>
> Its own.
>
>> list in the same way the ravb_poll() was doing there is no need to double
>> check this in ravb_poll(). Removing the code form ravb_poll() and
>
> From ravb_poll().
>
>> adjusting ravb_rx_gbeth() leads to a cleaner code.
>>
>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>> ---
>> drivers/net/ethernet/renesas/ravb_main.c | 18 ++++++------------
>> 1 file changed, 6 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
>> index 588e3be692d3..0fc9810c5e78 100644
>> --- a/drivers/net/ethernet/renesas/ravb_main.c
>> +++ b/drivers/net/ethernet/renesas/ravb_main.c
>> @@ -771,12 +771,15 @@ static bool ravb_rx_gbeth(struct net_device *ndev, int *quota, int q)
>> int limit;
>>
>> entry = priv->cur_rx[q] % priv->num_rx_ring[q];
>> + desc = &priv->gbeth_rx_ring[entry];
>> + if (desc->die_dt == DT_FEMPTY)
>> + return false;
>> +
>
> I don't understand what this buys us, the following *while* loop will
> be skipped anyway, and the *for* loop as well, I think... And ravb_rx_rcar()
Yes, I kept it because of the for loop and the update of the *quota.
As commit specifies the code has been moved in IP specific RX function
keeping the initial functionality.
> doesn't have that anyway...
>
>> @@ -1279,25 +1282,16 @@ static int ravb_poll(struct napi_struct *napi, int budget)
>> struct net_device *ndev = napi->dev;
>> struct ravb_private *priv = netdev_priv(ndev);
>> const struct ravb_hw_info *info = priv->info;
>> - bool gptp = info->gptp || info->ccc_gac;
>> - struct ravb_rx_desc *desc;
>> unsigned long flags;
>> int q = napi - priv->napi;
>> int mask = BIT(q);
>> int quota = budget;
>> - unsigned int entry;
>>
>> - if (!gptp) {
>> - entry = priv->cur_rx[q] % priv->num_rx_ring[q];
>> - desc = &priv->gbeth_rx_ring[entry];
>> - }
>> /* Processing RX Descriptor Ring */
>> /* Clear RX interrupt */
>> ravb_write(ndev, ~(mask | RIS0_RESERVED), RIS0);
>> - if (gptp || desc->die_dt != DT_FEMPTY) {
>> - if (ravb_rx(ndev, "a, q))
>> - goto out;
>> - }
>
> I don't really understand this code (despite I've AKCed it)...
> Biju, could you explain this (well, you tried already but I don't
> buy it anymore)?
>
>> + if (ravb_rx(ndev, "a, q))
>> + goto out;
>
> This restores the behavior before:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3d4e37df882b0f4f28b7223a42492650b71252c5
>
> So does look correct. :-)
>
> MBR, Sergey
next prev parent reply other threads:[~2023-11-23 17:16 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-20 8:45 [PATCH 00/13] net: ravb: Add suspend to RAM and runtime PM support for RZ/G3S Claudiu
2023-11-20 8:45 ` [PATCH 01/13] net: ravb: Check return value of reset_control_deassert() Claudiu
2023-11-20 19:03 ` Sergey Shtylyov
2023-11-21 5:59 ` claudiu beznea
2023-11-24 19:04 ` Sergey Shtylyov
2023-11-20 8:45 ` [PATCH 02/13] net: ravb: Use pm_runtime_resume_and_get() Claudiu
2023-11-20 19:23 ` Sergey Shtylyov
2023-11-21 5:57 ` claudiu beznea
2023-11-24 19:02 ` Sergey Shtylyov
2023-11-20 8:45 ` [PATCH 03/13] net: ravb: Make write access to CXR35 first before accessing other EMAC registers Claudiu
2023-11-20 19:44 ` Sergey Shtylyov
2023-11-21 6:02 ` claudiu beznea
2023-11-23 19:30 ` Sergey Shtylyov
2023-11-20 8:45 ` [PATCH 04/13] net: ravb: Start TX queues after HW initialization succeeded Claudiu
2023-11-20 19:49 ` Sergey Shtylyov
2023-11-20 8:45 ` [PATCH 05/13] net: ravb: Stop DMA in case of failures on ravb_open() Claudiu
2023-11-20 20:01 ` Sergey Shtylyov
2023-11-20 8:45 ` [PATCH 06/13] net: ravb: Let IP specific receive function to interrogate descriptors Claudiu
2023-11-23 16:37 ` Sergey Shtylyov
2023-11-23 17:15 ` claudiu beznea [this message]
2023-11-24 17:27 ` Sergey Shtylyov
2023-11-20 8:46 ` [PATCH 07/13] net: ravb: Rely on PM domain to enable gptp_clk Claudiu
2023-11-22 16:59 ` Sergey Shtylyov
2023-11-20 8:46 ` [PATCH 08/13] net: ravb: Rely on PM domain to enable refclk Claudiu
2023-11-22 17:31 ` Sergey Shtylyov
2023-11-23 8:48 ` Geert Uytterhoeven
2023-11-23 17:10 ` claudiu beznea
2023-11-23 19:26 ` Sergey Shtylyov
2023-11-20 8:46 ` [PATCH 09/13] net: ravb: Make reset controller support mandatory Claudiu
2023-11-21 18:46 ` Sergey Shtylyov
2023-11-24 8:07 ` Geert Uytterhoeven
2023-11-20 8:46 ` [PATCH 10/13] net: ravb: Switch to SYSTEM_SLEEP_PM_OPS()/RUNTIME_PM_OPS() and pm_ptr() Claudiu
2023-11-21 20:29 ` Sergey Shtylyov
2023-12-06 11:36 ` Geert Uytterhoeven
2023-11-20 8:46 ` [PATCH 11/13] net: ravb: Use tabs instead of spaces Claudiu
2023-11-21 18:43 ` Sergey Shtylyov
2023-11-20 8:46 ` [PATCH 12/13] net: ravb: Assert/deassert reset on suspend/resume Claudiu
2023-11-21 19:13 ` Sergey Shtylyov
2023-11-22 16:41 ` Sergey Shtylyov
2023-11-20 8:46 ` [PATCH 13/13] net: ravb: Add runtime PM support Claudiu
2023-11-22 16:25 ` Sergey Shtylyov
2023-11-23 17:04 ` claudiu beznea
2023-11-23 19:19 ` Sergey Shtylyov
2023-11-24 18:03 ` claudiu beznea
2023-11-27 14:05 ` Geert Uytterhoeven
2023-11-27 14:46 ` claudiu beznea
2023-11-28 9:23 ` claudiu beznea
2023-11-27 19:01 ` Sergey Shtylyov
2023-11-30 17:35 ` Simon Horman
2023-11-20 20:48 ` [PATCH 00/13] net: ravb: Add suspend to RAM and runtime PM support for RZ/G3S Sergey Shtylyov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199ae595-5097-4ec6-bbff-86a3e2260b23@tuxon.dev \
--to=claudiu.beznea@tuxon.dev \
--cc=biju.das.jz@bp.renesas.com \
--cc=claudiu.beznea.uj@bp.renesas.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=geert+renesas@glider.be \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=masaru.nagai.vx@renesas.com \
--cc=mitsuhiro.kimura.kc@renesas.com \
--cc=netdev@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=s.shtylyov@omp.ru \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=wsa+renesas@sang-engineering.com \
--cc=yoshihiro.shimoda.uh@renesas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®