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: Wed, 24 Apr 2024 11:52:12 +0800
From: Jason Wang <jasowang@...hat.com>
To: Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>, 
	Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, 
	"Michael S. Tsirkin" <mst@...hat.com>, Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>, 
	Jesper Dangaard Brouer <hawk@...nel.org>, John Fastabend <john.fastabend@...il.com>, 
	Stanislav Fomichev <sdf@...gle.com>, Amritha Nambiar <amritha.nambiar@...el.com>, 
	Larysa Zaremba <larysa.zaremba@...el.com>, Sridhar Samudrala <sridhar.samudrala@...el.com>, 
	Maciej Fijalkowski <maciej.fijalkowski@...el.com>, virtualization@...ts.linux.dev, 
	bpf@...r.kernel.org
Subject: Re: [PATCH net-next v6 5/8] virtio_net: add the total stats field

On Tue, Apr 23, 2024 at 7:32 PM Xuan Zhuo <xuanzhuo@...ux.alibaba.com> wrote:
>
> Now, we just show the stats of every queue.
>
> But for the user, the total values of every stat may are valuable.
>
> NIC statistics:
>      rx_packets: 373522
>      rx_bytes: 85919736
>      rx_drops: 0
>      rx_xdp_packets: 0
>      rx_xdp_tx: 0
>      rx_xdp_redirects: 0
>      rx_xdp_drops: 0
>      rx_kicks: 11125
>      rx_hw_notifications: 0
>      rx_hw_packets: 1325870
>      rx_hw_bytes: 263348963
>      rx_hw_interrupts: 0
>      rx_hw_drops: 1451
>      rx_hw_drop_overruns: 0
>      rx_hw_csum_valid: 1325870
>      rx_hw_needs_csum: 1325870
>      rx_hw_csum_none: 0
>      rx_hw_csum_bad: 0
>      rx_hw_ratelimit_packets: 0
>      rx_hw_ratelimit_bytes: 0
>      tx_packets: 10050
>      tx_bytes: 1230176
>      tx_xdp_tx: 0
>      tx_xdp_tx_drops: 0
>      tx_kicks: 10050
>      tx_timeouts: 0
>      tx_hw_notifications: 0
>      tx_hw_packets: 32281
>      tx_hw_bytes: 4315590
>      tx_hw_interrupts: 0
>      tx_hw_drops: 0
>      tx_hw_drop_malformed: 0
>      tx_hw_csum_none: 0
>      tx_hw_needs_csum: 32281
>      tx_hw_ratelimit_packets: 0
>      tx_hw_ratelimit_bytes: 0
>      rx0_packets: 373522
>      rx0_bytes: 85919736
>      rx0_drops: 0
>      rx0_xdp_packets: 0
>      rx0_xdp_tx: 0
>      rx0_xdp_redirects: 0
>      rx0_xdp_drops: 0
>      rx0_kicks: 11125
>      rx0_hw_notifications: 0
>      rx0_hw_packets: 1325870
>      rx0_hw_bytes: 263348963
>      rx0_hw_interrupts: 0
>      rx0_hw_drops: 1451
>      rx0_hw_drop_overruns: 0
>      rx0_hw_csum_valid: 1325870
>      rx0_hw_needs_csum: 1325870
>      rx0_hw_csum_none: 0
>      rx0_hw_csum_bad: 0
>      rx0_hw_ratelimit_packets: 0
>      rx0_hw_ratelimit_bytes: 0
>      tx0_packets: 10050
>      tx0_bytes: 1230176
>      tx0_xdp_tx: 0
>      tx0_xdp_tx_drops: 0
>      tx0_kicks: 10050
>      tx0_timeouts: 0
>      tx0_hw_notifications: 0
>      tx0_hw_packets: 32281
>      tx0_hw_bytes: 4315590
>      tx0_hw_interrupts: 0
>      tx0_hw_drops: 0
>      tx0_hw_drop_malformed: 0
>      tx0_hw_csum_none: 0
>      tx0_hw_needs_csum: 32281
>      tx0_hw_ratelimit_packets: 0
>      tx0_hw_ratelimit_bytes: 0
>
> Signed-off-by: Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
> ---
>  drivers/net/virtio_net.c | 81 ++++++++++++++++++++++++++++++++++------
>  1 file changed, 69 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 6d24cd8fb15f..8a4d22f5f5b1 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -3344,14 +3344,15 @@ static void virtnet_stats_sprintf(u8 **p, const char *fmt, const char *noq_fmt,
>         }
>  }
>
> +/* qid == -1: for rx/tx queue total field */
>  static void virtnet_get_stats_string(struct virtnet_info *vi, int type, int qid, u8 **data)

Nit: -1 for all seems to be a wired API, could we have the caller to
iterate the possible qid?

Other parts look good.

Thanks


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ