aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5
diff options
context:
space:
mode:
authorMoni Shoua <monis@mellanox.com>2018-01-02 09:19:28 -0500
committerJason Gunthorpe <jgg@mellanox.com>2018-01-08 13:38:49 -0500
commit57cda166bbe045151d46b2d1133fdf4afccb90ed (patch)
treeda956b2b45a1ec1911eaab0990800f684e893b42 /include/linux/mlx5
parent8fc12d94ee997625dbae102e597ac0f4a21f2142 (diff)
net/mlx5: Add DCT command interface
Add a missing command interface to work with a DCT. It includes: creating, destroying and get events for. Signed-off-by: Moni Shoua <monis@mellanox.com> Reviewed-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/linux/mlx5')
-rw-r--r--include/linux/mlx5/device.h9
-rw-r--r--include/linux/mlx5/driver.h8
-rw-r--r--include/linux/mlx5/qp.h12
3 files changed, 29 insertions, 0 deletions
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 52b8ea423dd2..9aee835b7393 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -286,6 +286,7 @@ enum {
286 MLX5_EVENT_QUEUE_TYPE_QP = 0, 286 MLX5_EVENT_QUEUE_TYPE_QP = 0,
287 MLX5_EVENT_QUEUE_TYPE_RQ = 1, 287 MLX5_EVENT_QUEUE_TYPE_RQ = 1,
288 MLX5_EVENT_QUEUE_TYPE_SQ = 2, 288 MLX5_EVENT_QUEUE_TYPE_SQ = 2,
289 MLX5_EVENT_QUEUE_TYPE_DCT = 6,
289}; 290};
290 291
291enum mlx5_event { 292enum mlx5_event {
@@ -321,6 +322,8 @@ enum mlx5_event {
321 MLX5_EVENT_TYPE_PAGE_FAULT = 0xc, 322 MLX5_EVENT_TYPE_PAGE_FAULT = 0xc,
322 MLX5_EVENT_TYPE_NIC_VPORT_CHANGE = 0xd, 323 MLX5_EVENT_TYPE_NIC_VPORT_CHANGE = 0xd,
323 324
325 MLX5_EVENT_TYPE_DCT_DRAINED = 0x1c,
326
324 MLX5_EVENT_TYPE_FPGA_ERROR = 0x20, 327 MLX5_EVENT_TYPE_FPGA_ERROR = 0x20,
325}; 328};
326 329
@@ -613,6 +616,11 @@ struct mlx5_eqe_pps {
613 u8 rsvd2[12]; 616 u8 rsvd2[12];
614} __packed; 617} __packed;
615 618
619struct mlx5_eqe_dct {
620 __be32 reserved[6];
621 __be32 dctn;
622};
623
616union ev_data { 624union ev_data {
617 __be32 raw[7]; 625 __be32 raw[7];
618 struct mlx5_eqe_cmd cmd; 626 struct mlx5_eqe_cmd cmd;
@@ -628,6 +636,7 @@ union ev_data {
628 struct mlx5_eqe_vport_change vport_change; 636 struct mlx5_eqe_vport_change vport_change;
629 struct mlx5_eqe_port_module port_module; 637 struct mlx5_eqe_port_module port_module;
630 struct mlx5_eqe_pps pps; 638 struct mlx5_eqe_pps pps;
639 struct mlx5_eqe_dct dct;
631} __packed; 640} __packed;
632 641
633struct mlx5_eqe { 642struct mlx5_eqe {
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 2fe263f69751..0776554f18dc 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -154,6 +154,13 @@ enum mlx5_dcbx_oper_mode {
154 MLX5E_DCBX_PARAM_VER_OPER_AUTO = 0x3, 154 MLX5E_DCBX_PARAM_VER_OPER_AUTO = 0x3,
155}; 155};
156 156
157enum mlx5_dct_atomic_mode {
158 MLX5_ATOMIC_MODE_DCT_OFF = 20,
159 MLX5_ATOMIC_MODE_DCT_NONE = 0 << MLX5_ATOMIC_MODE_DCT_OFF,
160 MLX5_ATOMIC_MODE_DCT_IB_COMP = 1 << MLX5_ATOMIC_MODE_DCT_OFF,
161 MLX5_ATOMIC_MODE_DCT_CX = 2 << MLX5_ATOMIC_MODE_DCT_OFF,
162};
163
157enum { 164enum {
158 MLX5_ATOMIC_OPS_CMP_SWAP = 1 << 0, 165 MLX5_ATOMIC_OPS_CMP_SWAP = 1 << 0,
159 MLX5_ATOMIC_OPS_FETCH_ADD = 1 << 1, 166 MLX5_ATOMIC_OPS_FETCH_ADD = 1 << 1,
@@ -432,6 +439,7 @@ enum mlx5_res_type {
432 MLX5_RES_SRQ = 3, 439 MLX5_RES_SRQ = 3,
433 MLX5_RES_XSRQ = 4, 440 MLX5_RES_XSRQ = 4,
434 MLX5_RES_XRQ = 5, 441 MLX5_RES_XRQ = 5,
442 MLX5_RES_DCT = MLX5_EVENT_QUEUE_TYPE_DCT,
435}; 443};
436 444
437struct mlx5_core_rsc_common { 445struct mlx5_core_rsc_common {
diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h
index 62af7512dabb..4778d41085d4 100644
--- a/include/linux/mlx5/qp.h
+++ b/include/linux/mlx5/qp.h
@@ -473,6 +473,11 @@ struct mlx5_core_qp {
473 int pid; 473 int pid;
474}; 474};
475 475
476struct mlx5_core_dct {
477 struct mlx5_core_qp mqp;
478 struct completion drained;
479};
480
476struct mlx5_qp_path { 481struct mlx5_qp_path {
477 u8 fl_free_ar; 482 u8 fl_free_ar;
478 u8 rsvd3; 483 u8 rsvd3;
@@ -549,6 +554,9 @@ static inline struct mlx5_core_mkey *__mlx5_mr_lookup(struct mlx5_core_dev *dev,
549 return radix_tree_lookup(&dev->priv.mkey_table.tree, key); 554 return radix_tree_lookup(&dev->priv.mkey_table.tree, key);
550} 555}
551 556
557int mlx5_core_create_dct(struct mlx5_core_dev *dev,
558 struct mlx5_core_dct *qp,
559 u32 *in, int inlen);
552int mlx5_core_create_qp(struct mlx5_core_dev *dev, 560int mlx5_core_create_qp(struct mlx5_core_dev *dev,
553 struct mlx5_core_qp *qp, 561 struct mlx5_core_qp *qp,
554 u32 *in, 562 u32 *in,
@@ -558,8 +566,12 @@ int mlx5_core_qp_modify(struct mlx5_core_dev *dev, u16 opcode,
558 struct mlx5_core_qp *qp); 566 struct mlx5_core_qp *qp);
559int mlx5_core_destroy_qp(struct mlx5_core_dev *dev, 567int mlx5_core_destroy_qp(struct mlx5_core_dev *dev,
560 struct mlx5_core_qp *qp); 568 struct mlx5_core_qp *qp);
569int mlx5_core_destroy_dct(struct mlx5_core_dev *dev,
570 struct mlx5_core_dct *dct);
561int mlx5_core_qp_query(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp, 571int mlx5_core_qp_query(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp,
562 u32 *out, int outlen); 572 u32 *out, int outlen);
573int mlx5_core_dct_query(struct mlx5_core_dev *dev, struct mlx5_core_dct *dct,
574 u32 *out, int outlen);
563 575
564int mlx5_core_set_delay_drop(struct mlx5_core_dev *dev, 576int mlx5_core_set_delay_drop(struct mlx5_core_dev *dev,
565 u32 timeout_usec); 577 u32 timeout_usec);