RoCE ICRC counter
Subsystems (5)
cover RoCE ICRC counter
From: Leon Romanovsky <[email protected]>
Hi,
This series exposes RoCE ICRC counter through existing RDMA hw_counters sysfs interface.
First patch has all HW definitions in mlx5_ifc.h file and second patch is actual counter implementation.
Thanks
Talat Batheesh (2):
net/mlx5: Add RoCE RX ICRC encapsulated counter IB/mlx5: Support RoCE ICRC encapsulated error counter
drivers/infiniband/hw/mlx5/cmd.c | 12 +++++++ drivers/infiniband/hw/mlx5/cmd.h | 1 + drivers/infiniband/hw/mlx5/main.c | 62 ++++++++++++++++++++++++++++++++++-- drivers/infiniband/hw/mlx5/mlx5_ib.h | 1 + include/linux/mlx5/mlx5_ifc.h | 11 +++++-- 5 files changed, 81 insertions(+), 6 deletions(-)
PATCH 1/2 net/mlx5: Add RoCE RX ICRC encapsulated counter
From: Talat Batheesh <[email protected]>
Add capability bit in PCAM register and RoCE ICRC error counter to PPCNT register.
--- include/linux/mlx5/mlx5_ifc.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
include/linux/mlx5/mlx5_ifc.h +8 -3
@@ -1687,7 +1687,11 @@ struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits {u8 rx_buffer_full_low[0x20 ]; -u8 reserved_at_1c0[0x600 ]; +u8 rx_icrc_encapsulated_high[0x20 ]; + +u8 rx_icrc_encapsulated_low[0x20 ]; + +u8 reserved_at_3c0[0x5c0 ]; };struct mlx5_ifc_eth_3635_cntrs_grp_data_layout_bits {
@@ -8050,8 +8054,9 @@ struct mlx5_ifc_peir_reg_bits { };struct mlx5_ifc_pcam_enhanced_features_bits { -u8 reserved_at_0[0x76 ]; - +u8 reserved_at_0[0x6d ]; +u8 rx_icrc_encapsulated_counter[0x1 ]; +u8 reserved_at_6e[0x8 ];u8 pfcc_mask[0x1 ];u8 reserved_at_77[0x4 ];u8 rx_buffer_fullness_counters[0x1 ];
Signature · 1 line
2.14.4
PATCH 2/2 IB/mlx5: Support RoCE ICRC encapsulated error counter
In reply to Leon RomanovskyFrom: Talat Batheesh <[email protected]>
This patch adds support to query the counter that counts the RoCE packets with corrupted ICRC (Invariant Cyclic Redundancy Code).
This counter will be under /sys/class/infiniband/<mlx5-dev>/ports/<port>/hw_counters/
rx_icrc_encapsulated - The number of RoCE packets with ICRC error.
--- drivers/infiniband/hw/mlx5/cmd.c | 12 +++++++ drivers/infiniband/hw/mlx5/cmd.h | 1 + drivers/infiniband/hw/mlx5/main.c | 62 ++++++++++++++++++++++++++++++++++-- drivers/infiniband/hw/mlx5/mlx5_ib.h | 1 + 4 files changed, 73 insertions(+), 3 deletions(-)
drivers/infiniband/hw/mlx5/cmd.c +12 -0
@@ -185,3 +185,15 @@ int mlx5_cmd_dealloc_memic(struct mlx5_memic *memic, u64 addr, u64 length)return err; } + +int mlx5_cmd_query_ext_ppcnt_counters (struct mlx5_core_dev *dev,void *out) +{ +u32 in[MLX5_ST_SZ_DW (ppcnt_reg)] = {}; +int sz =MLX5_ST_SZ_BYTES (ppcnt_reg); + +MLX5_SET (ppcnt_reg, in, local_port,1 ); + +MLX5_SET (ppcnt_reg, in, grp,MLX5_ETHERNET_EXTENDED_COUNTERS_GROUP ); +return mlx5_core_access_reg (dev, in, sz, out, sz,MLX5_REG_PPCNT , +0 ,0 ); +}
drivers/infiniband/hw/mlx5/cmd.h +1 -0
@@ -41,6 +41,7 @@ int mlx5_cmd_dump_fill_mkey(struct mlx5_core_dev *dev, u32 *mkey);int mlx5_cmd_null_mkey (struct mlx5_core_dev *dev,u32 *null_mkey);int mlx5_cmd_query_cong_params (struct mlx5_core_dev *dev,int cong_point,void *out,int out_size); +int mlx5_cmd_query_ext_ppcnt_counters (struct mlx5_core_dev *dev,void *out);int mlx5_cmd_modify_cong_params (struct mlx5_core_dev *mdev,void *in,int in_size); int mlx5_cmd_alloc_memic(struct mlx5_memic *memic, phys_addr_t *addr,
drivers/infiniband/hw/mlx5/main.c +59 -3
104 lines not on this page · raw message
drivers/infiniband/hw/mlx5/mlx5_ib.h +1 -0
@@ -666,6 +666,7 @@ struct mlx5_ib_counters {size_t *offsets;u32 num_q_counters;u32 num_cong_counters; +u32 num_ext_ppcnt_counters;u16 set_id;bool set_id_valid; };
Signature · 1 line
2.14.4
Quoted 9 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
Hi,
This series exposes RoCE ICRC counter through existing RDMA
hw_counterssysfs interface.First patch has all HW definitions in
mlx5_ifc.hfile and second patch is actual counter implementation.
The RDMA parts are OK, can you please send me the commit for the mlx5 patch when applied?
Thanks,
Jason
Re: [PATCH mlx5-next 1/2] net/mlx5: Add RoCE RX ICRC encapsulated counter
In reply to Leon RomanovskyQuoted 17 lines · Leon Romanovsky
From: Talat Batheesh <[email protected]>
Add capability bit in PCAM register and RoCE ICRC error counter to PPCNT register.
Signed-off-by Talat Batheesh <[email protected]>Reviewed-by Mark Bloch <[email protected]>Signed-off-by Leon Romanovsky <[email protected]>--- include/linux/mlx5/mlx5_ifc.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)include/linux/mlx5/mlx5_ifc.h +0
-0
include/linux/mlx5/mlx5_ifc.h struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits { · line 1694
Quoted 9 lines
include/linux/mlx5/mlx5_ifc.h +5
-1@@ -1687,7 +1687,11 @@ struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits {u8 rx_buffer_full_low[0x20 ]; -u8 reserved_at_1c0[0x600 ]; +u8 rx_icrc_encapsulated_high[0x20 ]; + +u8 rx_icrc_encapsulated_low[0x20 ]; + +u8 reserved_at_3c0[0x5c0 ];
reserved_at_3c0 should be reserved_at_200, fixed and applied to mlx5-next.
Commit 0af5107cd0640ee3424e337b492e4b11b450ce28 in mlx5-next.
Thanks
Jason Gunthorpe
AppliedQuoted 16 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
Hi,
This series exposes RoCE ICRC counter through existing RDMA
hw_counterssysfs interface.First patch has all HW definitions in
mlx5_ifc.hfile and second patch is actual counter implementation.Thanks
Talat Batheesh (2):
net/mlx5: Add RoCE RX ICRC encapsulated counter IB/mlx5: Support RoCE ICRC encapsulated error counter
Quoted 6 lines
drivers/infiniband/hw/mlx5/cmd.c | 12 +++++++ drivers/infiniband/hw/mlx5/cmd.h | 1 + drivers/infiniband/hw/mlx5/main.c | 62 ++++++++++++++++++++++++++++++++++-- drivers/infiniband/hw/mlx5/mlx5_ib.h | 1 + include/linux/mlx5/mlx5_ifc.h | 11 +++++-- 5 files changed, 81 insertions(+), 6 deletions(-)
Applied to rdma for-next with the mellanox/mlx5-next branch
Thanks,
Jason