All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Heng Qi <hengqi@linux.alibaba.com>
To: Jakub Kicinski <kuba@kernel.org>,
	Alexander Lobakin <aleksander.lobakin@intel.com>
Cc: netdev@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jason Wang <jasowang@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
	vadim.fedorenko@linux.dev, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>
Subject: Re: [PATCH net-next v2 2/2] virtio-net: support dim profile fine-tuning
Date: Thu, 28 Mar 2024 10:26:23 +0800	[thread overview]
Message-ID: <7a73eac4-5b28-49eb-9709-6c7e404257f8@linux.alibaba.com> (raw)
In-Reply-To: <20240327173258.21c031a8@kernel.org>



在 2024/3/28 上午8:32, Jakub Kicinski 写道:
> On Wed, 27 Mar 2024 15:45:50 +0100 Alexander Lobakin wrote:
>>> +/* This is copied from NET_DIM_RX_EQE_PROFILES in DIM library */
>>> +#define VIRTNET_DIM_RX_PKTS 256
>>> +static struct dim_cq_moder rx_eqe_conf[] = {
>>> +	{.usec = 1,   .pkts = VIRTNET_DIM_RX_PKTS,},
>>> +	{.usec = 8,   .pkts = VIRTNET_DIM_RX_PKTS,},
>>> +	{.usec = 64,  .pkts = VIRTNET_DIM_RX_PKTS,},
>>> +	{.usec = 128, .pkts = VIRTNET_DIM_RX_PKTS,},
>>> +	{.usec = 256, .pkts = VIRTNET_DIM_RX_PKTS,}
>>> +};
>> This is wrong.
>> This way you will have one global table for ALL the virtio devices in
>> the system, while Ethtool performs configuration on a per-netdevice basis.
>> What you need is to have 1 dim_cq_moder per each virtio netdevice,
>> embedded somewhere into its netdev_priv(). Then
>> virtio_dim_{rx,tx}_work() will take profiles from there, not the global
>> struct. The global struct can stay here as const to initialize default
>> per-netdevice params.
> I've been wondering lately if adaptive IRQ moderation isn't exactly
> the kind of heuristic we would be best off deferring to BPF.
> I have done 0 experiments -- are the thresholds enough
> or do more interesting algos come to mind for anyone?

Hi Jakub.

I totally agree with your idea. In order to get the best practices for 
virtio DIM on our DPUs,
I actually spent a lot of energy on tuning, similar to the current 
custom profile list and virtio
ctrlq asynchronousization. There are some other tuning methods that may 
not be applicable to
other manufacturers, so they are cannot be released for the time being.

But anyway, adding a dim_bpf interface similar to native XDP (located at 
the beginning
of net_dim()) I think would be good, if you and BPF maintainers (Cc'd) 
are willing for a new bpf type
to be introduced. dim_bpf allows devices that want to implement best 
practices for adaptive
IRQ moderation to implement custom logic.

Also, I think the existing patches are still necessary, and this 
provides the simplest and most
direct way to tune.

Thanks!




  parent reply	other threads:[~2024-03-28  2:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27  9:19 [PATCH net-next v2 0/2] ethtool: provide the dim profile fine-tuning channel Heng Qi
2024-03-27  9:19 ` [PATCH net-next v2 1/2] ethtool: provide customized dim profile management Heng Qi
2024-03-27  9:19 ` [PATCH net-next v2 2/2] virtio-net: support dim profile fine-tuning Heng Qi
2024-03-27 14:45   ` Alexander Lobakin
2024-03-28  0:32     ` Jakub Kicinski
2024-03-28  2:12       ` Xuan Zhuo
2024-03-28 16:48         ` Jakub Kicinski
2024-03-29  8:56           ` Heng Qi
2024-03-29 15:18             ` Jakub Kicinski
2024-03-28  2:26       ` Heng Qi [this message]
2024-03-28  2:02     ` Heng Qi
2024-03-28  7:27     ` Michael S. Tsirkin
2024-03-28  7:27   ` Michael S. Tsirkin
2024-03-28  7:51     ` Heng Qi

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=7a73eac4-5b28-49eb-9709-6c7e404257f8@linux.alibaba.com \
    --to=hengqi@linux.alibaba.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jasowang@redhat.com \
    --cc=kuba@kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=vladimir.oltean@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.