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

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
Loading
Loading
Loading
Loading
+160 −142

File changed.

Preview size limit exceeded, changes collapsed.

+3 −2
Original line number Diff line number Diff line
@@ -9,16 +9,17 @@
#define MLX5E_QOS_MAX_LEAF_NODES 256

struct mlx5e_priv;
struct mlx5e_htb;
struct mlx5e_channels;
struct mlx5e_channel;
struct tc_htb_qopt_offload;

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_cur_leaf_nodes(struct mlx5e_priv *priv);
int mlx5e_qos_cur_leaf_nodes(struct mlx5e_htb *htb);

/* 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 */
int mlx5e_qos_open_queues(struct mlx5e_priv *priv, struct mlx5e_channels *chs);
+1 −1
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ static int mlx5e_select_htb_queue(struct mlx5e_priv *priv, struct sk_buff *skb,
	if (!classid)
		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,
+8 −5
Original line number Diff line number Diff line
@@ -2388,9 +2388,11 @@ int mlx5e_open_channels(struct mlx5e_priv *priv,
			goto err_close_channels;
	}

	if (priv->htb) {
		err = mlx5e_qos_open_queues(priv, chs);
		if (err)
			goto err_close_ptp;
	}

	mlx5e_health_channels_update(priv);
	kvfree(cparam);
@@ -2576,7 +2578,7 @@ int mlx5e_update_tx_netdev_queues(struct mlx5e_priv *priv)
	int qos_queues = 0;

	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;
	ntc = mlx5e_get_dcb_num_tc(&priv->channels.params);
@@ -2724,6 +2726,7 @@ void mlx5e_activate_priv_channels(struct mlx5e_priv *priv)
{
	mlx5e_build_txq_maps(priv);
	mlx5e_activate_channels(&priv->channels);
	if (priv->htb)
		mlx5e_qos_activate_queues(priv);
	mlx5e_xdp_tx_enable(priv);