Skip to content

Commit 7c45352

Browse files
w1ldptrSaeed Mahameed
authored andcommitted
net/mlx5e: Enable all available stats for uplink reps
Extend stats group array of uplink representor with all stats that are available for PF in legacy mode, besides ipsec and TLS which are not supported. Don't output vport stats for uplink representor because they are already handled by 802_3 group (with different names: {tx|rx}_{bytes|packets}_phy). Signed-off-by: Vlad Buslov <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 8520fa5 commit 7c45352

File tree

3 files changed

+18
-33
lines changed

3 files changed

+18
-33
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_rep.c

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(vport_rep)
181181
return idx;
182182
}
183183

184-
static void mlx5e_vf_rep_update_hw_counters(struct mlx5e_priv *priv)
184+
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vport_rep)
185185
{
186186
struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
187187
struct mlx5e_rep_priv *rpriv = priv->ppriv;
@@ -204,32 +204,6 @@ static void mlx5e_vf_rep_update_hw_counters(struct mlx5e_priv *priv)
204204
vport_stats->tx_bytes = vf_stats.rx_bytes;
205205
}
206206

207-
static void mlx5e_uplink_rep_update_hw_counters(struct mlx5e_priv *priv)
208-
{
209-
struct mlx5e_pport_stats *pstats = &priv->stats.pport;
210-
struct rtnl_link_stats64 *vport_stats;
211-
212-
MLX5E_STATS_GRP_OP(802_3, update_stats)(priv);
213-
214-
vport_stats = &priv->stats.vf_vport;
215-
216-
vport_stats->rx_packets = PPORT_802_3_GET(pstats, a_frames_received_ok);
217-
vport_stats->rx_bytes = PPORT_802_3_GET(pstats, a_octets_received_ok);
218-
vport_stats->tx_packets = PPORT_802_3_GET(pstats, a_frames_transmitted_ok);
219-
vport_stats->tx_bytes = PPORT_802_3_GET(pstats, a_octets_transmitted_ok);
220-
}
221-
222-
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vport_rep)
223-
{
224-
struct mlx5e_rep_priv *rpriv = priv->ppriv;
225-
struct mlx5_eswitch_rep *rep = rpriv->rep;
226-
227-
if (rep->vport == MLX5_VPORT_UPLINK)
228-
mlx5e_uplink_rep_update_hw_counters(priv);
229-
else
230-
mlx5e_vf_rep_update_hw_counters(priv);
231-
}
232-
233207
static void mlx5e_rep_get_strings(struct net_device *dev,
234208
u32 stringset, uint8_t *data)
235209
{
@@ -1908,8 +1882,20 @@ static unsigned int mlx5e_rep_stats_grps_num(struct mlx5e_priv *priv)
19081882

19091883
/* The stats groups order is opposite to the update_stats() order calls */
19101884
static mlx5e_stats_grp_t mlx5e_ul_rep_stats_grps[] = {
1911-
&MLX5E_STATS_GRP(sw_rep),
1912-
&MLX5E_STATS_GRP(vport_rep),
1885+
&MLX5E_STATS_GRP(sw),
1886+
&MLX5E_STATS_GRP(qcnt),
1887+
&MLX5E_STATS_GRP(vnic_env),
1888+
&MLX5E_STATS_GRP(vport),
1889+
&MLX5E_STATS_GRP(802_3),
1890+
&MLX5E_STATS_GRP(2863),
1891+
&MLX5E_STATS_GRP(2819),
1892+
&MLX5E_STATS_GRP(phy),
1893+
&MLX5E_STATS_GRP(eth_ext),
1894+
&MLX5E_STATS_GRP(pcie),
1895+
&MLX5E_STATS_GRP(per_prio),
1896+
&MLX5E_STATS_GRP(pme),
1897+
&MLX5E_STATS_GRP(channels),
1898+
&MLX5E_STATS_GRP(per_port_buff_congest),
19131899
};
19141900

19151901
static unsigned int mlx5e_ul_rep_stats_grps_num(struct mlx5e_priv *priv)

drivers/net/ethernet/mellanox/mlx5/core/en_stats.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(802_3)
630630
#define MLX5_BASIC_PPCNT_SUPPORTED(mdev) \
631631
(MLX5_CAP_GEN(mdev, pcam_reg) ? MLX5_CAP_PCAM_REG(mdev, ppcnt) : 1)
632632

633-
MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(802_3)
633+
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(802_3)
634634
{
635635
struct mlx5e_pport_stats *pstats = &priv->stats.pport;
636636
struct mlx5_core_dev *mdev = priv->mdev;
@@ -1713,7 +1713,7 @@ MLX5E_DEFINE_STATS_GRP(per_prio, 0);
17131713
MLX5E_DEFINE_STATS_GRP(pme, 0);
17141714
MLX5E_DEFINE_STATS_GRP(channels, 0);
17151715
MLX5E_DEFINE_STATS_GRP(per_port_buff_congest, 0);
1716-
static MLX5E_DEFINE_STATS_GRP(eth_ext, 0);
1716+
MLX5E_DEFINE_STATS_GRP(eth_ext, 0);
17171717
static MLX5E_DEFINE_STATS_GRP(ipsec, 0);
17181718
static MLX5E_DEFINE_STATS_GRP(tls, 0);
17191719

drivers/net/ethernet/mellanox/mlx5/core/en_stats.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,6 @@ struct mlx5e_stats {
376376
extern mlx5e_stats_grp_t mlx5e_nic_stats_grps[];
377377
unsigned int mlx5e_nic_stats_grps_num(struct mlx5e_priv *priv);
378378

379-
MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(802_3);
380-
381379
extern MLX5E_DECLARE_STATS_GRP(sw);
382380
extern MLX5E_DECLARE_STATS_GRP(qcnt);
383381
extern MLX5E_DECLARE_STATS_GRP(vnic_env);
@@ -386,6 +384,7 @@ extern MLX5E_DECLARE_STATS_GRP(802_3);
386384
extern MLX5E_DECLARE_STATS_GRP(2863);
387385
extern MLX5E_DECLARE_STATS_GRP(2819);
388386
extern MLX5E_DECLARE_STATS_GRP(phy);
387+
extern MLX5E_DECLARE_STATS_GRP(eth_ext);
389388
extern MLX5E_DECLARE_STATS_GRP(pcie);
390389
extern MLX5E_DECLARE_STATS_GRP(per_prio);
391390
extern MLX5E_DECLARE_STATS_GRP(pme);

0 commit comments

Comments
 (0)