From: 'Horatiu Vultur' <horatiu.vultur@microchip.com>
To: David Laight <David.Laight@aculab.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"kuba@kernel.org" <kuba@kernel.org>
Subject: Re: [PATCH net-next] net: lan966x: Improve the CPU TX bitrate.
Date: Wed, 9 Mar 2022 13:16:32 +0100 [thread overview]
Message-ID: <20220309121632.d77v2x27kfaqiuzo@soft-dev3-1.localhost> (raw)
In-Reply-To: <45a9f88b140d44af8522e7d8a6abcbbf@AcuMS.aculab.com>
The 03/09/2022 09:57, David Laight wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> From: 'Horatiu Vultur'
> > Sent: 09 March 2022 09:11
> >
> > The 03/08/2022 22:46, David Laight wrote:
> > >
> > > From: Horatiu Vultur
> > > > Sent: 08 March 2022 22:30
> > > >
> > > > The 03/08/2022 22:36, Andrew Lunn wrote:
> > > > >
> > > > > > static int lan966x_port_inj_ready(struct lan966x *lan966x, u8 grp)
> > > > > > {
> > > > > > - u32 val;
> > > > > > + unsigned long time = jiffies + usecs_to_jiffies(READL_TIMEOUT_US);
> > > > > > + int ret = 0;
> > > > > >
> > > > > > - return readx_poll_timeout_atomic(lan966x_port_inj_status, lan966x, val,
> > > > > > - QS_INJ_STATUS_FIFO_RDY_GET(val) & BIT(grp),
> > > > > > - READL_SLEEP_US, READL_TIMEOUT_US);
> > > > > > + while (!(lan_rd(lan966x, QS_INJ_STATUS) &
> > > > > > + QS_INJ_STATUS_FIFO_RDY_SET(BIT(grp)))) {
> > > > > > + if (time_after(jiffies, time)) {
> > > > > > + ret = -ETIMEDOUT;
> > > > > > + break;
> > > > > > + }
> > > > >
> > > > > Did you try setting READL_SLEEP_US to 0? readx_poll_timeout_atomic()
> > > > > explicitly supports that.
> > > >
> > > > I have tried but it didn't improve. It was the same as before.
> > >
> > > How many times round the loop is it going ?
> >
> > In the tests that I have done, I have never seen entering in the loop.
>
> In which case I'd do an initial status check before even
> faffing with 'jiffies'.
That is a good idea. I will do this change in the next version.
>
> It might even be that the status read is so slow that space
> is always available by the time it is processed.
> PCIe reads can be horribly slow.
> Into our fgpa they end up being slower than old ISA bus cycles.
> Probably several thousand cpu clocks.
>
> David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
--
/Horatiu
next prev parent reply other threads:[~2022-03-09 12:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-08 16:57 [PATCH net-next] net: lan966x: Improve the CPU TX bitrate Horatiu Vultur
2022-03-08 21:36 ` Andrew Lunn
2022-03-08 22:30 ` Horatiu Vultur
2022-03-08 22:46 ` David Laight
2022-03-09 9:11 ` 'Horatiu Vultur'
2022-03-09 9:57 ` David Laight
2022-03-09 12:16 ` 'Horatiu Vultur' [this message]
2022-03-09 0:40 ` Jakub Kicinski
2022-03-09 9:14 ` Horatiu Vultur
2022-03-09 13:11 ` Andrew Lunn
2022-03-09 22:05 ` Horatiu Vultur
2022-03-10 0:37 ` Andrew Lunn
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=20220309121632.d77v2x27kfaqiuzo@soft-dev3-1.localhost \
--to=horatiu.vultur@microchip.com \
--cc=David.Laight@aculab.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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