Commit 72041e53 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'mlx5-fixes'

Tariq Toukan says:

====================
mlx5 fixes

This patchset provides bug fixes to mlx5 core and Eth drivers.
====================

Link: https://lore.kernel.org/r/20240411115444.374475-1-tariqt@nvidia.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 68aba004 fef96576
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -108,7 +108,10 @@ static int mlx5e_tx_reporter_err_cqe_recover(void *ctx)
	mlx5e_reset_txqsq_cc_pc(sq);
	sq->stats->recover++;
	clear_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state);
	rtnl_lock();
	mlx5e_activate_txqsq(sq);
	rtnl_unlock();

	if (sq->channel)
		mlx5e_trigger_napi_icosq(sq->channel);
	else
@@ -179,12 +182,16 @@ static int mlx5e_tx_reporter_ptpsq_unhealthy_recover(void *ctx)
	carrier_ok = netif_carrier_ok(netdev);
	netif_carrier_off(netdev);

	rtnl_lock();
	mlx5e_deactivate_priv_channels(priv);
	rtnl_unlock();

	mlx5e_ptp_close(chs->ptp);
	err = mlx5e_ptp_open(priv, &chs->params, chs->c[0]->lag_port, &chs->ptp);

	rtnl_lock();
	mlx5e_activate_priv_channels(priv);
	rtnl_unlock();

	/* return carrier back if needed */
	if (carrier_ok)
+16 −11
Original line number Diff line number Diff line
@@ -46,6 +46,10 @@ struct arfs_table {
	struct hlist_head	 rules_hash[ARFS_HASH_SIZE];
};

enum {
	MLX5E_ARFS_STATE_ENABLED,
};

enum arfs_type {
	ARFS_IPV4_TCP,
	ARFS_IPV6_TCP,
@@ -60,6 +64,7 @@ struct mlx5e_arfs_tables {
	spinlock_t                     arfs_lock;
	int                            last_filter_id;
	struct workqueue_struct        *wq;
	unsigned long                  state;
};

struct arfs_tuple {
@@ -170,6 +175,8 @@ int mlx5e_arfs_enable(struct mlx5e_flow_steering *fs)
			return err;
		}
	}
	set_bit(MLX5E_ARFS_STATE_ENABLED, &arfs->state);

	return 0;
}

@@ -455,6 +462,8 @@ static void arfs_del_rules(struct mlx5e_flow_steering *fs)
	int i;
	int j;

	clear_bit(MLX5E_ARFS_STATE_ENABLED, &arfs->state);

	spin_lock_bh(&arfs->arfs_lock);
	mlx5e_for_each_arfs_rule(rule, htmp, arfs->arfs_tables, i, j) {
		hlist_del_init(&rule->hlist);
@@ -627,17 +636,8 @@ static void arfs_handle_work(struct work_struct *work)
	struct mlx5_flow_handle *rule;

	arfs = mlx5e_fs_get_arfs(priv->fs);
	mutex_lock(&priv->state_lock);
	if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
		spin_lock_bh(&arfs->arfs_lock);
		hlist_del(&arfs_rule->hlist);
		spin_unlock_bh(&arfs->arfs_lock);

		mutex_unlock(&priv->state_lock);
		kfree(arfs_rule);
		goto out;
	}
	mutex_unlock(&priv->state_lock);
	if (!test_bit(MLX5E_ARFS_STATE_ENABLED, &arfs->state))
		return;

	if (!arfs_rule->rule) {
		rule = arfs_add_rule(priv, arfs_rule);
@@ -753,6 +753,11 @@ int mlx5e_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb,
		return -EPROTONOSUPPORT;

	spin_lock_bh(&arfs->arfs_lock);
	if (!test_bit(MLX5E_ARFS_STATE_ENABLED, &arfs->state)) {
		spin_unlock_bh(&arfs->arfs_lock);
		return -EPERM;
	}

	arfs_rule = arfs_find_rule(arfs_t, &fk);
	if (arfs_rule) {
		if (arfs_rule->rxq == rxq_index || work_busy(&arfs_rule->arfs_work)) {
+2 −2
Original line number Diff line number Diff line
@@ -589,12 +589,12 @@ static int mlx5e_get_coalesce(struct net_device *netdev,
static void
mlx5e_set_priv_channels_tx_coalesce(struct mlx5e_priv *priv, struct ethtool_coalesce *coal)
{
	struct mlx5_core_dev *mdev = priv->mdev;
	int tc;
	int i;

	for (i = 0; i < priv->channels.num; ++i) {
		struct mlx5e_channel *c = priv->channels.c[i];
		struct mlx5_core_dev *mdev = c->mdev;

		for (tc = 0; tc < c->num_tc; tc++) {
			mlx5_core_modify_cq_moderation(mdev,
@@ -608,11 +608,11 @@ mlx5e_set_priv_channels_tx_coalesce(struct mlx5e_priv *priv, struct ethtool_coal
static void
mlx5e_set_priv_channels_rx_coalesce(struct mlx5e_priv *priv, struct ethtool_coalesce *coal)
{
	struct mlx5_core_dev *mdev = priv->mdev;
	int i;

	for (i = 0; i < priv->channels.num; ++i) {
		struct mlx5e_channel *c = priv->channels.c[i];
		struct mlx5_core_dev *mdev = c->mdev;

		mlx5_core_modify_cq_moderation(mdev, &c->rq.cq.mcq,
					       coal->rx_coalesce_usecs,
+2 −2
Original line number Diff line number Diff line
@@ -209,8 +209,8 @@ static int mlx5e_devcom_init_mpv(struct mlx5e_priv *priv, u64 *data)
						      *data,
						      mlx5e_devcom_event_mpv,
						      priv);
	if (IS_ERR_OR_NULL(priv->devcom))
		return -EOPNOTSUPP;
	if (IS_ERR(priv->devcom))
		return PTR_ERR(priv->devcom);

	if (mlx5_core_is_mp_master(priv->mdev)) {
		mlx5_devcom_send_event(priv->devcom, MPV_DEVCOM_MASTER_UP,
+1 −1
Original line number Diff line number Diff line
@@ -3060,7 +3060,7 @@ void mlx5_esw_offloads_devcom_init(struct mlx5_eswitch *esw, u64 key)
						     key,
						     mlx5_esw_offloads_devcom_event,
						     esw);
	if (IS_ERR_OR_NULL(esw->devcom))
	if (IS_ERR(esw->devcom))
		return;

	mlx5_devcom_send_event(esw->devcom,
Loading