Re: [PATCH net-next v5 4/9] virtio_net: support device stats

2024-04-09 Thread Jason Wang
On Mon, Mar 18, 2024 at 7:06 PM Xuan Zhuo wrote: > > As the spec > https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 > > make virtio-net support getting the stats from the device by ethtool -S > . > > Due to the numerous descriptors stats, an organization me

Re: [PATCH net-next v5 7/9] virtio_net: rename stat tx_timeout to timeout

2024-04-09 Thread Jason Wang
On Mon, Mar 18, 2024 at 7:06 PM Xuan Zhuo wrote: > > Now, we have this: > > tx_queue_0_tx_timeouts > > This is used to record the tx schedule timeout. > But this has two "tx". I think the below is enough. > > tx_queue_0_timeouts > > So I rename this field. > > Signed-off-by: Xuan Zhuo > R

Re: [PATCH net-next v5 3/9] virtio_net: remove "_queue" from ethtool -S

2024-04-09 Thread Jason Wang
On Mon, Mar 18, 2024 at 7:06 PM Xuan Zhuo wrote: > > The key size of ethtool -S is controlled by this macro. > > ETH_GSTRING_LEN 32 > > That includes the \0 at the end. So the max length of the key name must > is 31. But the length of the prefix "rx_queue_0_" is 11. If the queue > num is larger th

Re: [PATCH net-next v5 2/9] virtio_net: virtnet_send_command supports command-specific-result

2024-04-09 Thread Jason Wang
On Mon, Mar 18, 2024 at 7:06 PM Xuan Zhuo wrote: > > As the spec > https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 > > The virtnet cvq supports to get result from the device. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio_net.c | 47

Re: [PATCH net-next v5 1/9] virtio_net: introduce device stats feature and structures

2024-04-09 Thread Jason Wang
On Mon, Mar 18, 2024 at 7:06 PM Xuan Zhuo wrote: > > The virtio-net device stats spec: > > https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 > > We introduce the relative feature and structures. > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks

Re: [PATCH net-next v5 1/4] ethtool: provide customized dim profile management

2024-04-09 Thread Heng Qi
在 2024/4/10 上午9:44, Jakub Kicinski 写道: On Tue, 9 Apr 2024 20:03:21 +0800 Heng Qi wrote: +/** + * coalesce_put_profile - fill reply with a nla nest with four child nla nests. + * @skb: socket buffer the message is stored in + * @attr_type: nest attr type ETHTOOL_A_COALESCE_*X_*QE_PROFILE + *

Re: [PATCH net-next v5 4/4] virtio-net: support dim profile fine-tuning

2024-04-09 Thread Heng Qi
在 2024/4/10 上午9:40, Jakub Kicinski 写道: On Tue, 9 Apr 2024 20:03:24 +0800 Heng Qi wrote: + /* DIM profile list */ + struct dim_cq_moder rx_eqe_conf[NET_DIM_PARAMS_NUM_PROFILES]; Can you please wrap this into a structure with other necessary information and add a pointer in struct

Re: [PATCH net-next v5 1/4] ethtool: provide customized dim profile management

2024-04-09 Thread Jakub Kicinski
On Tue, 9 Apr 2024 20:03:21 +0800 Heng Qi wrote: > +/** > + * coalesce_put_profile - fill reply with a nla nest with four child nla > nests. > + * @skb: socket buffer the message is stored in > + * @attr_type: nest attr type ETHTOOL_A_COALESCE_*X_*QE_PROFILE > + * @profile: data passed to userspa

Re: [PATCH net-next v5 4/4] virtio-net: support dim profile fine-tuning

2024-04-09 Thread Jakub Kicinski
On Tue, 9 Apr 2024 20:03:24 +0800 Heng Qi wrote: > + /* DIM profile list */ > + struct dim_cq_moder rx_eqe_conf[NET_DIM_PARAMS_NUM_PROFILES]; Can you please wrap this into a structure with other necessary information and add a pointer in struct net_device instead. What's the point of eve

[PATCH net-next v5 4/4] virtio-net: support dim profile fine-tuning

2024-04-09 Thread Heng Qi
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. Signed-off-by: Heng Qi --- drivers/net/virtio_net.c | 41 +++

[PATCH net-next v5 3/4] virtio-net: refactor dim initialization/destruction

2024-04-09 Thread Heng Qi
Extract the initialization and destruction actions of dim for use in the next patch. Signed-off-by: Heng Qi --- drivers/net/virtio_net.c | 37 ++--- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c

[PATCH net-next v5 1/4] ethtool: provide customized dim profile management

2024-04-09 Thread Heng Qi
The NetDIM library, currently leveraged by an array of NICs, delivers excellent acceleration benefits. Nevertheless, NICs vary significantly in their dim profile list prerequisites. Specifically, virtio-net backends may present diverse sw or hw device implementation, making a one-size-fits-all par

[PATCH net-next v5 2/4] linux/dim: move profiles from .c to .h file

2024-04-09 Thread Heng Qi
Place profiles into dim.h file so that the subsequent patch can use it to initialize driver's custom profiles. Signed-off-by: Heng Qi --- include/linux/dim.h | 38 ++ lib/dim/net_dim.c | 38 -- 2 files changed, 38 insertio

[PATCH net-next v5 0/4] ethtool: provide the dim profile fine-tuning channel

2024-04-09 Thread Heng Qi
The NetDIM library provides excellent acceleration for many modern network cards. However, the default profiles of DIM limits its maximum capabilities for different NICs, so providing a way which the NIC can be custom configured is necessary. Currently, interaction with the driver is still based o

Re: [PATCH net-next v4 1/4] ethtool: provide customized dim profile management

2024-04-09 Thread Heng Qi
Will modify things as you sugguested. Thanks! 在 2024/4/9 上午3:13, Jakub Kicinski 写道: On Mon, 8 Apr 2024 11:44:27 +0800 Heng Qi wrote: + nla_for_each_nested(nest, nests, rem) { + if (WARN_ONCE(nla_type(nest) != ETHTOOL_A_MODERATIONS_MODERATION, +