Skip to content

Commit

Permalink
net/mlx5: Add trace points for flow tables create/destroy
Browse files Browse the repository at this point in the history
We were not tracking flow tables so far, add it up.

Signed-off-by: Or Gerlitz <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
  • Loading branch information
ogerlitz authored and Saeed Mahameed committed Jan 25, 2019
1 parent 7112967 commit 8e4ca98
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ const char *parse_fs_dst(struct trace_seq *p,
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_del_fg);
EXPORT_TRACEPOINT_SYMBOL(mlx5_fs_set_fte);
Expand Down
35 changes: 35 additions & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,41 @@ const char *parse_fs_dst(struct trace_seq *p,
const struct mlx5_flow_destination *dst,
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,
TP_PROTO(const struct mlx5_flow_group *fg),
TP_ARGS(fg),
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ static void del_hw_flow_table(struct fs_node *node)
fs_get_obj(ft, node);
dev = get_dev(&ft->node);
root = find_root(&ft->node);
trace_mlx5_fs_del_ft(ft);

if (node->active) {
err = root->cmds->destroy_flow_table(dev, ft);
Expand Down Expand Up @@ -1019,6 +1020,7 @@ static struct mlx5_flow_table *__mlx5_create_flow_table(struct mlx5_flow_namespa
fs_prio->num_ft++;
up_write_ref_node(&fs_prio->node);
mutex_unlock(&root->chain_lock);
trace_mlx5_fs_add_ft(ft);
return ft;
destroy_ft:
root->cmds->destroy_flow_table(root->dev, ft);
Expand Down

0 comments on commit 8e4ca98

Please sign in to comment.