diff options
Diffstat (limited to 'include/linux/mlx5')
-rw-r--r-- | include/linux/mlx5/cq.h | 18 | ||||
-rw-r--r-- | include/linux/mlx5/device.h | 31 | ||||
-rw-r--r-- | include/linux/mlx5/driver.h | 3 | ||||
-rw-r--r-- | include/linux/mlx5/qp.h | 45 |
4 files changed, 86 insertions, 11 deletions
diff --git a/include/linux/mlx5/cq.h b/include/linux/mlx5/cq.h index 3db67f73d96d..2202c7f72b75 100644 --- a/include/linux/mlx5/cq.h +++ b/include/linux/mlx5/cq.h | |||
@@ -79,15 +79,23 @@ enum { | |||
79 | MLX5_CQE_RESP_SEND = 2, | 79 | MLX5_CQE_RESP_SEND = 2, |
80 | MLX5_CQE_RESP_SEND_IMM = 3, | 80 | MLX5_CQE_RESP_SEND_IMM = 3, |
81 | MLX5_CQE_RESP_SEND_INV = 4, | 81 | MLX5_CQE_RESP_SEND_INV = 4, |
82 | MLX5_CQE_RESIZE_CQ = 0xff, /* TBD */ | 82 | MLX5_CQE_RESIZE_CQ = 5, |
83 | MLX5_CQE_REQ_ERR = 13, | 83 | MLX5_CQE_REQ_ERR = 13, |
84 | MLX5_CQE_RESP_ERR = 14, | 84 | MLX5_CQE_RESP_ERR = 14, |
85 | MLX5_CQE_INVALID = 15, | ||
85 | }; | 86 | }; |
86 | 87 | ||
87 | enum { | 88 | enum { |
88 | MLX5_CQ_MODIFY_RESEIZE = 0, | 89 | MLX5_CQ_MODIFY_PERIOD = 1 << 0, |
89 | MLX5_CQ_MODIFY_MODER = 1, | 90 | MLX5_CQ_MODIFY_COUNT = 1 << 1, |
90 | MLX5_CQ_MODIFY_MAPPING = 2, | 91 | MLX5_CQ_MODIFY_OVERRUN = 1 << 2, |
92 | }; | ||
93 | |||
94 | enum { | ||
95 | MLX5_CQ_OPMOD_RESIZE = 1, | ||
96 | MLX5_MODIFY_CQ_MASK_LOG_SIZE = 1 << 0, | ||
97 | MLX5_MODIFY_CQ_MASK_PG_OFFSET = 1 << 1, | ||
98 | MLX5_MODIFY_CQ_MASK_PG_SIZE = 1 << 2, | ||
91 | }; | 99 | }; |
92 | 100 | ||
93 | struct mlx5_cq_modify_params { | 101 | struct mlx5_cq_modify_params { |
@@ -158,7 +166,7 @@ int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); | |||
158 | int mlx5_core_query_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, | 166 | int mlx5_core_query_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, |
159 | struct mlx5_query_cq_mbox_out *out); | 167 | struct mlx5_query_cq_mbox_out *out); |
160 | int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, | 168 | int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, |
161 | int type, struct mlx5_cq_modify_params *params); | 169 | struct mlx5_modify_cq_mbox_in *in, int in_sz); |
162 | int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); | 170 | int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); |
163 | void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); | 171 | void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); |
164 | 172 | ||
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index da78875807fc..817a6fae6d2c 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h | |||
@@ -104,9 +104,10 @@ enum { | |||
104 | }; | 104 | }; |
105 | 105 | ||
106 | enum { | 106 | enum { |
107 | MLX5_BF_REGS_PER_PAGE = 4, | 107 | MLX5_BF_REGS_PER_PAGE = 4, |
108 | MLX5_MAX_UAR_PAGES = 1 << 8, | 108 | MLX5_MAX_UAR_PAGES = 1 << 8, |
109 | MLX5_MAX_UUARS = MLX5_MAX_UAR_PAGES * MLX5_BF_REGS_PER_PAGE, | 109 | MLX5_NON_FP_BF_REGS_PER_PAGE = 2, |
110 | MLX5_MAX_UUARS = MLX5_MAX_UAR_PAGES * MLX5_NON_FP_BF_REGS_PER_PAGE, | ||
110 | }; | 111 | }; |
111 | 112 | ||
112 | enum { | 113 | enum { |
@@ -176,6 +177,8 @@ enum { | |||
176 | MLX5_DEV_CAP_FLAG_APM = 1LL << 17, | 177 | MLX5_DEV_CAP_FLAG_APM = 1LL << 17, |
177 | MLX5_DEV_CAP_FLAG_ATOMIC = 1LL << 18, | 178 | MLX5_DEV_CAP_FLAG_ATOMIC = 1LL << 18, |
178 | MLX5_DEV_CAP_FLAG_ON_DMND_PG = 1LL << 24, | 179 | MLX5_DEV_CAP_FLAG_ON_DMND_PG = 1LL << 24, |
180 | MLX5_DEV_CAP_FLAG_CQ_MODER = 1LL << 29, | ||
181 | MLX5_DEV_CAP_FLAG_RESIZE_CQ = 1LL << 30, | ||
179 | MLX5_DEV_CAP_FLAG_RESIZE_SRQ = 1LL << 32, | 182 | MLX5_DEV_CAP_FLAG_RESIZE_SRQ = 1LL << 32, |
180 | MLX5_DEV_CAP_FLAG_REMOTE_FENCE = 1LL << 38, | 183 | MLX5_DEV_CAP_FLAG_REMOTE_FENCE = 1LL << 38, |
181 | MLX5_DEV_CAP_FLAG_TLP_HINTS = 1LL << 39, | 184 | MLX5_DEV_CAP_FLAG_TLP_HINTS = 1LL << 39, |
@@ -231,7 +234,8 @@ enum { | |||
231 | }; | 234 | }; |
232 | 235 | ||
233 | enum { | 236 | enum { |
234 | MLX5_ADAPTER_PAGE_SHIFT = 12 | 237 | MLX5_ADAPTER_PAGE_SHIFT = 12, |
238 | MLX5_ADAPTER_PAGE_SIZE = 1 << MLX5_ADAPTER_PAGE_SHIFT, | ||
235 | }; | 239 | }; |
236 | 240 | ||
237 | enum { | 241 | enum { |
@@ -697,6 +701,20 @@ struct mlx5_query_cq_mbox_out { | |||
697 | __be64 pas[0]; | 701 | __be64 pas[0]; |
698 | }; | 702 | }; |
699 | 703 | ||
704 | struct mlx5_modify_cq_mbox_in { | ||
705 | struct mlx5_inbox_hdr hdr; | ||
706 | __be32 cqn; | ||
707 | __be32 field_select; | ||
708 | struct mlx5_cq_context ctx; | ||
709 | u8 rsvd[192]; | ||
710 | __be64 pas[0]; | ||
711 | }; | ||
712 | |||
713 | struct mlx5_modify_cq_mbox_out { | ||
714 | struct mlx5_outbox_hdr hdr; | ||
715 | u8 rsvd[8]; | ||
716 | }; | ||
717 | |||
700 | struct mlx5_enable_hca_mbox_in { | 718 | struct mlx5_enable_hca_mbox_in { |
701 | struct mlx5_inbox_hdr hdr; | 719 | struct mlx5_inbox_hdr hdr; |
702 | u8 rsvd[8]; | 720 | u8 rsvd[8]; |
@@ -831,8 +849,8 @@ struct mlx5_create_mkey_mbox_in { | |||
831 | struct mlx5_mkey_seg seg; | 849 | struct mlx5_mkey_seg seg; |
832 | u8 rsvd1[16]; | 850 | u8 rsvd1[16]; |
833 | __be32 xlat_oct_act_size; | 851 | __be32 xlat_oct_act_size; |
834 | __be32 bsf_coto_act_size; | 852 | __be32 rsvd2; |
835 | u8 rsvd2[168]; | 853 | u8 rsvd3[168]; |
836 | __be64 pas[0]; | 854 | __be64 pas[0]; |
837 | }; | 855 | }; |
838 | 856 | ||
@@ -871,6 +889,7 @@ struct mlx5_modify_mkey_mbox_in { | |||
871 | 889 | ||
872 | struct mlx5_modify_mkey_mbox_out { | 890 | struct mlx5_modify_mkey_mbox_out { |
873 | struct mlx5_outbox_hdr hdr; | 891 | struct mlx5_outbox_hdr hdr; |
892 | u8 rsvd[8]; | ||
874 | }; | 893 | }; |
875 | 894 | ||
876 | struct mlx5_dump_mkey_mbox_in { | 895 | struct mlx5_dump_mkey_mbox_in { |
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 554548cd3dd4..130bc8d77fa5 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h | |||
@@ -38,8 +38,10 @@ | |||
38 | #include <linux/pci.h> | 38 | #include <linux/pci.h> |
39 | #include <linux/spinlock_types.h> | 39 | #include <linux/spinlock_types.h> |
40 | #include <linux/semaphore.h> | 40 | #include <linux/semaphore.h> |
41 | #include <linux/slab.h> | ||
41 | #include <linux/vmalloc.h> | 42 | #include <linux/vmalloc.h> |
42 | #include <linux/radix-tree.h> | 43 | #include <linux/radix-tree.h> |
44 | |||
43 | #include <linux/mlx5/device.h> | 45 | #include <linux/mlx5/device.h> |
44 | #include <linux/mlx5/doorbell.h> | 46 | #include <linux/mlx5/doorbell.h> |
45 | 47 | ||
@@ -227,6 +229,7 @@ struct mlx5_uuar_info { | |||
227 | * protect uuar allocation data structs | 229 | * protect uuar allocation data structs |
228 | */ | 230 | */ |
229 | struct mutex lock; | 231 | struct mutex lock; |
232 | u32 ver; | ||
230 | }; | 233 | }; |
231 | 234 | ||
232 | struct mlx5_bf { | 235 | struct mlx5_bf { |
diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h index d9e3eacb3a7f..d51eff713549 100644 --- a/include/linux/mlx5/qp.h +++ b/include/linux/mlx5/qp.h | |||
@@ -464,4 +464,49 @@ void mlx5_cleanup_qp_table(struct mlx5_core_dev *dev); | |||
464 | int mlx5_debug_qp_add(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); | 464 | int mlx5_debug_qp_add(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); |
465 | void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); | 465 | void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); |
466 | 466 | ||
467 | static inline const char *mlx5_qp_type_str(int type) | ||
468 | { | ||
469 | switch (type) { | ||
470 | case MLX5_QP_ST_RC: return "RC"; | ||
471 | case MLX5_QP_ST_UC: return "C"; | ||
472 | case MLX5_QP_ST_UD: return "UD"; | ||
473 | case MLX5_QP_ST_XRC: return "XRC"; | ||
474 | case MLX5_QP_ST_MLX: return "MLX"; | ||
475 | case MLX5_QP_ST_QP0: return "QP0"; | ||
476 | case MLX5_QP_ST_QP1: return "QP1"; | ||
477 | case MLX5_QP_ST_RAW_ETHERTYPE: return "RAW_ETHERTYPE"; | ||
478 | case MLX5_QP_ST_RAW_IPV6: return "RAW_IPV6"; | ||
479 | case MLX5_QP_ST_SNIFFER: return "SNIFFER"; | ||
480 | case MLX5_QP_ST_SYNC_UMR: return "SYNC_UMR"; | ||
481 | case MLX5_QP_ST_PTP_1588: return "PTP_1588"; | ||
482 | case MLX5_QP_ST_REG_UMR: return "REG_UMR"; | ||
483 | default: return "Invalid transport type"; | ||
484 | } | ||
485 | } | ||
486 | |||
487 | static inline const char *mlx5_qp_state_str(int state) | ||
488 | { | ||
489 | switch (state) { | ||
490 | case MLX5_QP_STATE_RST: | ||
491 | return "RST"; | ||
492 | case MLX5_QP_STATE_INIT: | ||
493 | return "INIT"; | ||
494 | case MLX5_QP_STATE_RTR: | ||
495 | return "RTR"; | ||
496 | case MLX5_QP_STATE_RTS: | ||
497 | return "RTS"; | ||
498 | case MLX5_QP_STATE_SQER: | ||
499 | return "SQER"; | ||
500 | case MLX5_QP_STATE_SQD: | ||
501 | return "SQD"; | ||
502 | case MLX5_QP_STATE_ERR: | ||
503 | return "ERR"; | ||
504 | case MLX5_QP_STATE_SQ_DRAINING: | ||
505 | return "SQ_DRAINING"; | ||
506 | case MLX5_QP_STATE_SUSPENDED: | ||
507 | return "SUSPENDED"; | ||
508 | default: return "Invalid QP state"; | ||
509 | } | ||
510 | } | ||
511 | |||
467 | #endif /* MLX5_QP_H */ | 512 | #endif /* MLX5_QP_H */ |