-
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.
net/mlx5: E-switch, Add QoS tracepoints
Add tracepoints to log QoS enabling/disabling/configuration for vports and rate groups. Signed-off-by: Dmytro Linkin <dlinkin@nvidia.com> Reviewed-by: Huy Nguyen <huyn@nvidia.com> Reviewed-by: Mark Bloch <mbloch@nvidia.com> Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
- Loading branch information
Dmytro Linkin
authored and
Saeed Mahameed
committed
Aug 20, 2021
1 parent
0fe132e
commit 3202ea6
Showing
3 changed files
with
179 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
123 changes: 123 additions & 0 deletions
123
drivers/net/ethernet/mellanox/mlx5/core/esw/diag/qos_tracepoint.h
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,123 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ | ||
/* Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ | ||
|
||
#undef TRACE_SYSTEM | ||
#define TRACE_SYSTEM mlx5 | ||
|
||
#if !defined(_MLX5_ESW_TP_) || defined(TRACE_HEADER_MULTI_READ) | ||
#define _MLX5_ESW_TP_ | ||
|
||
#include <linux/tracepoint.h> | ||
#include "eswitch.h" | ||
|
||
TRACE_EVENT(mlx5_esw_vport_qos_destroy, | ||
TP_PROTO(const struct mlx5_vport *vport), | ||
TP_ARGS(vport), | ||
TP_STRUCT__entry(__string(devname, dev_name(vport->dev->device)) | ||
__field(unsigned short, vport_id) | ||
__field(unsigned int, tsar_ix) | ||
), | ||
TP_fast_assign(__assign_str(devname, dev_name(vport->dev->device)); | ||
__entry->vport_id = vport->vport; | ||
__entry->tsar_ix = vport->qos.esw_tsar_ix; | ||
), | ||
TP_printk("(%s) vport=%hu tsar_ix=%u\n", | ||
__get_str(devname), __entry->vport_id, __entry->tsar_ix | ||
) | ||
); | ||
|
||
DECLARE_EVENT_CLASS(mlx5_esw_vport_qos_template, | ||
TP_PROTO(const struct mlx5_vport *vport, u32 bw_share, u32 max_rate), | ||
TP_ARGS(vport, bw_share, max_rate), | ||
TP_STRUCT__entry(__string(devname, dev_name(vport->dev->device)) | ||
__field(unsigned short, vport_id) | ||
__field(unsigned int, tsar_ix) | ||
__field(unsigned int, bw_share) | ||
__field(unsigned int, max_rate) | ||
__field(void *, group) | ||
), | ||
TP_fast_assign(__assign_str(devname, dev_name(vport->dev->device)); | ||
__entry->vport_id = vport->vport; | ||
__entry->tsar_ix = vport->qos.esw_tsar_ix; | ||
__entry->bw_share = bw_share; | ||
__entry->max_rate = max_rate; | ||
__entry->group = vport->qos.group; | ||
), | ||
TP_printk("(%s) vport=%hu tsar_ix=%u bw_share=%u, max_rate=%u group=%p\n", | ||
__get_str(devname), __entry->vport_id, __entry->tsar_ix, | ||
__entry->bw_share, __entry->max_rate, __entry->group | ||
) | ||
); | ||
|
||
DEFINE_EVENT(mlx5_esw_vport_qos_template, mlx5_esw_vport_qos_create, | ||
TP_PROTO(const struct mlx5_vport *vport, u32 bw_share, u32 max_rate), | ||
TP_ARGS(vport, bw_share, max_rate) | ||
); | ||
|
||
DEFINE_EVENT(mlx5_esw_vport_qos_template, mlx5_esw_vport_qos_config, | ||
TP_PROTO(const struct mlx5_vport *vport, u32 bw_share, u32 max_rate), | ||
TP_ARGS(vport, bw_share, max_rate) | ||
); | ||
|
||
DECLARE_EVENT_CLASS(mlx5_esw_group_qos_template, | ||
TP_PROTO(const struct mlx5_core_dev *dev, | ||
const struct mlx5_esw_rate_group *group, | ||
unsigned int tsar_ix), | ||
TP_ARGS(dev, group, tsar_ix), | ||
TP_STRUCT__entry(__string(devname, dev_name(dev->device)) | ||
__field(const void *, group) | ||
__field(unsigned int, tsar_ix) | ||
), | ||
TP_fast_assign(__assign_str(devname, dev_name(dev->device)); | ||
__entry->group = group; | ||
__entry->tsar_ix = tsar_ix; | ||
), | ||
TP_printk("(%s) group=%p tsar_ix=%u\n", | ||
__get_str(devname), __entry->group, __entry->tsar_ix | ||
) | ||
); | ||
|
||
DEFINE_EVENT(mlx5_esw_group_qos_template, mlx5_esw_group_qos_create, | ||
TP_PROTO(const struct mlx5_core_dev *dev, | ||
const struct mlx5_esw_rate_group *group, | ||
unsigned int tsar_ix), | ||
TP_ARGS(dev, group, tsar_ix) | ||
); | ||
|
||
DEFINE_EVENT(mlx5_esw_group_qos_template, mlx5_esw_group_qos_destroy, | ||
TP_PROTO(const struct mlx5_core_dev *dev, | ||
const struct mlx5_esw_rate_group *group, | ||
unsigned int tsar_ix), | ||
TP_ARGS(dev, group, tsar_ix) | ||
); | ||
|
||
TRACE_EVENT(mlx5_esw_group_qos_config, | ||
TP_PROTO(const struct mlx5_core_dev *dev, | ||
const struct mlx5_esw_rate_group *group, | ||
unsigned int tsar_ix, u32 bw_share, u32 max_rate), | ||
TP_ARGS(dev, group, tsar_ix, bw_share, max_rate), | ||
TP_STRUCT__entry(__string(devname, dev_name(dev->device)) | ||
__field(const void *, group) | ||
__field(unsigned int, tsar_ix) | ||
__field(unsigned int, bw_share) | ||
__field(unsigned int, max_rate) | ||
), | ||
TP_fast_assign(__assign_str(devname, dev_name(dev->device)); | ||
__entry->group = group; | ||
__entry->tsar_ix = tsar_ix; | ||
__entry->bw_share = bw_share; | ||
__entry->max_rate = max_rate; | ||
), | ||
TP_printk("(%s) group=%p tsar_ix=%u bw_share=%u max_rate=%u\n", | ||
__get_str(devname), __entry->group, __entry->tsar_ix, | ||
__entry->bw_share, __entry->max_rate | ||
) | ||
); | ||
#endif /* _MLX5_ESW_TP_ */ | ||
|
||
/* This part must be outside protection */ | ||
#undef TRACE_INCLUDE_PATH | ||
#define TRACE_INCLUDE_PATH esw/diag | ||
#undef TRACE_INCLUDE_FILE | ||
#define TRACE_INCLUDE_FILE qos_tracepoint | ||
#include <trace/define_trace.h> |
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