Commit 8e4ca986 authored by Or Gerlitz's avatar Or Gerlitz Committed by Saeed Mahameed

net/mlx5: Add trace points for flow tables create/destroy

We were not tracking flow tables so far, add it up.
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent 71129676
...@@ -258,6 +258,8 @@ const char *parse_fs_dst(struct trace_seq *p, ...@@ -258,6 +258,8 @@ const char *parse_fs_dst(struct trace_seq *p,
return ret; return ret;
} }
EXPORT_TRACEPOINT_SYMBOL(mlx5_fs_add_ft);
EXPORT_TRACEPOINT_SYMBOL(mlx5_fs_del_ft);
EXPORT_TRACEPOINT_SYMBOL(mlx5_fs_add_fg); EXPORT_TRACEPOINT_SYMBOL(mlx5_fs_add_fg);
EXPORT_TRACEPOINT_SYMBOL(mlx5_fs_del_fg); EXPORT_TRACEPOINT_SYMBOL(mlx5_fs_del_fg);
EXPORT_TRACEPOINT_SYMBOL(mlx5_fs_set_fte); EXPORT_TRACEPOINT_SYMBOL(mlx5_fs_set_fte);
......
...@@ -61,6 +61,41 @@ const char *parse_fs_dst(struct trace_seq *p, ...@@ -61,6 +61,41 @@ const char *parse_fs_dst(struct trace_seq *p,
const struct mlx5_flow_destination *dst, const struct mlx5_flow_destination *dst,
u32 counter_id); u32 counter_id);
TRACE_EVENT(mlx5_fs_add_ft,
TP_PROTO(const struct mlx5_flow_table *ft),
TP_ARGS(ft),
TP_STRUCT__entry(
__field(const struct mlx5_flow_table *, ft)
__field(u32, id)
__field(u32, level)
__field(u32, type)
),
TP_fast_assign(
__entry->ft = ft;
__entry->id = ft->id;
__entry->level = ft->level;
__entry->type = ft->type;
),
TP_printk("ft=%p id=%u level=%u type=%u \n",
__entry->ft, __entry->id, __entry->level, __entry->type)
);
TRACE_EVENT(mlx5_fs_del_ft,
TP_PROTO(const struct mlx5_flow_table *ft),
TP_ARGS(ft),
TP_STRUCT__entry(
__field(const struct mlx5_flow_table *, ft)
__field(u32, id)
),
TP_fast_assign(
__entry->ft = ft;
__entry->id = ft->id;
),
TP_printk("ft=%p id=%u\n",
__entry->ft, __entry->id)
);
TRACE_EVENT(mlx5_fs_add_fg, TRACE_EVENT(mlx5_fs_add_fg,
TP_PROTO(const struct mlx5_flow_group *fg), TP_PROTO(const struct mlx5_flow_group *fg),
TP_ARGS(fg), TP_ARGS(fg),
......
...@@ -397,6 +397,7 @@ static void del_hw_flow_table(struct fs_node *node) ...@@ -397,6 +397,7 @@ static void del_hw_flow_table(struct fs_node *node)
fs_get_obj(ft, node); fs_get_obj(ft, node);
dev = get_dev(&ft->node); dev = get_dev(&ft->node);
root = find_root(&ft->node); root = find_root(&ft->node);
trace_mlx5_fs_del_ft(ft);
if (node->active) { if (node->active) {
err = root->cmds->destroy_flow_table(dev, ft); err = root->cmds->destroy_flow_table(dev, ft);
...@@ -1019,6 +1020,7 @@ static struct mlx5_flow_table *__mlx5_create_flow_table(struct mlx5_flow_namespa ...@@ -1019,6 +1020,7 @@ static struct mlx5_flow_table *__mlx5_create_flow_table(struct mlx5_flow_namespa
fs_prio->num_ft++; fs_prio->num_ft++;
up_write_ref_node(&fs_prio->node); up_write_ref_node(&fs_prio->node);
mutex_unlock(&root->chain_lock); mutex_unlock(&root->chain_lock);
trace_mlx5_fs_add_ft(ft);
return ft; return ft;
destroy_ft: destroy_ft:
root->cmds->destroy_flow_table(root->dev, ft); root->cmds->destroy_flow_table(root->dev, ft);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment