Commit 9311ccef authored by David S. Miller's avatar David S. Miller
Browse files

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



Saeed Mahameed says:

====================
mlx5-fixes-2021-11-16

Please pull this mlx5 fixes series, or let me know in case of any problem.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 3751c3d3 c4c31767
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -339,6 +339,8 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
	case MLX5_CMD_OP_PAGE_FAULT_RESUME:
	case MLX5_CMD_OP_PAGE_FAULT_RESUME:
	case MLX5_CMD_OP_QUERY_ESW_FUNCTIONS:
	case MLX5_CMD_OP_QUERY_ESW_FUNCTIONS:
	case MLX5_CMD_OP_DEALLOC_SF:
	case MLX5_CMD_OP_DEALLOC_SF:
	case MLX5_CMD_OP_DESTROY_UCTX:
	case MLX5_CMD_OP_DESTROY_UMEM:
		return MLX5_CMD_STAT_OK;
		return MLX5_CMD_STAT_OK;


	case MLX5_CMD_OP_QUERY_HCA_CAP:
	case MLX5_CMD_OP_QUERY_HCA_CAP:
@@ -464,9 +466,7 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
	case MLX5_CMD_OP_MODIFY_GENERAL_OBJECT:
	case MLX5_CMD_OP_MODIFY_GENERAL_OBJECT:
	case MLX5_CMD_OP_QUERY_GENERAL_OBJECT:
	case MLX5_CMD_OP_QUERY_GENERAL_OBJECT:
	case MLX5_CMD_OP_CREATE_UCTX:
	case MLX5_CMD_OP_CREATE_UCTX:
	case MLX5_CMD_OP_DESTROY_UCTX:
	case MLX5_CMD_OP_CREATE_UMEM:
	case MLX5_CMD_OP_CREATE_UMEM:
	case MLX5_CMD_OP_DESTROY_UMEM:
	case MLX5_CMD_OP_ALLOC_MEMIC:
	case MLX5_CMD_OP_ALLOC_MEMIC:
	case MLX5_CMD_OP_MODIFY_XRQ:
	case MLX5_CMD_OP_MODIFY_XRQ:
	case MLX5_CMD_OP_RELEASE_XRQ_ERROR:
	case MLX5_CMD_OP_RELEASE_XRQ_ERROR:
+3 −2
Original line number Original line Diff line number Diff line
@@ -164,13 +164,14 @@ int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq)
	MLX5_SET(destroy_cq_in, in, cqn, cq->cqn);
	MLX5_SET(destroy_cq_in, in, cqn, cq->cqn);
	MLX5_SET(destroy_cq_in, in, uid, cq->uid);
	MLX5_SET(destroy_cq_in, in, uid, cq->uid);
	err = mlx5_cmd_exec_in(dev, destroy_cq, in);
	err = mlx5_cmd_exec_in(dev, destroy_cq, in);
	if (err)
		return err;


	synchronize_irq(cq->irqn);
	synchronize_irq(cq->irqn);

	mlx5_cq_put(cq);
	mlx5_cq_put(cq);
	wait_for_completion(&cq->free);
	wait_for_completion(&cq->free);


	return err;
	return 0;
}
}
EXPORT_SYMBOL(mlx5_core_destroy_cq);
EXPORT_SYMBOL(mlx5_core_destroy_cq);


+3 −1
Original line number Original line Diff line number Diff line
@@ -507,6 +507,8 @@ void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq)
	if (!mlx5_debugfs_root)
	if (!mlx5_debugfs_root)
		return;
		return;


	if (cq->dbg)
	if (cq->dbg) {
		rem_res_tree(cq->dbg);
		rem_res_tree(cq->dbg);
		cq->dbg = NULL;
	}
}
}
+17 −9
Original line number Original line Diff line number Diff line
@@ -1356,9 +1356,13 @@ mlx5_tc_ct_match_add(struct mlx5_tc_ct_priv *priv,
int
int
mlx5_tc_ct_parse_action(struct mlx5_tc_ct_priv *priv,
mlx5_tc_ct_parse_action(struct mlx5_tc_ct_priv *priv,
			struct mlx5_flow_attr *attr,
			struct mlx5_flow_attr *attr,
			struct mlx5e_tc_mod_hdr_acts *mod_acts,
			const struct flow_action_entry *act,
			const struct flow_action_entry *act,
			struct netlink_ext_ack *extack)
			struct netlink_ext_ack *extack)
{
{
	bool clear_action = act->ct.action & TCA_CT_ACT_CLEAR;
	int err;

	if (!priv) {
	if (!priv) {
		NL_SET_ERR_MSG_MOD(extack,
		NL_SET_ERR_MSG_MOD(extack,
				   "offload of ct action isn't available");
				   "offload of ct action isn't available");
@@ -1369,6 +1373,17 @@ mlx5_tc_ct_parse_action(struct mlx5_tc_ct_priv *priv,
	attr->ct_attr.ct_action = act->ct.action;
	attr->ct_attr.ct_action = act->ct.action;
	attr->ct_attr.nf_ft = act->ct.flow_table;
	attr->ct_attr.nf_ft = act->ct.flow_table;


	if (!clear_action)
		goto out;

	err = mlx5_tc_ct_entry_set_registers(priv, mod_acts, 0, 0, 0, 0);
	if (err) {
		NL_SET_ERR_MSG_MOD(extack, "Failed to set registers for ct clear");
		return err;
	}
	attr->action |= MLX5_FLOW_CONTEXT_ACTION_MOD_HDR;

out:
	return 0;
	return 0;
}
}


@@ -1898,23 +1913,16 @@ __mlx5_tc_ct_flow_offload_clear(struct mlx5_tc_ct_priv *ct_priv,


	memcpy(pre_ct_attr, attr, attr_sz);
	memcpy(pre_ct_attr, attr, attr_sz);


	err = mlx5_tc_ct_entry_set_registers(ct_priv, mod_acts, 0, 0, 0, 0);
	if (err) {
		ct_dbg("Failed to set register for ct clear");
		goto err_set_registers;
	}

	mod_hdr = mlx5_modify_header_alloc(priv->mdev, ct_priv->ns_type,
	mod_hdr = mlx5_modify_header_alloc(priv->mdev, ct_priv->ns_type,
					   mod_acts->num_actions,
					   mod_acts->num_actions,
					   mod_acts->actions);
					   mod_acts->actions);
	if (IS_ERR(mod_hdr)) {
	if (IS_ERR(mod_hdr)) {
		err = PTR_ERR(mod_hdr);
		err = PTR_ERR(mod_hdr);
		ct_dbg("Failed to add create ct clear mod hdr");
		ct_dbg("Failed to add create ct clear mod hdr");
		goto err_set_registers;
		goto err_mod_hdr;
	}
	}


	pre_ct_attr->modify_hdr = mod_hdr;
	pre_ct_attr->modify_hdr = mod_hdr;
	pre_ct_attr->action |= MLX5_FLOW_CONTEXT_ACTION_MOD_HDR;


	rule = mlx5_tc_rule_insert(priv, orig_spec, pre_ct_attr);
	rule = mlx5_tc_rule_insert(priv, orig_spec, pre_ct_attr);
	if (IS_ERR(rule)) {
	if (IS_ERR(rule)) {
@@ -1930,7 +1938,7 @@ __mlx5_tc_ct_flow_offload_clear(struct mlx5_tc_ct_priv *ct_priv,


err_insert:
err_insert:
	mlx5_modify_header_dealloc(priv->mdev, mod_hdr);
	mlx5_modify_header_dealloc(priv->mdev, mod_hdr);
err_set_registers:
err_mod_hdr:
	netdev_warn(priv->netdev,
	netdev_warn(priv->netdev,
		    "Failed to offload ct clear flow, err %d\n", err);
		    "Failed to offload ct clear flow, err %d\n", err);
	kfree(pre_ct_attr);
	kfree(pre_ct_attr);
+2 −0
Original line number Original line Diff line number Diff line
@@ -110,6 +110,7 @@ int mlx5_tc_ct_add_no_trk_match(struct mlx5_flow_spec *spec);
int
int
mlx5_tc_ct_parse_action(struct mlx5_tc_ct_priv *priv,
mlx5_tc_ct_parse_action(struct mlx5_tc_ct_priv *priv,
			struct mlx5_flow_attr *attr,
			struct mlx5_flow_attr *attr,
			struct mlx5e_tc_mod_hdr_acts *mod_acts,
			const struct flow_action_entry *act,
			const struct flow_action_entry *act,
			struct netlink_ext_ack *extack);
			struct netlink_ext_ack *extack);


@@ -172,6 +173,7 @@ mlx5_tc_ct_add_no_trk_match(struct mlx5_flow_spec *spec)
static inline int
static inline int
mlx5_tc_ct_parse_action(struct mlx5_tc_ct_priv *priv,
mlx5_tc_ct_parse_action(struct mlx5_tc_ct_priv *priv,
			struct mlx5_flow_attr *attr,
			struct mlx5_flow_attr *attr,
			struct mlx5e_tc_mod_hdr_acts *mod_acts,
			const struct flow_action_entry *act,
			const struct flow_action_entry *act,
			struct netlink_ext_ack *extack)
			struct netlink_ext_ack *extack)
{
{
Loading