[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220309091437.in7leaufeagwotty@soft-dev3-1.localhost>
Date: Wed, 9 Mar 2022 10:14:37 +0100
From: Horatiu Vultur <horatiu.vultur@...rochip.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: Andrew Lunn <andrew@...n.ch>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <UNGLinuxDriver@...rochip.com>,
<davem@...emloft.net>
Subject: Re: [PATCH net-next] net: lan966x: Improve the CPU TX bitrate.
The 03/08/2022 16:40, Jakub Kicinski wrote:
>
> On Tue, 8 Mar 2022 23:30:00 +0100 Horatiu Vultur 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.
>
> Huh, is ktime_get() super expensive on that platform?
Hm.. it looks like. Just adding ktime_get() before the while loop, then
the performance drops like before.
I am using SOC_LAN966 which has an ARMv7 CPU. So I am not sure how
expensive is ktime_get().
> jiffies vs ktime seems to be the main difference?
--
/Horatiu
Powered by blists - more mailing lists