Skip to contentSkip to conversation

Add XRQ and SRQ support to DEVX interface

PATCH Applied Leon Romanovsky 3 participants 9 messages Aug 8, 2019 – Aug 13, 2019

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

cover Add XRQ and SRQ support to DEVX interface

From: Leon Romanovsky <[email protected]>

Hi,

This small series extends DEVX interface with SRQ and XRQ legacy commands.

Thanks

Yishai Hadas (4):
net/mlx5: Use debug message instead of warn net/mlx5: Add XRQ legacy commands opcodes IB/mlx5: Add legacy events to DEVX list
IB/mlx5: Expose XRQ legacy commands over the DEVX interface

 drivers/infiniband/hw/mlx5/devx.c             | 12 ++++++++++++
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c |  4 ++++
 drivers/net/ethernet/mellanox/mlx5/core/qp.c  |  2 +-
 include/linux/mlx5/device.h                   |  9 +++++++++
 include/linux/mlx5/mlx5_ifc.h                 |  2 ++
 5 files changed, 28 insertions(+), 1 deletion(-)

--
2.20.1

#1 lore raw

PATCH 1/4 net/mlx5: Use debug message instead of warn

From: Yishai Hadas <[email protected]>

As QP may be created by DEVX, it may be valid to not find the rsn in mlx5 core tree, change the level to be debug.

---
 drivers/net/ethernet/mellanox/mlx5/core/qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/qp.c +1 -1
index b8ba74de9555..f0f3abe331da 100644
@@ -162,7 +162,7 @@ static int rsc_event_notifier(struct notifier_block *nb,
 
 	common = mlx5_get_rsc(table, rsn);
 	if (!common) {
-		mlx5_core_warn(dev, "Async event for bogus resource 0x%x\n", rsn);
+		mlx5_core_dbg(dev, "Async event for unknown resource 0x%x\n", rsn);
 		return NOTIFY_OK;
 	}
 
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/4 net/mlx5: Add XRQ legacy commands opcodes

In reply to Leon Romanovsky

From: Yishai Hadas <[email protected]>

Add XRQ legacy commands opcodes, will be used via the DEVX interface.

---
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 4 ++++
 include/linux/mlx5/mlx5_ifc.h                 | 2 ++
 2 files changed, 6 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +4 -0
index 8cdd7e66f8df..53d09620e215 100644
@@ -446,6 +446,8 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
 	case MLX5_CMD_OP_CREATE_UMEM:
 	case MLX5_CMD_OP_DESTROY_UMEM:
 	case MLX5_CMD_OP_ALLOC_MEMIC:
+	case MLX5_CMD_OP_MODIFY_XRQ:
+	case MLX5_CMD_OP_RELEASE_XRQ_ERROR:
 		*status = MLX5_DRIVER_STATUS_ABORTED;
 		*synd = MLX5_DRIVER_SYND;
 		return -EIO;
@@ -637,6 +639,8 @@ const char *mlx5_command_str(int command)
 	MLX5_COMMAND_STR_CASE(DESTROY_UCTX);
 	MLX5_COMMAND_STR_CASE(CREATE_UMEM);
 	MLX5_COMMAND_STR_CASE(DESTROY_UMEM);
+	MLX5_COMMAND_STR_CASE(RELEASE_XRQ_ERROR);
+	MLX5_COMMAND_STR_CASE(MODIFY_XRQ);
 	default: return "unknown command opcode";
 	}
 }
include/linux/mlx5/mlx5_ifc.h +2 -0
index 82470b670cb7..080bba20b129 100644
@@ -172,6 +172,8 @@ enum {
 	MLX5_CMD_OP_QUERY_XRQ_DC_PARAMS_ENTRY     = 0x725,
 	MLX5_CMD_OP_SET_XRQ_DC_PARAMS_ENTRY       = 0x726,
 	MLX5_CMD_OP_QUERY_XRQ_ERROR_PARAMS        = 0x727,
+	MLX5_CMD_OP_RELEASE_XRQ_ERROR             = 0x729,
+	MLX5_CMD_OP_MODIFY_XRQ                    = 0x72a,
 	MLX5_CMD_OP_QUERY_ESW_FUNCTIONS           = 0x740,
 	MLX5_CMD_OP_QUERY_VPORT_STATE             = 0x750,
 	MLX5_CMD_OP_MODIFY_VPORT_STATE            = 0x751,
Signature · 1 line
2.20.1
#3 lore raw

PATCH 3/4 IB/mlx5: Add legacy events to DEVX list

In reply to Leon Romanovsky

From: Yishai Hadas <[email protected]>

Add two events that were defined in the device specification but were not exposed in the driver list.

Post this patch those events can be read over the DEVX events interface once be reported by the firmware.

---
 drivers/infiniband/hw/mlx5/devx.c | 8 ++++++++
 include/linux/mlx5/device.h       | 9 +++++++++
 2 files changed, 17 insertions(+)
drivers/infiniband/hw/mlx5/devx.c +8 -0
index fd577ffd7864..3dbdfe0eb5e4 100644
@@ -233,6 +233,8 @@ static bool is_legacy_obj_event_num(u16 event_num)
 	case MLX5_EVENT_TYPE_SRQ_CATAS_ERROR:
 	case MLX5_EVENT_TYPE_DCT_DRAINED:
 	case MLX5_EVENT_TYPE_COMP:
+	case MLX5_EVENT_TYPE_DCT_KEY_VIOLATION:
+	case MLX5_EVENT_TYPE_XRQ_ERROR:
 		return true;
 	default:
 		return false;
@@ -315,8 +317,10 @@ static u16 get_event_obj_type(unsigned long event_type, struct mlx5_eqe *eqe)
 	case MLX5_EVENT_TYPE_SRQ_CATAS_ERROR:
 		return eqe->data.qp_srq.type;
 	case MLX5_EVENT_TYPE_CQ_ERROR:
+	case MLX5_EVENT_TYPE_XRQ_ERROR:
 		return 0;
 	case MLX5_EVENT_TYPE_DCT_DRAINED:
+	case MLX5_EVENT_TYPE_DCT_KEY_VIOLATION:
 		return MLX5_EVENT_QUEUE_TYPE_DCT;
 	default:
 		return MLX5_GET(affiliated_event_header, &eqe->data, obj_type);
@@ -2300,7 +2304,11 @@ static u32 devx_get_obj_id_from_event(unsigned long event_type, void *data)
 	case MLX5_EVENT_TYPE_WQ_ACCESS_ERROR:
 		obj_id = be32_to_cpu(eqe->data.qp_srq.qp_srq_n) & 0xffffff;
 		break;
+	case MLX5_EVENT_TYPE_XRQ_ERROR:
+		obj_id = be32_to_cpu(eqe->data.xrq_err.type_xrqn) & 0xffffff;
+		break;
 	case MLX5_EVENT_TYPE_DCT_DRAINED:
+	case MLX5_EVENT_TYPE_DCT_KEY_VIOLATION:
 		obj_id = be32_to_cpu(eqe->data.dct.dctn) & 0xffffff;
 		break;
 	case MLX5_EVENT_TYPE_CQ_ERROR:
include/linux/mlx5/device.h +9 -0
index ce9839c8bc1a..e427af260ebe 100644
@@ -328,6 +328,7 @@ enum mlx5_event {
 	MLX5_EVENT_TYPE_GPIO_EVENT	   = 0x15,
 	MLX5_EVENT_TYPE_PORT_MODULE_EVENT  = 0x16,
 	MLX5_EVENT_TYPE_TEMP_WARN_EVENT    = 0x17,
+	MLX5_EVENT_TYPE_XRQ_ERROR	   = 0x18,
 	MLX5_EVENT_TYPE_REMOTE_CONFIG	   = 0x19,
 	MLX5_EVENT_TYPE_GENERAL_EVENT	   = 0x22,
 	MLX5_EVENT_TYPE_MONITOR_COUNTER    = 0x24,
@@ -345,6 +346,7 @@ enum mlx5_event {
 	MLX5_EVENT_TYPE_ESW_FUNCTIONS_CHANGED = 0xe,
 
 	MLX5_EVENT_TYPE_DCT_DRAINED        = 0x1c,
+	MLX5_EVENT_TYPE_DCT_KEY_VIOLATION  = 0x1d,
 
 	MLX5_EVENT_TYPE_FPGA_ERROR         = 0x20,
 	MLX5_EVENT_TYPE_FPGA_QP_ERROR      = 0x21,
@@ -584,6 +586,12 @@ struct mlx5_eqe_cq_err {
 	u8	syndrome;
 };
 
+struct mlx5_eqe_xrq_err {
+	__be32	reserved1[5];
+	__be32	type_xrqn;
+	__be32	reserved2;
+};
+
 struct mlx5_eqe_port_state {
 	u8	reserved0[8];
 	u8	port;
@@ -698,6 +706,7 @@ union ev_data {
 	struct mlx5_eqe_pps		pps;
 	struct mlx5_eqe_dct             dct;
 	struct mlx5_eqe_temp_warning	temp_warning;
+	struct mlx5_eqe_xrq_err		xrq_err;
 } __packed;
 
 struct mlx5_eqe {
Signature · 1 line
2.20.1
#4 lore raw

PATCH 4/4 IB/mlx5: Expose XRQ legacy commands over the DEVX interface

In reply to Leon Romanovsky

From: Yishai Hadas <[email protected]>

Expose missing XRQ legacy commands over the DEVX interface.

---
 drivers/infiniband/hw/mlx5/devx.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/infiniband/hw/mlx5/devx.c +4 -0
index 3dbdfe0eb5e4..04b4e937c198 100644
@@ -546,6 +546,8 @@ static u64 devx_get_obj_id(const void *in)
 		break;
 	case MLX5_CMD_OP_ARM_XRQ:
 	case MLX5_CMD_OP_SET_XRQ_DC_PARAMS_ENTRY:
+	case MLX5_CMD_OP_RELEASE_XRQ_ERROR:
+	case MLX5_CMD_OP_MODIFY_XRQ:
 		obj_id = get_enc_obj_id(MLX5_CMD_OP_CREATE_XRQ,
 					MLX5_GET(arm_xrq_in, in, xrqn));
 		break;
@@ -822,6 +824,8 @@ static bool devx_is_obj_modify_cmd(const void *in)
 	case MLX5_CMD_OP_ARM_DCT_FOR_KEY_VIOLATION:
 	case MLX5_CMD_OP_ARM_XRQ:
 	case MLX5_CMD_OP_SET_XRQ_DC_PARAMS_ENTRY:
+	case MLX5_CMD_OP_RELEASE_XRQ_ERROR:
+	case MLX5_CMD_OP_MODIFY_XRQ:
 		return true;
 	case MLX5_CMD_OP_SET_FLOW_TABLE_ENTRY:
 	{
Signature · 1 line
2.20.1
#5 lore raw
In reply to Leon Romanovsky
Quoted 5 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

Hi,

This small series extends DEVX interface with SRQ and XRQ legacy commands.

Sorry for typo in cover letter, there is no SRQ here.

Thanks

Quoted 19 lines

Thanks

Yishai Hadas (4):
net/mlx5: Use debug message instead of warn net/mlx5: Add XRQ legacy commands opcodes IB/mlx5: Add legacy events to DEVX list
IB/mlx5: Expose XRQ legacy commands over the DEVX interface

 drivers/infiniband/hw/mlx5/devx.c             | 12 ++++++++++++
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c |  4 ++++
 drivers/net/ethernet/mellanox/mlx5/core/qp.c  |  2 +-
 include/linux/mlx5/device.h                   |  9 +++++++++
 include/linux/mlx5/mlx5_ifc.h                 |  2 ++
 5 files changed, 28 insertions(+), 1 deletion(-)

--
2.20.1

#6 lore raw
Quoted 9 lines · Leon Romanovsky
Quoted 6 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

Hi,

This small series extends DEVX interface with SRQ and XRQ legacy commands.

Sorry for typo in cover letter, there is no SRQ here.

Series looks fine to me. Are you planning on the first two via mlx5- next and the remainder via RDMA tree?

Signature · 3 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
    Fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD
#7 lore raw
Quoted 6 lines · Doug Ledford
Quoted 5 lines · Leon Romanovsky
Quoted 4 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

Hi,

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

This small series extends DEVX interface with SRQ and XRQ legacy commands.

Sorry for typo in cover letter, there is no SRQ here.

Series looks fine to me. Are you planning on the first two via mlx5- next and the remainder via RDMA tree?

Thanks, applied to mlx5-next

b1635ee6120c net/mlx5: Add XRQ legacy commands opcodes 647d58a989b3 net/mlx5: Use debug message instead of warn

#8 lore raw
Quoted 17 lines · Leon Romanovsky
Quoted 6 lines · Doug Ledford
Quoted 5 lines · Leon Romanovsky
Quoted 4 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

Hi,

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

This small series extends DEVX interface with SRQ and XRQ legacy commands.

Sorry for typo in cover letter, there is no SRQ here.

Series looks fine to me. Are you planning on the first two via mlx5-
next and the remainder via RDMA tree?

Quoted 4 lines

Thanks, applied to mlx5-next

b1635ee6120c net/mlx5: Add XRQ legacy commands opcodes 647d58a989b3 net/mlx5: Use debug message instead of warn

Merged mlx5-next, then applied remaining two patches to for-next. Thanks.

Signature · 3 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
    Fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD