Skip to contentSkip to conversation

RoCE accelerator counters

PATCH In review Leon Romanovsky 2 participants 6 messages Jan 15, 2020 – Jan 16, 2020

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover RoCE accelerator counters

From: Leon Romanovsky <[email protected]>

Hi,

Very small change, separated to two patches due to our shared methodology.

Thanks

Avihai Horon (1):
IB/mlx5: Expose RoCE accelerator counters

Leon Romanovsky (1):
net/mlx5: Add RoCE accelerator counters

 drivers/infiniband/hw/mlx5/main.c | 18 ++++++++++++++++++
 include/linux/mlx5/mlx5_ifc.h     | 17 +++++++++++++++--
 2 files changed, 33 insertions(+), 2 deletions(-)

--
2.20.1

#1 lore raw

PATCH 1/2 net/mlx5: Add RoCE accelerator counters

From: Leon Romanovsky <[email protected]>

Add RoCE accelerator definitions.

---
 include/linux/mlx5/mlx5_ifc.h | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
include/linux/mlx5/mlx5_ifc.h +15 -2
index c6abaf4f1c55..73d1a6a049fb 100644
@@ -1197,7 +1197,8 @@ struct mlx5_ifc_cmd_hca_cap_bits {
 	u8         reserved_at_130[0xa];
 	u8         log_max_ra_res_dc[0x6];
 
-	u8         reserved_at_140[0xa];
+	u8         reserved_at_140[0x9];
+	u8         roce_accl[0x1];
 	u8         log_max_ra_req_qp[0x6];
 	u8         reserved_at_150[0xa];
 	u8         log_max_ra_res_qp[0x6];
@@ -4746,7 +4747,19 @@ struct mlx5_ifc_query_q_counter_out_bits {
 
 	u8         req_cqe_flush_error[0x20];
 
-	u8         reserved_at_620[0x1e0];
+	u8         reserved_at_620[0x20];
+
+	u8         roce_adp_retrans[0x20];
+
+	u8         roce_adp_retrans_to[0x20];
+
+	u8         roce_slow_restart[0x20];
+
+	u8         roce_slow_restart_cnps[0x20];
+
+	u8         roce_slow_restart_trans[0x20];
+
+	u8         reserved_at_6e0[0x120];
 };
 
 struct mlx5_ifc_query_q_counter_in_bits {
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/2 IB/mlx5: Expose RoCE accelerator counters

In reply to Leon Romanovsky

From: Avihai Horon <[email protected]>

Introduce the following RoCE accelerator counters:
* roce_adp_retrans - number of adaptive retransmission for RoCE traffic.
* roce_adp_retrans_to - number of times RoCE traffic reached time out due to adaptive retransmission.
* roce_slow_restart - number of times RoCE slow restart was used.
* roce_slow_restart_cnps - number of times RoCE slow restart generate CNP packets.
* roce_slow_restart_trans - number of times RoCE slow restart change state to slow restart.

---
 drivers/infiniband/hw/mlx5/main.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drivers/infiniband/hw/mlx5/main.c +18 -0
index 97bcf01960ae..5d41a2c69400 100644
@@ -5370,6 +5370,14 @@ static const struct mlx5_ib_counter extended_err_cnts[] = {
 	INIT_Q_COUNTER(req_cqe_flush_error),
 };
 
+static const struct mlx5_ib_counter roce_accl_cnts[] = {
+	INIT_Q_COUNTER(roce_adp_retrans),
+	INIT_Q_COUNTER(roce_adp_retrans_to),
+	INIT_Q_COUNTER(roce_slow_restart),
+	INIT_Q_COUNTER(roce_slow_restart_cnps),
+	INIT_Q_COUNTER(roce_slow_restart_trans),
+};
+
 #define INIT_EXT_PPCNT_COUNTER(_name)		\
 	{ .name = #_name, .offset =	\
 	MLX5_BYTE_OFF(ppcnt_reg, \
@@ -5418,6 +5426,9 @@ static int __mlx5_ib_alloc_counters(struct mlx5_ib_dev *dev,
 	if (MLX5_CAP_GEN(dev->mdev, enhanced_error_q_counters))
 		num_counters += ARRAY_SIZE(extended_err_cnts);
 
+	if (MLX5_CAP_GEN(dev->mdev, roce_accl))
+		num_counters += ARRAY_SIZE(roce_accl_cnts);
+
 	cnts->num_q_counters = num_counters;
 
 	if (MLX5_CAP_GEN(dev->mdev, cc_query_allowed)) {
@@ -5478,6 +5489,13 @@ static void mlx5_ib_fill_counters(struct mlx5_ib_dev *dev,
 		}
 	}
 
+	if (MLX5_CAP_GEN(dev->mdev, roce_accl)) {
+		for (i = 0; i < ARRAY_SIZE(roce_accl_cnts); i++, j++) {
+			names[j] = roce_accl_cnts[i].name;
+			offsets[j] = roce_accl_cnts[i].offset;
+		}
+	}
+
 	if (MLX5_CAP_GEN(dev->mdev, cc_query_allowed)) {
 		for (i = 0; i < ARRAY_SIZE(cong_cnts); i++, j++) {
 			names[j] = cong_cnts[i].name;
Signature · 1 line
2.20.1
#3 lore raw
In reply to Leon Romanovsky
Quoted 6 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

Hi,

Very small change, separated to two patches due to our shared methodology.

Quoted 7 lines

Thanks

Avihai Horon (1):
IB/mlx5: Expose RoCE accelerator counters

Leon Romanovsky (1):
net/mlx5: Add RoCE accelerator counters

Looks fine to me, can you update the shared branch?

Thanks,
Jason

author Applied
#4 lore raw
Quoted 9 lines · Jason Gunthorpe
Quoted 8 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

Hi,

Very small change, separated to two patches due to our shared methodology.

Thanks

Quoted 7 lines
Quoted 5 lines

Avihai Horon (1):
IB/mlx5: Expose RoCE accelerator counters

Leon Romanovsky (1):
net/mlx5: Add RoCE accelerator counters

Looks fine to me, can you update the shared branch?

Thanks, applied
8cbf17c14f9b net/mlx5: Add RoCE accelerator counters

Quoted 3 lines

Thanks,
Jason

#5 lore raw
Quoted 13 lines · Leon Romanovsky
Quoted 12 lines · Jason Gunthorpe
Quoted 11 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

Hi,

Very small change, separated to two patches due to our shared methodology.

Thanks

Avihai Horon (1):
IB/mlx5: Expose RoCE accelerator counters

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Leon Romanovsky (1):
net/mlx5: Add RoCE accelerator counters

Looks fine to me, can you update the shared branch?

Thanks, applied
8cbf17c14f9b net/mlx5: Add RoCE accelerator counters

Okay, applied to for-next

Thanks,
Jason