Commit 44a674d6 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge tag 'mlx5-fixes-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
mlx5 fixes 2021-01-26

This series introduces some fixes to mlx5 driver.

* tag 'mlx5-fixes-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux:
  net/mlx5: CT: Fix incorrect removal of tuple_nat_node from nat rhashtable
  net/mlx5e: Revert parameters on errors when changing MTU and LRO state without reset
  net/mlx5e: Revert parameters on errors when changing trust state without reset
  net/mlx5e: Correctly handle changing the number of queues when the interface is down
  net/mlx5e: Fix CT rule + encap slow path offload and deletion
  net/mlx5e: Disable hw-tc-offload when MLX5_CLS_ACT config is disabled
  net/mlx5: Maintain separate page trees for ECPF and PF functions
  net/mlx5e: Fix IPSEC stats
  net/mlx5e: Reduce tc unsupported key print level
  net/mlx5e: free page before return
  net/mlx5e: E-switch, Fix rate calculation for overflow
  net/mlx5: Fix memory leak on flow table creation error flow
====================

Link: https://lore.kernel.org/r/20210126234345.202096-1-saeedm@nvidia.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents e41aec79 e2194a17
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -273,7 +273,7 @@ int mlx5e_health_rsc_fmsg_dump(struct mlx5e_priv *priv, struct mlx5_rsc_key *key

	err = devlink_fmsg_binary_pair_nest_start(fmsg, "data");
	if (err)
		return err;
		goto free_page;

	cmd = mlx5_rsc_dump_cmd_create(mdev, key);
	if (IS_ERR(cmd)) {
+13 −7
Original line number Diff line number Diff line
@@ -167,6 +167,12 @@ static const struct rhashtable_params tuples_nat_ht_params = {
	.min_size = 16 * 1024,
};

static bool
mlx5_tc_ct_entry_has_nat(struct mlx5_ct_entry *entry)
{
	return !!(entry->tuple_nat_node.next);
}

static int
mlx5_tc_ct_rule_to_tuple(struct mlx5_ct_tuple *tuple, struct flow_rule *rule)
{
@@ -911,10 +917,10 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft,
err_insert:
	mlx5_tc_ct_entry_del_rules(ct_priv, entry);
err_rules:
	if (mlx5_tc_ct_entry_has_nat(entry))
		rhashtable_remove_fast(&ct_priv->ct_tuples_nat_ht,
				       &entry->tuple_nat_node, tuples_nat_ht_params);
err_tuple_nat:
	if (entry->tuple_node.next)
	rhashtable_remove_fast(&ct_priv->ct_tuples_ht,
			       &entry->tuple_node,
			       tuples_ht_params);
@@ -932,7 +938,7 @@ mlx5_tc_ct_del_ft_entry(struct mlx5_tc_ct_priv *ct_priv,
{
	mlx5_tc_ct_entry_del_rules(ct_priv, entry);
	mutex_lock(&ct_priv->shared_counter_lock);
	if (entry->tuple_node.next)
	if (mlx5_tc_ct_entry_has_nat(entry))
		rhashtable_remove_fast(&ct_priv->ct_tuples_nat_ht,
				       &entry->tuple_nat_node,
				       tuples_nat_ht_params);
+2 −2
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ static const struct counter_desc mlx5e_ipsec_sw_stats_desc[] = {

static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(ipsec_sw)
{
	return NUM_IPSEC_SW_COUNTERS;
	return priv->ipsec ? NUM_IPSEC_SW_COUNTERS : 0;
}

static inline MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(ipsec_sw) {}
@@ -105,7 +105,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(ipsec_sw)

static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(ipsec_hw)
{
	return (mlx5_fpga_ipsec_device_caps(priv->mdev)) ? NUM_IPSEC_HW_COUNTERS : 0;
	return (priv->ipsec && mlx5_fpga_ipsec_device_caps(priv->mdev)) ? NUM_IPSEC_HW_COUNTERS : 0;
}

static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(ipsec_hw)
+8 −5
Original line number Diff line number Diff line
@@ -1151,6 +1151,7 @@ static int mlx5e_set_trust_state(struct mlx5e_priv *priv, u8 trust_state)
{
	struct mlx5e_channels new_channels = {};
	bool reset_channels = true;
	bool opened;
	int err = 0;

	mutex_lock(&priv->state_lock);
@@ -1159,22 +1160,24 @@ static int mlx5e_set_trust_state(struct mlx5e_priv *priv, u8 trust_state)
	mlx5e_params_calc_trust_tx_min_inline_mode(priv->mdev, &new_channels.params,
						   trust_state);

	if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
		priv->channels.params = new_channels.params;
	opened = test_bit(MLX5E_STATE_OPENED, &priv->state);
	if (!opened)
		reset_channels = false;
	}

	/* Skip if tx_min_inline is the same */
	if (new_channels.params.tx_min_inline_mode ==
	    priv->channels.params.tx_min_inline_mode)
		reset_channels = false;

	if (reset_channels)
	if (reset_channels) {
		err = mlx5e_safe_switch_channels(priv, &new_channels,
						 mlx5e_update_trust_state_hw,
						 &trust_state);
	else
	} else {
		err = mlx5e_update_trust_state_hw(priv, &trust_state);
		if (!err && !opened)
			priv->channels.params = new_channels.params;
	}

	mutex_unlock(&priv->state_lock);

+7 −1
Original line number Diff line number Diff line
@@ -447,12 +447,18 @@ int mlx5e_ethtool_set_channels(struct mlx5e_priv *priv,
		goto out;
	}

	new_channels.params = priv->channels.params;
	new_channels.params = *cur_params;
	new_channels.params.num_channels = count;

	if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
		struct mlx5e_params old_params;

		old_params = *cur_params;
		*cur_params = new_channels.params;
		err = mlx5e_num_channels_changed(priv);
		if (err)
			*cur_params = old_params;

		goto out;
	}

Loading