ifconfig statistics
最近碰到一个bug,ifconfig不显示收发的statistics。ifconfig的代码在:
https://github.com/giftnuss/net-tools.git
从代码可以看出,数据是从下面的sysfs文件夹里读出来的:
/sys/class/net/enp8s0f0_1/statistics
从驱动的角度说,下面的函数会被调到:
[Wed May 7 08:47:27 2025] mlx5e_rep_get_stats: enp8s0f0_1, ovs-vswitchd
[Wed May 7 08:47:27 2025] mlx5e_stats_update_ndo_stats: 1, ffffffffc12f8c81
[Wed May 7 08:47:27 2025] mlx5e_queue_update_stats: queue_work
[Wed May 7 08:47:27 2025] mlx5e_rep_get_stats: enp8s0f0_1, ovs-vswitchd
[Wed May 7 08:47:27 2025] mlx5e_update_stats_work: caled, ffffffffc1249150
[Wed May 7 08:47:27 2025] mlx5e_queue_update_stats: queue_work
[Wed May 7 08:47:27 2025] mlx5e_stats_grp_vport_rep_update_stats: called
mlx5e_stats_grp_vport_rep_update_stats的定义在:
(gdb) list *(mlx5e_stats_grp_vport_rep_update_stats)
0x91550 is in mlx5e_stats_grp_vport_rep_update_stats (drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:189).
188 static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vport_rep)
189 {
190 struct mlx5e_rep_stats *rep_stats = &priv->stats.rep_stats;
191 int outlen = MLX5_ST_SZ_BYTES(query_vport_counter_out);
192 struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
193 struct mlx5e_rep_priv *rpriv = priv->ppriv;