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]
Date: Thu, 13 Jun 2024 16:34:37 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Jason Xing <kerneljasonxing@...il.com>
Cc: "Michael S. Tsirkin" <mst@...hat.com>, 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

Thu, Jun 13, 2024 at 04:11:12PM CEST, kerneljasonxing@...il.com wrote:
>On Thu, Jun 13, 2024 at 9:17 PM Jiri Pirko <jiri@...nulli.us> wrote:
>>
>> Thu, Jun 13, 2024 at 11:26:05AM CEST, 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?
>>
>> Make sense.
>>
>> Also, note that virtio_net bql utilization is going to be not only
>> dynamically configured, but also per-queue. It would be hard to expose
>> that over one device flag :)
>
>At that time, I would let virtio_net driver go, that is to say, I
>wouldn't take it into consideration in netdev_uses_bql() since it's
>too complicated.
>
>BTW, hope to see your per-queue configured feature patchset soon :)

It's done already. See virtnet_set_per_queue_coalesce()
if ec->tx_max_coalesced_frames is 0, napi_weight is set to 0 and napi
orphan mode is used.


>
>>
>>
>> >
>> >>
>> >> > >
>> >> > >>
>> >> > >>
>> >> > >> >
>> >> > >> >After your patch gets merged (I think it will take some time), you
>> >> > >> >could simply remove that one line in virtio_net.c.
>> >> > >> >
>> >> > >> >Thanks.
>> >>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ