[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdXV-2bdU9Cmk_VHTJ=M3Afg5aTfY=_k=p6v1igzpV5kBA@mail.gmail.com>
Date: Fri, 20 Dec 2024 08:59:24 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Nikita Yushchenko <nikita.yoush@...entembedded.com>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Geert Uytterhoeven <geert+renesas@...der.be>, netdev@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
Michael Dege <michael.dege@...esas.com>,
Christian Mardmoeller <christian.mardmoeller@...esas.com>,
Dennis Ostermann <dennis.ostermann@...esas.com>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" <devicetree@...r.kernel.org>
Subject: Re: [PATCH net-next 1/2] net: renesas: rswitch: use per-port irq handlers
Hi Nikita,
CC devicetree
Thanks for your patch!
On Fri, Dec 20, 2024 at 5:17 AM Nikita Yushchenko
<nikita.yoush@...entembedded.com> wrote:
> Instead of handling all possible data interrupts in the same handler,
> switch to per-port handlers.
>
> This significantly simplifies handling: when the same interrupt is used
> for several ports, system calls all handlers, and each handler only has
> to check interrupts for one port's tx and rx queues.
>
> But it is not required to use the same interrupt for all ports - GWCA
> provides 8 data interrupts and allows arbitrary per-queue assignment
> of those. Support that by reading interrupt index for each port from
> optional 'irq-index' device tree property.
Sorry, but I can't find where this property is documented?
> With per-port interrupts it becomes possible to configure affinity such
> that traffic coming from different ports is serviced simultaneously on
> different CPUs.
>
> Signed-off-by: Nikita Yushchenko <nikita.yoush@...entembedded.com>
> --- a/drivers/net/ethernet/renesas/rswitch.c
> +++ b/drivers/net/ethernet/renesas/rswitch.c
> @@ -1906,6 +1841,34 @@ static void rswitch_etha_init(struct rswitch_private *priv, unsigned int index)
> etha->psmcs = clk_get_rate(priv->clk) / 100000 / (25 * 2) - 1;
> }
>
> +static int rswitch_port_get_irq(struct rswitch_device *rdev)
> +{
> + unsigned int irq_index;
> + char *name;
> + int err;
> +
> + err = of_property_read_u32(rdev->np_port, "irq-index", &irq_index);
> + if (err == 0) {
> + if (irq_index < GWCA_NUM_IRQS)
> + rdev->irq_index = irq_index;
> + else
> + dev_warn(&rdev->priv->pdev->dev,
> + "%pOF: irq-index out of range\n",
> + rdev->np_port);
> + }
> +
> + name = kasprintf(GFP_KERNEL, GWCA_IRQ_RESOURCE_NAME, rdev->irq_index);
> + if (!name)
> + return -ENOMEM;
> + err = platform_get_irq_byname(rdev->priv->pdev, name);
> + kfree(name);
> + if (err < 0)
> + return err;
> + rdev->irq = err;
> +
> + return 0;
> +}
> +
> static int rswitch_device_alloc(struct rswitch_private *priv, unsigned int index)
> {
> struct platform_device *pdev = priv->pdev;
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists