aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5/qp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mlx5/qp.h')
-rw-r--r--include/linux/mlx5/qp.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h
index 3fa075daeb1d..61f7a342d1bf 100644
--- a/include/linux/mlx5/qp.h
+++ b/include/linux/mlx5/qp.h
@@ -50,6 +50,9 @@
50#define MLX5_BSF_APPTAG_ESCAPE 0x1 50#define MLX5_BSF_APPTAG_ESCAPE 0x1
51#define MLX5_BSF_APPREF_ESCAPE 0x2 51#define MLX5_BSF_APPREF_ESCAPE 0x2
52 52
53#define MLX5_QPN_BITS 24
54#define MLX5_QPN_MASK ((1 << MLX5_QPN_BITS) - 1)
55
53enum mlx5_qp_optpar { 56enum mlx5_qp_optpar {
54 MLX5_QP_OPTPAR_ALT_ADDR_PATH = 1 << 0, 57 MLX5_QP_OPTPAR_ALT_ADDR_PATH = 1 << 0,
55 MLX5_QP_OPTPAR_RRE = 1 << 1, 58 MLX5_QP_OPTPAR_RRE = 1 << 1,
@@ -189,6 +192,14 @@ struct mlx5_wqe_ctrl_seg {
189 __be32 imm; 192 __be32 imm;
190}; 193};
191 194
195#define MLX5_WQE_CTRL_DS_MASK 0x3f
196#define MLX5_WQE_CTRL_QPN_MASK 0xffffff00
197#define MLX5_WQE_CTRL_QPN_SHIFT 8
198#define MLX5_WQE_DS_UNITS 16
199#define MLX5_WQE_CTRL_OPCODE_MASK 0xff
200#define MLX5_WQE_CTRL_WQE_INDEX_MASK 0x00ffff00
201#define MLX5_WQE_CTRL_WQE_INDEX_SHIFT 8
202
192struct mlx5_wqe_xrc_seg { 203struct mlx5_wqe_xrc_seg {
193 __be32 xrc_srqn; 204 __be32 xrc_srqn;
194 u8 rsvd[12]; 205 u8 rsvd[12];
@@ -292,6 +303,8 @@ struct mlx5_wqe_signature_seg {
292 u8 rsvd1[11]; 303 u8 rsvd1[11];
293}; 304};
294 305
306#define MLX5_WQE_INLINE_SEG_BYTE_COUNT_MASK 0x3ff
307
295struct mlx5_wqe_inline_seg { 308struct mlx5_wqe_inline_seg {
296 __be32 byte_count; 309 __be32 byte_count;
297}; 310};
@@ -360,9 +373,46 @@ struct mlx5_stride_block_ctrl_seg {
360 __be16 num_entries; 373 __be16 num_entries;
361}; 374};
362 375
376enum mlx5_pagefault_flags {
377 MLX5_PFAULT_REQUESTOR = 1 << 0,
378 MLX5_PFAULT_WRITE = 1 << 1,
379 MLX5_PFAULT_RDMA = 1 << 2,
380};
381
382/* Contains the details of a pagefault. */
383struct mlx5_pagefault {
384 u32 bytes_committed;
385 u8 event_subtype;
386 enum mlx5_pagefault_flags flags;
387 union {
388 /* Initiator or send message responder pagefault details. */
389 struct {
390 /* Received packet size, only valid for responders. */
391 u32 packet_size;
392 /*
393 * WQE index. Refers to either the send queue or
394 * receive queue, according to event_subtype.
395 */
396 u16 wqe_index;
397 } wqe;
398 /* RDMA responder pagefault details */
399 struct {
400 u32 r_key;
401 /*
402 * Received packet size, minimal size page fault
403 * resolution required for forward progress.
404 */
405 u32 packet_size;
406 u32 rdma_op_len;
407 u64 rdma_va;
408 } rdma;
409 };
410};
411
363struct mlx5_core_qp { 412struct mlx5_core_qp {
364 struct mlx5_core_rsc_common common; /* must be first */ 413 struct mlx5_core_rsc_common common; /* must be first */
365 void (*event) (struct mlx5_core_qp *, int); 414 void (*event) (struct mlx5_core_qp *, int);
415 void (*pfault_handler)(struct mlx5_core_qp *, struct mlx5_pagefault *);
366 int qpn; 416 int qpn;
367 struct mlx5_rsc_debug *dbg; 417 struct mlx5_rsc_debug *dbg;
368 int pid; 418 int pid;
@@ -530,6 +580,17 @@ static inline struct mlx5_core_mr *__mlx5_mr_lookup(struct mlx5_core_dev *dev, u
530 return radix_tree_lookup(&dev->priv.mr_table.tree, key); 580 return radix_tree_lookup(&dev->priv.mr_table.tree, key);
531} 581}
532 582
583struct mlx5_page_fault_resume_mbox_in {
584 struct mlx5_inbox_hdr hdr;
585 __be32 flags_qpn;
586 u8 reserved[4];
587};
588
589struct mlx5_page_fault_resume_mbox_out {
590 struct mlx5_outbox_hdr hdr;
591 u8 rsvd[8];
592};
593
533int mlx5_core_create_qp(struct mlx5_core_dev *dev, 594int mlx5_core_create_qp(struct mlx5_core_dev *dev,
534 struct mlx5_core_qp *qp, 595 struct mlx5_core_qp *qp,
535 struct mlx5_create_qp_mbox_in *in, 596 struct mlx5_create_qp_mbox_in *in,
@@ -549,6 +610,10 @@ void mlx5_init_qp_table(struct mlx5_core_dev *dev);
549void mlx5_cleanup_qp_table(struct mlx5_core_dev *dev); 610void mlx5_cleanup_qp_table(struct mlx5_core_dev *dev);
550int mlx5_debug_qp_add(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); 611int mlx5_debug_qp_add(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp);
551void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); 612void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp);
613#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING
614int mlx5_core_page_fault_resume(struct mlx5_core_dev *dev, u32 qpn,
615 u8 context, int error);
616#endif
552 617
553static inline const char *mlx5_qp_type_str(int type) 618static inline const char *mlx5_qp_type_str(int type)
554{ 619{