Commit b7d0db55 authored by Erez Shitrit's avatar Erez Shitrit Committed by Saeed Mahameed
Browse files

net/mlx5: DR, Improve log messages



Few print messages are in debug level where they should be in error, and
few messages are missing.

Signed-off-by: default avatarErez Shitrit <erezsh@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent f6409299
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -672,7 +672,7 @@ int mlx5dr_actions_build_ste_arr(struct mlx5dr_matcher *matcher,
			dest_action = action;
			if (!action->dest_tbl.is_fw_tbl) {
				if (action->dest_tbl.tbl->dmn != dmn) {
					mlx5dr_dbg(dmn,
					mlx5dr_err(dmn,
						   "Destination table belongs to a different domain\n");
					goto out_invalid_arg;
				}
@@ -703,7 +703,7 @@ int mlx5dr_actions_build_ste_arr(struct mlx5dr_matcher *matcher,
						action->dest_tbl.fw_tbl.rx_icm_addr =
							output.sw_owner_icm_root_0;
					} else {
						mlx5dr_dbg(dmn,
						mlx5dr_err(dmn,
							   "Failed mlx5_cmd_query_flow_table ret: %d\n",
							   ret);
						return ret;
@@ -772,7 +772,7 @@ int mlx5dr_actions_build_ste_arr(struct mlx5dr_matcher *matcher,

		/* Check action duplication */
		if (++action_type_set[action_type] > max_actions_type) {
			mlx5dr_dbg(dmn, "Action type %d supports only max %d time(s)\n",
			mlx5dr_err(dmn, "Action type %d supports only max %d time(s)\n",
				   action_type, max_actions_type);
			goto out_invalid_arg;
		}
@@ -781,7 +781,7 @@ int mlx5dr_actions_build_ste_arr(struct mlx5dr_matcher *matcher,
		if (dr_action_validate_and_get_next_state(action_domain,
							  action_type,
							  &state)) {
			mlx5dr_dbg(dmn, "Invalid action sequence provided\n");
			mlx5dr_err(dmn, "Invalid action sequence provided\n");
			return -EOPNOTSUPP;
		}
	}
@@ -797,7 +797,7 @@ int mlx5dr_actions_build_ste_arr(struct mlx5dr_matcher *matcher,
	    rx_rule && recalc_cs_required && dest_action) {
		ret = dr_action_handle_cs_recalc(dmn, dest_action, &attr.final_icm_addr);
		if (ret) {
			mlx5dr_dbg(dmn,
			mlx5dr_err(dmn,
				   "Failed to handle checksum recalculation err %d\n",
				   ret);
			return ret;
+10 −7
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ static int dr_domain_init_resources(struct mlx5dr_domain *dmn)

	ret = mlx5_core_alloc_pd(dmn->mdev, &dmn->pdn);
	if (ret) {
		mlx5dr_dbg(dmn, "Couldn't allocate PD\n");
		mlx5dr_err(dmn, "Couldn't allocate PD, ret: %d", ret);
		return ret;
	}

@@ -192,7 +192,7 @@ static int dr_domain_query_fdb_caps(struct mlx5_core_dev *mdev,

	ret = dr_domain_query_vports(dmn);
	if (ret) {
		mlx5dr_dbg(dmn, "Failed to query vports caps\n");
		mlx5dr_err(dmn, "Failed to query vports caps (err: %d)", ret);
		goto free_vports_caps;
	}

@@ -213,7 +213,7 @@ static int dr_domain_caps_init(struct mlx5_core_dev *mdev,
	int ret;

	if (MLX5_CAP_GEN(mdev, port_type) != MLX5_CAP_PORT_TYPE_ETH) {
		mlx5dr_dbg(dmn, "Failed to allocate domain, bad link type\n");
		mlx5dr_err(dmn, "Failed to allocate domain, bad link type\n");
		return -EOPNOTSUPP;
	}

@@ -257,7 +257,7 @@ static int dr_domain_caps_init(struct mlx5_core_dev *mdev,
		dmn->info.tx.ste_type = MLX5DR_STE_TYPE_TX;
		vport_cap = mlx5dr_get_vport_cap(&dmn->info.caps, 0);
		if (!vport_cap) {
			mlx5dr_dbg(dmn, "Failed to get esw manager vport\n");
			mlx5dr_err(dmn, "Failed to get esw manager vport\n");
			return -ENOENT;
		}

@@ -268,7 +268,7 @@ static int dr_domain_caps_init(struct mlx5_core_dev *mdev,
		dmn->info.tx.drop_icm_addr = dmn->info.caps.esw_tx_drop_address;
		break;
	default:
		mlx5dr_dbg(dmn, "Invalid domain\n");
		mlx5dr_err(dmn, "Invalid domain\n");
		ret = -EINVAL;
		break;
	}
@@ -300,7 +300,7 @@ mlx5dr_domain_create(struct mlx5_core_dev *mdev, enum mlx5dr_domain_type type)
	mutex_init(&dmn->mutex);

	if (dr_domain_caps_init(mdev, dmn)) {
		mlx5dr_dbg(dmn, "Failed init domain, no caps\n");
		mlx5dr_err(dmn, "Failed init domain, no caps\n");
		goto free_domain;
	}

@@ -348,9 +348,12 @@ int mlx5dr_domain_sync(struct mlx5dr_domain *dmn, u32 flags)
		mutex_lock(&dmn->mutex);
		ret = mlx5dr_send_ring_force_drain(dmn);
		mutex_unlock(&dmn->mutex);
		if (ret)
		if (ret) {
			mlx5dr_err(dmn, "Force drain failed flags: %d, ret: %d\n",
				   flags, ret);
			return ret;
		}
	}

	if (flags & MLX5DR_DOMAIN_SYNC_FLAGS_HW)
		ret = mlx5dr_cmd_sync_steering(dmn->mdev);
+1 −1
Original line number Diff line number Diff line
@@ -468,7 +468,7 @@ mlx5dr_icm_alloc_chunk(struct mlx5dr_icm_pool *pool,
			err = mlx5dr_cmd_sync_steering(pool->dmn->mdev);
			if (err) {
				dr_icm_chill_buckets_abort(pool, bucket, buckets);
				mlx5dr_dbg(pool->dmn, "Sync_steering failed\n");
				mlx5dr_err(pool->dmn, "Sync_steering failed\n");
				chunk = NULL;
				goto out;
			}
+5 −5
Original line number Diff line number Diff line
@@ -388,14 +388,14 @@ static int dr_matcher_set_ste_builders(struct mlx5dr_matcher *matcher,
		mlx5dr_ste_build_empty_always_hit(&sb[idx++], rx);

	if (idx == 0) {
		mlx5dr_dbg(dmn, "Cannot generate any valid rules from mask\n");
		mlx5dr_err(dmn, "Cannot generate any valid rules from mask\n");
		return -EINVAL;
	}

	/* Check that all mask fields were consumed */
	for (i = 0; i < sizeof(struct mlx5dr_match_param); i++) {
		if (((u8 *)&mask)[i] != 0) {
			mlx5dr_info(dmn, "Mask contains unsupported parameters\n");
			mlx5dr_err(dmn, "Mask contains unsupported parameters\n");
			return -EOPNOTSUPP;
		}
	}
@@ -563,7 +563,7 @@ static int dr_matcher_set_all_ste_builders(struct mlx5dr_matcher *matcher,
	dr_matcher_set_ste_builders(matcher, nic_matcher, DR_RULE_IPV6, DR_RULE_IPV6);

	if (!nic_matcher->ste_builder) {
		mlx5dr_dbg(dmn, "Cannot generate IPv4 or IPv6 rules with given mask\n");
		mlx5dr_err(dmn, "Cannot generate IPv4 or IPv6 rules with given mask\n");
		return -EINVAL;
	}

@@ -634,13 +634,13 @@ static int dr_matcher_init(struct mlx5dr_matcher *matcher,
	int ret;

	if (matcher->match_criteria >= DR_MATCHER_CRITERIA_MAX) {
		mlx5dr_info(dmn, "Invalid match criteria attribute\n");
		mlx5dr_err(dmn, "Invalid match criteria attribute\n");
		return -EINVAL;
	}

	if (mask) {
		if (mask->match_sz > sizeof(struct mlx5dr_match_param)) {
			mlx5dr_info(dmn, "Invalid match size attribute\n");
			mlx5dr_err(dmn, "Invalid match size attribute\n");
			return -EINVAL;
		}
		mlx5dr_ste_copy_param(matcher->match_criteria,
+9 −9
Original line number Diff line number Diff line
@@ -826,7 +826,7 @@ again:
						  ste_location, send_ste_list);
			if (!new_htbl) {
				mlx5dr_htbl_put(cur_htbl);
				mlx5dr_info(dmn, "failed creating rehash table, htbl-log_size: %d\n",
				mlx5dr_err(dmn, "Failed creating rehash table, htbl-log_size: %d\n",
					   cur_htbl->chunk_size);
			} else {
				cur_htbl = new_htbl;
@@ -877,7 +877,7 @@ static bool dr_rule_verify(struct mlx5dr_matcher *matcher,
	if (!value_size ||
	    (value_size > sizeof(struct mlx5dr_match_param) ||
	     (value_size % sizeof(u32)))) {
		mlx5dr_dbg(matcher->tbl->dmn, "Rule parameters length is incorrect\n");
		mlx5dr_err(matcher->tbl->dmn, "Rule parameters length is incorrect\n");
		return false;
	}

@@ -888,7 +888,7 @@ static bool dr_rule_verify(struct mlx5dr_matcher *matcher,
		e_idx = min(s_idx + sizeof(param->outer), value_size);

		if (!dr_rule_cmp_value_to_mask(mask_p, param_p, s_idx, e_idx)) {
			mlx5dr_dbg(matcher->tbl->dmn, "Rule outer parameters contains a value not specified by mask\n");
			mlx5dr_err(matcher->tbl->dmn, "Rule outer parameters contains a value not specified by mask\n");
			return false;
		}
	}
@@ -898,7 +898,7 @@ static bool dr_rule_verify(struct mlx5dr_matcher *matcher,
		e_idx = min(s_idx + sizeof(param->misc), value_size);

		if (!dr_rule_cmp_value_to_mask(mask_p, param_p, s_idx, e_idx)) {
			mlx5dr_dbg(matcher->tbl->dmn, "Rule misc parameters contains a value not specified by mask\n");
			mlx5dr_err(matcher->tbl->dmn, "Rule misc parameters contains a value not specified by mask\n");
			return false;
		}
	}
@@ -908,7 +908,7 @@ static bool dr_rule_verify(struct mlx5dr_matcher *matcher,
		e_idx = min(s_idx + sizeof(param->inner), value_size);

		if (!dr_rule_cmp_value_to_mask(mask_p, param_p, s_idx, e_idx)) {
			mlx5dr_dbg(matcher->tbl->dmn, "Rule inner parameters contains a value not specified by mask\n");
			mlx5dr_err(matcher->tbl->dmn, "Rule inner parameters contains a value not specified by mask\n");
			return false;
		}
	}
@@ -918,7 +918,7 @@ static bool dr_rule_verify(struct mlx5dr_matcher *matcher,
		e_idx = min(s_idx + sizeof(param->misc2), value_size);

		if (!dr_rule_cmp_value_to_mask(mask_p, param_p, s_idx, e_idx)) {
			mlx5dr_dbg(matcher->tbl->dmn, "Rule misc2 parameters contains a value not specified by mask\n");
			mlx5dr_err(matcher->tbl->dmn, "Rule misc2 parameters contains a value not specified by mask\n");
			return false;
		}
	}
@@ -928,7 +928,7 @@ static bool dr_rule_verify(struct mlx5dr_matcher *matcher,
		e_idx = min(s_idx + sizeof(param->misc3), value_size);

		if (!dr_rule_cmp_value_to_mask(mask_p, param_p, s_idx, e_idx)) {
			mlx5dr_dbg(matcher->tbl->dmn, "Rule misc3 parameters contains a value not specified by mask\n");
			mlx5dr_err(matcher->tbl->dmn, "Rule misc3 parameters contains a value not specified by mask\n");
			return false;
		}
	}
@@ -1221,7 +1221,7 @@ remove_action_members:
	dr_rule_remove_action_members(rule);
free_rule:
	kfree(rule);
	mlx5dr_info(dmn, "Failed creating rule\n");
	mlx5dr_err(dmn, "Failed creating rule\n");
	return NULL;
}

Loading