Skip to content

Commit 8520fa5

Browse files
w1ldptrSaeed Mahameed
authored andcommitted
net/mlx5e: Create q counters on uplink representors
Q counters were disabled for all types of representors to prevent an issue where there is not enough resources to init q counters for 127 representor instances. Enable q counters only for uplink representors to support "rx_out_of_buffer", "rx_if_down_packets" counters in ethtool. Signed-off-by: Vlad Buslov <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 8a236b1 commit 8520fa5

File tree

1 file changed

+19
-2
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+19
-2
lines changed

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,6 +1716,23 @@ static void mlx5e_cleanup_rep_rx(struct mlx5e_priv *priv)
17161716
mlx5e_close_drop_rq(&priv->drop_rq);
17171717
}
17181718

1719+
static int mlx5e_init_ul_rep_rx(struct mlx5e_priv *priv)
1720+
{
1721+
int err = mlx5e_init_rep_rx(priv);
1722+
1723+
if (err)
1724+
return err;
1725+
1726+
mlx5e_create_q_counters(priv);
1727+
return 0;
1728+
}
1729+
1730+
static void mlx5e_cleanup_ul_rep_rx(struct mlx5e_priv *priv)
1731+
{
1732+
mlx5e_destroy_q_counters(priv);
1733+
mlx5e_cleanup_rep_rx(priv);
1734+
}
1735+
17191736
static int mlx5e_init_uplink_rep_tx(struct mlx5e_rep_priv *rpriv)
17201737
{
17211738
struct mlx5_rep_uplink_priv *uplink_priv;
@@ -1921,8 +1938,8 @@ static const struct mlx5e_profile mlx5e_rep_profile = {
19211938
static const struct mlx5e_profile mlx5e_uplink_rep_profile = {
19221939
.init = mlx5e_init_rep,
19231940
.cleanup = mlx5e_cleanup_rep,
1924-
.init_rx = mlx5e_init_rep_rx,
1925-
.cleanup_rx = mlx5e_cleanup_rep_rx,
1941+
.init_rx = mlx5e_init_ul_rep_rx,
1942+
.cleanup_rx = mlx5e_cleanup_ul_rep_rx,
19261943
.init_tx = mlx5e_init_rep_tx,
19271944
.cleanup_tx = mlx5e_cleanup_rep_tx,
19281945
.enable = mlx5e_uplink_rep_enable,

0 commit comments

Comments
 (0)