Commit b3a69c55 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'mlx5-misc-fixes-2024-12-20'

Tariq Toukan says:

====================
mlx5 misc fixes 2024-12-20

This small patchset provides misc bug fixes from the team to the mlx5
core and Eth drivers.
====================

Link: https://patch.msgid.link/20241220081505.1286093-1-tariqt@nvidia.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 75221e96 2a4f56fb
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -339,9 +339,13 @@ static int mlx5e_macsec_init_sa_fs(struct macsec_context *ctx,
{
	struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev);
	struct mlx5_macsec_fs *macsec_fs = priv->mdev->macsec_fs;
	const struct macsec_tx_sc *tx_sc = &ctx->secy->tx_sc;
	struct mlx5_macsec_rule_attrs rule_attrs;
	union mlx5_macsec_rule *macsec_rule;

	if (is_tx && tx_sc->encoding_sa != sa->assoc_num)
		return 0;

	rule_attrs.macsec_obj_id = sa->macsec_obj_id;
	rule_attrs.sci = sa->sci;
	rule_attrs.assoc_num = sa->assoc_num;
+17 −2
Original line number Diff line number Diff line
@@ -6542,8 +6542,23 @@ static void _mlx5e_remove(struct auxiliary_device *adev)

	mlx5_core_uplink_netdev_set(mdev, NULL);
	mlx5e_dcbnl_delete_app(priv);
	/* When unload driver, the netdev is in registered state
	 * if it's from legacy mode. If from switchdev mode, it
	 * is already unregistered before changing to NIC profile.
	 */
	if (priv->netdev->reg_state == NETREG_REGISTERED) {
		unregister_netdev(priv->netdev);
		_mlx5e_suspend(adev, false);
	} else {
		struct mlx5_core_dev *pos;
		int i;

		if (test_bit(MLX5E_STATE_DESTROYING, &priv->state))
			mlx5_sd_for_each_dev(i, mdev, pos)
				mlx5e_destroy_mdev_resources(pos);
		else
			_mlx5e_suspend(adev, true);
	}
	/* Avoid cleanup if profile rollback failed. */
	if (priv->profile)
		priv->profile->cleanup(priv);
+15 −0
Original line number Diff line number Diff line
@@ -1509,6 +1509,21 @@ mlx5e_vport_uplink_rep_unload(struct mlx5e_rep_priv *rpriv)

	priv = netdev_priv(netdev);

	/* This bit is set when using devlink to change eswitch mode from
	 * switchdev to legacy. As need to keep uplink netdev ifindex, we
	 * detach uplink representor profile and attach NIC profile only.
	 * The netdev will be unregistered later when unload NIC auxiliary
	 * driver for this case.
	 * We explicitly block devlink eswitch mode change if any IPSec rules
	 * offloaded, but can't block other cases, such as driver unload
	 * and devlink reload. We have to unregister netdev before profile
	 * change for those cases. This is to avoid resource leak because
	 * the offloaded rules don't have the chance to be unoffloaded before
	 * cleanup which is triggered by detach uplink representor profile.
	 */
	if (!(priv->mdev->priv.flags & MLX5_PRIV_FLAGS_SWITCH_LEGACY))
		unregister_netdev(netdev);

	mlx5e_netdev_attach_nic_profile(priv);
}

+3 −3
Original line number Diff line number Diff line
@@ -150,11 +150,11 @@ void mlx5_esw_ipsec_restore_dest_uplink(struct mlx5_core_dev *mdev)
	unsigned long i;
	int err;

	xa_for_each(&esw->offloads.vport_reps, i, rep) {
		rpriv = rep->rep_data[REP_ETH].priv;
		if (!rpriv || !rpriv->netdev)
	mlx5_esw_for_each_rep(esw, i, rep) {
		if (atomic_read(&rep->rep_data[REP_ETH].state) != REP_LOADED)
			continue;

		rpriv = rep->rep_data[REP_ETH].priv;
		rhashtable_walk_enter(&rpriv->tc_ht, &iter);
		rhashtable_walk_start(&iter);
		while ((flow = rhashtable_walk_next(&iter)) != NULL) {
+3 −0
Original line number Diff line number Diff line
@@ -714,6 +714,9 @@ void mlx5e_tc_clean_fdb_peer_flows(struct mlx5_eswitch *esw);
			  MLX5_CAP_GEN_2((esw->dev), ec_vf_vport_base) +\
			  (last) - 1)

#define mlx5_esw_for_each_rep(esw, i, rep) \
	xa_for_each(&((esw)->offloads.vport_reps), i, rep)

struct mlx5_eswitch *__must_check
mlx5_devlink_eswitch_get(struct devlink *devlink);

Loading