Commit 28df4a01 authored by Moshe Tal's avatar Moshe Tal Committed by Saeed Mahameed

net/mlx5e: HTB, remove priv from htb function calls

As a step to make htb self-contained replace the passing of priv as a
parameter to htb function calls with members in the htb struct.

Full decoupling the htb from priv will require more work, so for now
leave the priv as one of the members in the htb struct, to be replaced
by channels in a future commit.
Signed-off-by: default avatarMoshe Tal <moshet@nvidia.com>
Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
Reviewed-by: default avatarMaxim Mikityanskiy <maximmi@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent aaffda6b
...@@ -9,16 +9,17 @@ ...@@ -9,16 +9,17 @@
#define MLX5E_QOS_MAX_LEAF_NODES 256 #define MLX5E_QOS_MAX_LEAF_NODES 256
struct mlx5e_priv; struct mlx5e_priv;
struct mlx5e_htb;
struct mlx5e_channels; struct mlx5e_channels;
struct mlx5e_channel; struct mlx5e_channel;
struct tc_htb_qopt_offload; struct tc_htb_qopt_offload;
int mlx5e_qos_bytes_rate_check(struct mlx5_core_dev *mdev, u64 nbytes); int mlx5e_qos_bytes_rate_check(struct mlx5_core_dev *mdev, u64 nbytes);
int mlx5e_qos_max_leaf_nodes(struct mlx5_core_dev *mdev); int mlx5e_qos_max_leaf_nodes(struct mlx5_core_dev *mdev);
int mlx5e_qos_cur_leaf_nodes(struct mlx5e_priv *priv); int mlx5e_qos_cur_leaf_nodes(struct mlx5e_htb *htb);
/* TX datapath API */ /* TX datapath API */
int mlx5e_get_txq_by_classid(struct mlx5e_priv *priv, u16 classid); int mlx5e_get_txq_by_classid(struct mlx5e_htb *htb, u16 classid);
/* SQ lifecycle */ /* SQ lifecycle */
int mlx5e_qos_open_queues(struct mlx5e_priv *priv, struct mlx5e_channels *chs); int mlx5e_qos_open_queues(struct mlx5e_priv *priv, struct mlx5e_channels *chs);
......
...@@ -184,7 +184,7 @@ static int mlx5e_select_htb_queue(struct mlx5e_priv *priv, struct sk_buff *skb, ...@@ -184,7 +184,7 @@ static int mlx5e_select_htb_queue(struct mlx5e_priv *priv, struct sk_buff *skb,
if (!classid) if (!classid)
return 0; return 0;
return mlx5e_get_txq_by_classid(priv, classid); return mlx5e_get_txq_by_classid(priv->htb, classid);
} }
u16 mlx5e_select_queue(struct net_device *dev, struct sk_buff *skb, u16 mlx5e_select_queue(struct net_device *dev, struct sk_buff *skb,
......
...@@ -2388,9 +2388,11 @@ int mlx5e_open_channels(struct mlx5e_priv *priv, ...@@ -2388,9 +2388,11 @@ int mlx5e_open_channels(struct mlx5e_priv *priv,
goto err_close_channels; goto err_close_channels;
} }
err = mlx5e_qos_open_queues(priv, chs); if (priv->htb) {
if (err) err = mlx5e_qos_open_queues(priv, chs);
goto err_close_ptp; if (err)
goto err_close_ptp;
}
mlx5e_health_channels_update(priv); mlx5e_health_channels_update(priv);
kvfree(cparam); kvfree(cparam);
...@@ -2576,7 +2578,7 @@ int mlx5e_update_tx_netdev_queues(struct mlx5e_priv *priv) ...@@ -2576,7 +2578,7 @@ int mlx5e_update_tx_netdev_queues(struct mlx5e_priv *priv)
int qos_queues = 0; int qos_queues = 0;
if (priv->htb) if (priv->htb)
qos_queues = mlx5e_qos_cur_leaf_nodes(priv); qos_queues = mlx5e_qos_cur_leaf_nodes(priv->htb);
nch = priv->channels.params.num_channels; nch = priv->channels.params.num_channels;
ntc = mlx5e_get_dcb_num_tc(&priv->channels.params); ntc = mlx5e_get_dcb_num_tc(&priv->channels.params);
...@@ -2724,7 +2726,8 @@ void mlx5e_activate_priv_channels(struct mlx5e_priv *priv) ...@@ -2724,7 +2726,8 @@ void mlx5e_activate_priv_channels(struct mlx5e_priv *priv)
{ {
mlx5e_build_txq_maps(priv); mlx5e_build_txq_maps(priv);
mlx5e_activate_channels(&priv->channels); mlx5e_activate_channels(&priv->channels);
mlx5e_qos_activate_queues(priv); if (priv->htb)
mlx5e_qos_activate_queues(priv);
mlx5e_xdp_tx_enable(priv); mlx5e_xdp_tx_enable(priv);
/* dev_watchdog() wants all TX queues to be started when the carrier is /* dev_watchdog() wants all TX queues to be started when the carrier is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment