Commit 3e18bcb7 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge tag 'mlx5-updates-2022-03-09' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
mlx5-updates-2022-03-09

1) Remove kernel log prints on FW events regarding FW pages management
   and replace that with debugfs entries to track FW pages management commands
   failures and general stats, we do that for all FW commands in general since
   it's the same effort to do so under the already existing debugfs entry for
   FW commands.

2) Add support for ConnectX-7 Software managed steering, in other words STEv2
   which shares a lot in common with STE V1, the difference is in specific
   offsets in the devices, the logic is almost the same, thus we implement
   STEv1 and STEv2 in the same file.

* tag 'mlx5-updates-2022-03-09' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux:
  net/mlx5: DR, Add support for ConnectX-7 steering
  net/mlx5: DR, Refactor ste_ctx handling for STE v0/1
  net/mlx5: DR, Rename action modify fields to reflect naming in HW spec
  net/mlx5: DR, Fix handling of different actions on the same STE in STEv1
  net/mlx5: DR, Remove unneeded comments
  net/mlx5: DR, Add support for matching on Internet Header Length (IHL)
  net/mlx5: DR, Align mlx5dv_dr API vport action with FW behavior
  net/mlx5: Add debugfs counters for page commands failures
  net/mlx5: Add pages debugfs
  net/mlx5: Move debugfs entries to separate struct
  net/mlx5: Change release_all_pages cap bit location
  net/mlx5: Remove redundant error on reclaim pages
  net/mlx5: Remove redundant error on give pages
  net/mlx5: Remove redundant notify fail on give pages
  net/mlx5: Add command failures data to debugfs
  net/mlx5e: TC, Fix use after free in mlx5e_clone_flow_attr_for_post_act()
====================

Link: https://lore.kernel.org/r/20220309213755.610202-1-saeed@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 2a9eef86 6862c787
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -433,8 +433,7 @@ void mlx5_ib_init_cong_debugfs(struct mlx5_ib_dev *dev, u32 port_num)

	dev->port[port_num].dbg_cc_params = dbg_cc_params;

	dbg_cc_params->root = debugfs_create_dir("cc_params",
						 mdev->priv.dbg_root);
	dbg_cc_params->root = debugfs_create_dir("cc_params", mlx5_debugfs_get_dev_root(mdev));

	for (i = 0; i < MLX5_IB_DBG_CC_MAX; i++) {
		dbg_cc_params->params[i].offset = i;
+1 −1
Original line number Diff line number Diff line
@@ -4178,7 +4178,7 @@ static int mlx5_ib_stage_delay_drop_init(struct mlx5_ib_dev *dev)
	if (!mlx5_debugfs_root)
		return 0;

	root = debugfs_create_dir("delay_drop", dev->mdev->priv.dbg_root);
	root = debugfs_create_dir("delay_drop", mlx5_debugfs_get_dev_root(dev->mdev));
	dev->delay_drop.dir_debugfs = root;

	debugfs_create_atomic_t("num_timeout_events", 0400, root,
+1 −1
Original line number Diff line number Diff line
@@ -696,7 +696,7 @@ static void mlx5_mr_cache_debugfs_init(struct mlx5_ib_dev *dev)
	if (!mlx5_debugfs_root || dev->is_rep)
		return;

	cache->root = debugfs_create_dir("mr_cache", dev->mdev->priv.dbg_root);
	cache->root = debugfs_create_dir("mr_cache", mlx5_debugfs_get_dev_root(dev->mdev));

	for (i = 0; i < MAX_MR_CACHE_ENTRIES; i++) {
		ent = &cache->ent[i];
+1 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ mlx5_core-$(CONFIG_MLX5_SW_STEERING) += steering/dr_domain.o steering/dr_table.o
					steering/dr_icm_pool.o steering/dr_buddy.o \
					steering/dr_ste.o steering/dr_send.o \
					steering/dr_ste_v0.o steering/dr_ste_v1.o \
					steering/dr_ste_v2.o \
					steering/dr_cmd.o steering/dr_fw.o \
					steering/dr_action.o steering/fs_dr.o \
					steering/dr_dbg.o
+36 −10
Original line number Diff line number Diff line
@@ -1543,7 +1543,7 @@ static void create_debugfs_files(struct mlx5_core_dev *dev)
{
	struct mlx5_cmd_debug *dbg = &dev->cmd.dbg;

	dbg->dbg_root = debugfs_create_dir("cmd", dev->priv.dbg_root);
	dbg->dbg_root = debugfs_create_dir("cmd", mlx5_debugfs_get_dev_root(dev));

	debugfs_create_file("in", 0400, dbg->dbg_root, dev, &dfops);
	debugfs_create_file("out", 0200, dbg->dbg_root, dev, &dfops);
@@ -1877,16 +1877,38 @@ static int cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out,
	return err;
}

static void cmd_status_log(struct mlx5_core_dev *dev, u16 opcode, u8 status, int err)
{
	struct mlx5_cmd_stats *stats;

	if (!err)
		return;

	stats = &dev->cmd.stats[opcode];
	spin_lock_irq(&stats->lock);
	stats->failed++;
	if (err < 0)
		stats->last_failed_errno = -err;
	if (err == -EREMOTEIO) {
		stats->failed_mbox_status++;
		stats->last_failed_mbox_status = status;
	}
	spin_unlock_irq(&stats->lock);
}

/* preserve -EREMOTEIO for outbox.status != OK, otherwise return err as is */
static int cmd_status_err(int err, void *out)
static int cmd_status_err(struct mlx5_core_dev *dev, int err, u16 opcode, void *out)
{
	if (err) /* -EREMOTEIO is preserved */
		return err == -EREMOTEIO ? -EIO : err;
	u8 status = MLX5_GET(mbox_out, out, status);

	if (MLX5_GET(mbox_out, out, status) != MLX5_CMD_STAT_OK)
		return -EREMOTEIO;
	if (err == -EREMOTEIO) /* -EREMOTEIO is preserved */
		err = -EIO;

	return 0;
	if (!err && status != MLX5_CMD_STAT_OK)
		err = -EREMOTEIO;

	cmd_status_log(dev, opcode, status, err);
	return err;
}

/**
@@ -1910,8 +1932,10 @@ static int cmd_status_err(int err, void *out)
int mlx5_cmd_do(struct mlx5_core_dev *dev, void *in, int in_size, void *out, int out_size)
{
	int err = cmd_exec(dev, in, in_size, out, out_size, NULL, NULL, false);
	u16 opcode = MLX5_GET(mbox_in, in, opcode);

	return cmd_status_err(err, out);
	err = cmd_status_err(dev, err, opcode, out);
	return err;
}
EXPORT_SYMBOL(mlx5_cmd_do);

@@ -1954,8 +1978,9 @@ int mlx5_cmd_exec_polling(struct mlx5_core_dev *dev, void *in, int in_size,
			  void *out, int out_size)
{
	int err = cmd_exec(dev, in, in_size, out, out_size, NULL, NULL, true);
	u16 opcode = MLX5_GET(mbox_in, in, opcode);

	err = cmd_status_err(err, out);
	err = cmd_status_err(dev, err, opcode, out);
	return mlx5_cmd_check(dev, err, in, out);
}
EXPORT_SYMBOL(mlx5_cmd_exec_polling);
@@ -1991,7 +2016,7 @@ static void mlx5_cmd_exec_cb_handler(int status, void *_work)
	struct mlx5_async_ctx *ctx;

	ctx = work->ctx;
	status = cmd_status_err(status, work->out);
	status = cmd_status_err(ctx->dev, status, work->opcode, work->out);
	work->user_callback(status, work);
	if (atomic_dec_and_test(&ctx->num_inflight))
		wake_up(&ctx->wait);
@@ -2005,6 +2030,7 @@ int mlx5_cmd_exec_cb(struct mlx5_async_ctx *ctx, void *in, int in_size,

	work->ctx = ctx;
	work->user_callback = callback;
	work->opcode = MLX5_GET(mbox_in, in, opcode);
	work->out = out;
	if (WARN_ON(!atomic_inc_not_zero(&ctx->num_inflight)))
		return -EIO;
Loading