-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add debugfs subtree and expose flow table ID and TIR number. This information can be used by external tools to do extended troubleshooting. The information can be retrieved like so: $ cat /sys/kernel/debug/mlx5/mlx5_core.sf.1/vdpa-0/rx/table_id $ cat /sys/kernel/debug/mlx5/mlx5_core.sf.1/vdpa-0/rx/tirn Reviewed-by: Si-Wei Liu <si-wei.liu@oracle.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Eli Cohen <elic@nvidia.com> Message-Id: <20221114131759.57883-8-elic@nvidia.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
- Loading branch information
Eli Cohen
authored and
Michael S. Tsirkin
committed
Feb 21, 2023
1 parent
72c67e9
commit 2942210
Showing
4 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
subdir-ccflags-y += -I$(srctree)/drivers/vdpa/mlx5/core | ||
|
||
obj-$(CONFIG_MLX5_VDPA_NET) += mlx5_vdpa.o | ||
mlx5_vdpa-$(CONFIG_MLX5_VDPA_NET) += net/mlx5_vnet.o core/resources.o core/mr.o | ||
mlx5_vdpa-$(CONFIG_MLX5_VDPA_NET) += net/mlx5_vnet.o core/resources.o core/mr.o net/debug.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB | ||
/* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ | ||
|
||
#include <linux/debugfs.h> | ||
#include <linux/mlx5/fs.h> | ||
#include "mlx5_vnet.h" | ||
|
||
static int tirn_show(struct seq_file *file, void *priv) | ||
{ | ||
struct mlx5_vdpa_net *ndev = file->private; | ||
|
||
seq_printf(file, "0x%x\n", ndev->res.tirn); | ||
return 0; | ||
} | ||
|
||
DEFINE_SHOW_ATTRIBUTE(tirn); | ||
|
||
void mlx5_vdpa_remove_tirn(struct mlx5_vdpa_net *ndev) | ||
{ | ||
if (ndev->debugfs) | ||
debugfs_remove(ndev->res.tirn_dent); | ||
} | ||
|
||
void mlx5_vdpa_add_tirn(struct mlx5_vdpa_net *ndev) | ||
{ | ||
ndev->res.tirn_dent = debugfs_create_file("tirn", 0444, ndev->rx_dent, | ||
ndev, &tirn_fops); | ||
} | ||
|
||
static int rx_flow_table_show(struct seq_file *file, void *priv) | ||
{ | ||
struct mlx5_vdpa_net *ndev = file->private; | ||
|
||
seq_printf(file, "0x%x\n", mlx5_flow_table_id(ndev->rxft)); | ||
return 0; | ||
} | ||
|
||
DEFINE_SHOW_ATTRIBUTE(rx_flow_table); | ||
|
||
void mlx5_vdpa_remove_rx_flow_table(struct mlx5_vdpa_net *ndev) | ||
{ | ||
if (ndev->debugfs) | ||
debugfs_remove(ndev->rx_table_dent); | ||
} | ||
|
||
void mlx5_vdpa_add_rx_flow_table(struct mlx5_vdpa_net *ndev) | ||
{ | ||
ndev->rx_table_dent = debugfs_create_file("table_id", 0444, ndev->rx_dent, | ||
ndev, &rx_flow_table_fops); | ||
} | ||
|
||
void mlx5_vdpa_add_debugfs(struct mlx5_vdpa_net *ndev) | ||
{ | ||
struct mlx5_core_dev *mdev; | ||
|
||
mdev = ndev->mvdev.mdev; | ||
ndev->debugfs = debugfs_create_dir(dev_name(&ndev->mvdev.vdev.dev), | ||
mlx5_debugfs_get_dev_root(mdev)); | ||
if (!IS_ERR(ndev->debugfs)) | ||
ndev->rx_dent = debugfs_create_dir("rx", ndev->debugfs); | ||
} | ||
|
||
void mlx5_vdpa_remove_debugfs(struct dentry *dbg) | ||
{ | ||
debugfs_remove_recursive(dbg); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters