Commit 8fed7565 authored by David S. Miller's avatar David S. Miller
Browse files

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

mlx5-fixes-2023-01-09
parents cb3e9864 9828994a
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -2176,15 +2176,9 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev)
		return -EINVAL;
	}

	cmd->stats = kvcalloc(MLX5_CMD_OP_MAX, sizeof(*cmd->stats), GFP_KERNEL);
	if (!cmd->stats)
		return -ENOMEM;

	cmd->pool = dma_pool_create("mlx5_cmd", mlx5_core_dma_dev(dev), size, align, 0);
	if (!cmd->pool) {
		err = -ENOMEM;
		goto dma_pool_err;
	}
	if (!cmd->pool)
		return -ENOMEM;

	err = alloc_cmd_page(dev, cmd);
	if (err)
@@ -2268,8 +2262,6 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev)

err_free_pool:
	dma_pool_destroy(cmd->pool);
dma_pool_err:
	kvfree(cmd->stats);
	return err;
}

@@ -2282,7 +2274,6 @@ void mlx5_cmd_cleanup(struct mlx5_core_dev *dev)
	destroy_msg_cache(dev);
	free_cmd_page(dev, cmd);
	dma_pool_destroy(cmd->pool);
	kvfree(cmd->stats);
}

void mlx5_cmd_set_state(struct mlx5_core_dev *dev,
+0 −6
Original line number Diff line number Diff line
@@ -34,12 +34,6 @@ static int police_act_validate(const struct flow_action_entry *act,
		return -EOPNOTSUPP;
	}

	if (act->police.rate_pkt_ps) {
		NL_SET_ERR_MSG_MOD(extack,
				   "QoS offload not support packets per second");
		return -EOPNOTSUPP;
	}

	return 0;
}

+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ mlx5e_post_meter_add_rule(struct mlx5e_priv *priv,
		attr->counter = act_counter;

	attr->flags |= MLX5_ATTR_FLAG_NO_IN_PORT;
	attr->inner_match_level = MLX5_MATCH_NONE;
	attr->outer_match_level = MLX5_MATCH_NONE;
	attr->chain = 0;
	attr->prio = 0;
+2 −0
Original line number Diff line number Diff line
@@ -88,6 +88,8 @@ static int mlx5e_gen_ip_tunnel_header_vxlan(char buf[],
	struct udphdr *udp = (struct udphdr *)(buf);
	struct vxlanhdr *vxh;

	if (tun_key->tun_flags & TUNNEL_VXLAN_OPT)
		return -EOPNOTSUPP;
	vxh = (struct vxlanhdr *)((char *)udp + sizeof(struct udphdr));
	*ip_proto = IPPROTO_UDP;

+9 −10
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ struct mlx5e_macsec_sa {
	u32 enc_key_id;
	u32 next_pn;
	sci_t sci;
	ssci_t ssci;
	salt_t salt;

	struct rhash_head hash;
@@ -358,7 +359,6 @@ static int mlx5e_macsec_init_sa(struct macsec_context *ctx,
	struct mlx5_core_dev *mdev = priv->mdev;
	struct mlx5_macsec_obj_attrs obj_attrs;
	union mlx5e_macsec_rule *macsec_rule;
	struct macsec_key *key;
	int err;

	obj_attrs.next_pn = sa->next_pn;
@@ -368,13 +368,9 @@ static int mlx5e_macsec_init_sa(struct macsec_context *ctx,
	obj_attrs.aso_pdn = macsec->aso.pdn;
	obj_attrs.epn_state = sa->epn_state;

	key = (is_tx) ? &ctx->sa.tx_sa->key : &ctx->sa.rx_sa->key;

	if (sa->epn_state.epn_enabled) {
		obj_attrs.ssci = (is_tx) ? cpu_to_be32((__force u32)ctx->sa.tx_sa->ssci) :
					   cpu_to_be32((__force u32)ctx->sa.rx_sa->ssci);

		memcpy(&obj_attrs.salt, &key->salt, sizeof(key->salt));
		obj_attrs.ssci = cpu_to_be32((__force u32)sa->ssci);
		memcpy(&obj_attrs.salt, &sa->salt, sizeof(sa->salt));
	}

	obj_attrs.replay_window = ctx->secy->replay_window;
@@ -499,10 +495,11 @@ mlx5e_macsec_get_macsec_device_context(const struct mlx5e_macsec *macsec,
}

static void update_macsec_epn(struct mlx5e_macsec_sa *sa, const struct macsec_key *key,
			      const pn_t *next_pn_halves)
			      const pn_t *next_pn_halves, ssci_t ssci)
{
	struct mlx5e_macsec_epn_state *epn_state = &sa->epn_state;

	sa->ssci = ssci;
	sa->salt = key->salt;
	epn_state->epn_enabled = 1;
	epn_state->epn_msb = next_pn_halves->upper;
@@ -550,7 +547,8 @@ static int mlx5e_macsec_add_txsa(struct macsec_context *ctx)
	tx_sa->assoc_num = assoc_num;

	if (secy->xpn)
		update_macsec_epn(tx_sa, &ctx_tx_sa->key, &ctx_tx_sa->next_pn_halves);
		update_macsec_epn(tx_sa, &ctx_tx_sa->key, &ctx_tx_sa->next_pn_halves,
				  ctx_tx_sa->ssci);

	err = mlx5_create_encryption_key(mdev, ctx->sa.key, secy->key_len,
					 MLX5_ACCEL_OBJ_MACSEC_KEY,
@@ -945,7 +943,8 @@ static int mlx5e_macsec_add_rxsa(struct macsec_context *ctx)
	rx_sa->fs_id = rx_sc->sc_xarray_element->fs_id;

	if (ctx->secy->xpn)
		update_macsec_epn(rx_sa, &ctx_rx_sa->key, &ctx_rx_sa->next_pn_halves);
		update_macsec_epn(rx_sa, &ctx_rx_sa->key, &ctx_rx_sa->next_pn_halves,
				  ctx_rx_sa->ssci);

	err = mlx5_create_encryption_key(mdev, ctx->sa.key, ctx->secy->key_len,
					 MLX5_ACCEL_OBJ_MACSEC_KEY,
Loading