[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8bbbcd8b-b812-4e65-8169-73ffc5479eef@linux.alibaba.com>
Date: Thu, 28 Mar 2024 10:02:31 +0800
From: Heng Qi <hengqi@...ux.alibaba.com>
To: Alexander Lobakin <aleksander.lobakin@...el.com>
Cc: netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Vladimir Oltean <vladimir.oltean@....com>,
"David S. Miller" <davem@...emloft.net>, Jason Wang <jasowang@...hat.com>,
"Michael S. Tsirkin" <mst@...hat.com>, Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
Subject: Re: [PATCH net-next v2 2/2] virtio-net: support dim profile
fine-tuning
在 2024/3/27 下午10:45, Alexander Lobakin 写道:
> From: Heng Qi <hengqi@...ux.alibaba.com>
> Date: Wed, 27 Mar 2024 17:19:06 +0800
>
>> Virtio-net has different types of back-end device
>> implementations. In order to effectively optimize
>> the dim library's gains for different device
>> implementations, let's use the new interface params
>> to fine-tune the profile list.
> Nice idea, but
>
>> Signed-off-by: Heng Qi <hengqi@...ux.alibaba.com>
>> ---
>> drivers/net/virtio_net.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++--
>> 1 file changed, 52 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
>> index e709d44..9b6c727 100644
>> --- a/drivers/net/virtio_net.c
>> +++ b/drivers/net/virtio_net.c
>> @@ -57,6 +57,16 @@
>>
>> #define VIRTNET_DRIVER_VERSION "1.0.0"
>>
>> +/* 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.
You are right. Good catch!
Thanks,
Heng
>> +
>> static const unsigned long guest_offloads[] = {
>> VIRTIO_NET_F_GUEST_TSO4,
>> VIRTIO_NET_F_GUEST_TSO6,
> Thanks,
> Olek
Powered by blists - more mailing lists