Skip to content

Commit

Permalink
net/mlx5: qos: Add an explicit 'dev' to vport trace calls
Browse files Browse the repository at this point in the history
vport qos trace calls used vport->dev implicitly as the device to which
the command was sent (and thus the device logged in traces).
But that will no longer be the case for cross-esw scheduling, where the
commands have to be sent to the group esw device instead.

This commit corrects that.

Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Cosmin Ratiu authored and Paolo Abeni committed Oct 10, 2024
1 parent b9cfe19 commit 0c4cf09
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
23 changes: 13 additions & 10 deletions drivers/net/ethernet/mellanox/mlx5/core/esw/diag/qos_tracepoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#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))
TP_PROTO(const struct mlx5_core_dev *dev, const struct mlx5_vport *vport),
TP_ARGS(dev, vport),
TP_STRUCT__entry(__string(devname, dev_name(dev->device))
__field(unsigned short, vport_id)
__field(unsigned int, sched_elem_ix)
),
Expand All @@ -27,9 +27,10 @@ TRACE_EVENT(mlx5_esw_vport_qos_destroy,
);

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))
TP_PROTO(const struct mlx5_core_dev *dev, const struct mlx5_vport *vport,
u32 bw_share, u32 max_rate),
TP_ARGS(dev, vport, bw_share, max_rate),
TP_STRUCT__entry(__string(devname, dev_name(dev->device))
__field(unsigned short, vport_id)
__field(unsigned int, sched_elem_ix)
__field(unsigned int, bw_share)
Expand All @@ -50,13 +51,15 @@ DECLARE_EVENT_CLASS(mlx5_esw_vport_qos_template,
);

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)
TP_PROTO(const struct mlx5_core_dev *dev, const struct mlx5_vport *vport,
u32 bw_share, u32 max_rate),
TP_ARGS(dev, 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)
TP_PROTO(const struct mlx5_core_dev *dev, const struct mlx5_vport *vport,
u32 bw_share, u32 max_rate),
TP_ARGS(dev, vport, bw_share, max_rate)
);

DECLARE_EVENT_CLASS(mlx5_esw_group_qos_template,
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static int esw_qos_vport_config(struct mlx5_vport *vport,
return err;
}

trace_mlx5_esw_vport_qos_config(vport, bw_share, max_rate);
trace_mlx5_esw_vport_qos_config(dev, vport, bw_share, max_rate);

return 0;
}
Expand Down Expand Up @@ -675,7 +675,7 @@ static int esw_qos_vport_enable(struct mlx5_vport *vport,
goto err_out;

vport->qos.enabled = true;
trace_mlx5_esw_vport_qos_create(vport, bw_share, max_rate);
trace_mlx5_esw_vport_qos_create(vport->dev, vport, bw_share, max_rate);

return 0;

Expand Down Expand Up @@ -707,7 +707,7 @@ void mlx5_esw_qos_vport_disable(struct mlx5_vport *vport)
vport->vport, err);

memset(&vport->qos, 0, sizeof(vport->qos));
trace_mlx5_esw_vport_qos_destroy(vport);
trace_mlx5_esw_vport_qos_destroy(dev, vport);

esw_qos_put(esw);
}
Expand Down

0 comments on commit 0c4cf09

Please sign in to comment.