netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Jason Xing <kerneljasonxing@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	davem@davemloft.net, dsahern@kernel.org, jasowang@redhat.com,
	xuanzhuo@linux.alibaba.com, eperezma@redhat.com,
	leitao@debian.org, netdev@vger.kernel.org,
	Jason Xing <kernelxing@tencent.com>
Subject: Re: [PATCH net-next v3] net: dqs: introduce IFF_NO_BQL private flag for non-BQL drivers
Date: Thu, 13 Jun 2024 16:34:37 +0200	[thread overview]
Message-ID: <ZmsDfS24IJAWAmvK@nanopsycho.orion> (raw)
In-Reply-To: <CAL+tcoBu0mCDeDTdEYZ5ccboYOuFeBfbNYvefo2dOWgoxAPg+Q@mail.gmail.com>

Thu, Jun 13, 2024 at 04:11:12PM CEST, kerneljasonxing@gmail.com wrote:
>On Thu, Jun 13, 2024 at 9:17 PM Jiri Pirko <jiri@resnulli.us> wrote:
>>
>> Thu, Jun 13, 2024 at 11:26:05AM CEST, kerneljasonxing@gmail.com wrote:
>> >On Thu, Jun 13, 2024 at 3:56 PM Michael S. Tsirkin <mst@redhat.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@gmail.com wrote:
>> >> > >On Thu, Jun 13, 2024 at 3:19 PM Jiri Pirko <jiri@resnulli.us> wrote:
>> >> > >>
>> >> > >> Thu, Jun 13, 2024 at 08:08:36AM CEST, kerneljasonxing@gmail.com wrote:
>> >> > >> >On Thu, Jun 13, 2024 at 1:38 PM Jiri Pirko <jiri@resnulli.us> wrote:
>> >> > >> >>
>> >> > >> >> Thu, Jun 13, 2024 at 04:35:49AM CEST, kerneljasonxing@gmail.com wrote:
>> >> > >> >> >From: Jason Xing <kernelxing@tencent.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.
>> >>

  reply	other threads:[~2024-06-13 14:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-13  2:35 [PATCH net-next v3] net: dqs: introduce IFF_NO_BQL private flag for non-BQL drivers Jason Xing
2024-06-13  5:38 ` Jiri Pirko
2024-06-13  6:08   ` Jason Xing
2024-06-13  7:19     ` Jiri Pirko
2024-06-13  7:24       ` Jason Xing
2024-06-13  7:49         ` Jason Xing
2024-06-13  7:51         ` Jiri Pirko
2024-06-13  7:52           ` Jason Xing
2024-06-13  7:56           ` Michael S. Tsirkin
2024-06-13  9:26             ` Jason Xing
2024-06-13 13:08               ` Jason Xing
2024-06-13 13:17               ` Jiri Pirko
2024-06-13 14:11                 ` Jason Xing
2024-06-13 14:34                   ` Jiri Pirko [this message]
2024-06-13 14:48                     ` Jason Xing
2024-06-13 14:55 ` Jason Xing
2024-06-13 15:02   ` Jakub Kicinski
2024-06-13 15:25     ` Eric Dumazet
2024-06-13 15:37       ` Jason Xing
2024-06-13 15:48         ` Eric Dumazet
2024-06-13 16:20           ` Jason Xing
2024-06-13 15:31     ` Jason Xing

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=ZmsDfS24IJAWAmvK@nanopsycho.orion \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kerneljasonxing@gmail.com \
    --cc=kernelxing@tencent.com \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=xuanzhuo@linux.alibaba.com \
    /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;
as well as URLs for NNTP newsgroup(s).