lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL+tcoAbpnAwHV+zpM672W=1pxW4U0reh9s_R7a4kMKp61fxyg@mail.gmail.com>
Date: Thu, 13 Jun 2024 21:08:51 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: Jiri Pirko <jiri@...nulli.us>, edumazet@...gle.com, kuba@...nel.org, 
	pabeni@...hat.com, davem@...emloft.net, dsahern@...nel.org, 
	jasowang@...hat.com, xuanzhuo@...ux.alibaba.com, eperezma@...hat.com, 
	leitao@...ian.org, netdev@...r.kernel.org, 
	Jason Xing <kernelxing@...cent.com>
Subject: Re: [PATCH net-next v3] net: dqs: introduce IFF_NO_BQL private flag
 for non-BQL drivers

On Thu, Jun 13, 2024 at 5:26 PM Jason Xing <kerneljasonxing@...il.com> wrote:
>
> On Thu, Jun 13, 2024 at 3:56 PM Michael S. Tsirkin <mst@...hat.com> wrote:
> >
> > On Thu, Jun 13, 2024 at 09:51:00AM +0200, Jiri Pirko wrote:
> > > Thu, Jun 13, 2024 at 09:24:27AM CEST, kerneljasonxing@...il.com wrote:
> > > >On Thu, Jun 13, 2024 at 3:19 PM Jiri Pirko <jiri@...nulli.us> wrote:
> > > >>
> > > >> Thu, Jun 13, 2024 at 08:08:36AM CEST, kerneljasonxing@...il.com wrote:
> > > >> >On Thu, Jun 13, 2024 at 1:38 PM Jiri Pirko <jiri@...nulli.us> wrote:
> > > >> >>
> > > >> >> Thu, Jun 13, 2024 at 04:35:49AM CEST, kerneljasonxing@...il.com wrote:
> > > >> >> >From: Jason Xing <kernelxing@...cent.com>
> > > >> >> >
> > > >> >> >Since commit 74293ea1c4db6 ("net: sysfs: Do not create sysfs for non
> > > >> >> >BQL device") limits the non-BQL driver not creating byte_queue_limits
> > > >> >> >directory, I found there is one exception, namely, virtio-net driver,
> > > >> >> >which should also be limited in netdev_uses_bql(). Let me give it a
> > > >> >> >try first.
> > > >> >> >
> > > >> >> >I decided to introduce a NO_BQL bit because:
> > > >> >> >1) it can help us limit virtio-net driver for now.
> > > >> >> >2) if we found another non-BQL driver, we can take it into account.
> > > >> >> >3) we can replace all the driver meeting those two statements in
> > > >> >> >netdev_uses_bql() in future.
> > > >> >> >
> > > >> >> >For now, I would like to make the first step to use this new bit for dqs
> > > >> >> >use instead of replacing/applying all the non-BQL drivers in one go.
> > > >> >> >
> > > >> >> >As Jakub said, "netdev_uses_bql() is best effort", I think, we can add
> > > >> >> >new non-BQL drivers as soon as we find one.
> > > >> >> >
> > > >> >> >After this patch, there is no byte_queue_limits directory in virtio-net
> > > >> >> >driver.
> > > >> >>
> > > >> >> Please note following patch is currently trying to push bql support for
> > > >> >> virtio_net:
> > > >> >> https://lore.kernel.org/netdev/20240612170851.1004604-1-jiri@resnulli.us/
> > > >> >
> > > >> >I saw this one this morning and I'm reviewing/testing it.
> > > >> >
> > > >> >>
> > > >> >> When that is merged, this patch is not needed. Could we wait?
> > > >> >
> > > >> >Please note this patch is not only written for virtio_net driver.
> > > >> >Virtio_net driver is one of possible cases.
> > > >>
> > > >> Yeah, but without virtio_net, there will be no users. What's the point
> > > >> of having that in code? I mean, in general, no-user kernel code gets
> > > >> removed.
> > > >
> > > >Are you sure netdev_uses_bql() can limit all the non-bql drivers with
> > > >those two checks? I haven't investigated this part.
> > >
> > > Nope. What I say is, if there are other users, let's find them and let
> > > them use what you are introducing here. Otherwise don't add unused code.
> >
> >
> > Additionally, it looks like virtio is going to become a
> > "sometimes BQL sometimes no-BQL" driver, so what's the plan -
> > to set/clear the flag accordingly then? What kind of locking
> > will be needed?
>
> Could we consider the default mode is BQL, so we can remove that new
> IFF_NO_BQL flag? If it's hard to take care of these two situations, I
> think we could follow this suggestion from Jakub: "netdev_uses_bql()
> is best effort". What do you think?

ENA driver faces the same 'problem' because it also has BQL and no-BQL.

Honestly, I don't want to spend too much time on this patch because
it's not worth it. Allow me to set the IFF_NO_BQL flag for the default
mode to try our 'best effort' for virtio_net and ENA driver?

Thanks,
Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ