aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-03 19:57:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-03 19:57:19 -0400
commit877f075aac900288ce2e6a64075cceff09210a7e (patch)
tree2bcf23e903403a2bfa3c6fac14d1334614e4d0f1 /include/linux
parent3cf59142bcd391680beb6932838fe09a73947705 (diff)
parentf7eaa7ed8fd46542275cf249cd934a366f6556bb (diff)
Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
Pull infiniband updates from Roland Dreier: "Main batch of InfiniBand/RDMA changes for 3.15: - The biggest change is core API extensions and mlx5 low-level driver support for handling DIF/DIX-style protection information, and the addition of PI support to the iSER initiator. Target support will be arriving shortly through the SCSI target tree. - A nice simplification to the "umem" memory pinning library now that we have chained sg lists. Kudos to Yishai Hadas for realizing our code didn't have to be so crazy. - Another nice simplification to the sg wrappers used by qib, ipath and ehca to handle their mapping of memory to adapter. - The usual batch of fixes to bugs found by static checkers etc. from intrepid people like Dan Carpenter and Yann Droneaud. - A large batch of cxgb4, ocrdma, qib driver updates" * tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (102 commits) RDMA/ocrdma: Unregister inet notifier when unloading ocrdma RDMA/ocrdma: Fix warnings about pointer <-> integer casts RDMA/ocrdma: Code clean-up RDMA/ocrdma: Display FW version RDMA/ocrdma: Query controller information RDMA/ocrdma: Support non-embedded mailbox commands RDMA/ocrdma: Handle CQ overrun error RDMA/ocrdma: Display proper value for max_mw RDMA/ocrdma: Use non-zero tag in SRQ posting RDMA/ocrdma: Memory leak fix in ocrdma_dereg_mr() RDMA/ocrdma: Increment abi version count RDMA/ocrdma: Update version string be2net: Add abi version between be2net and ocrdma RDMA/ocrdma: ABI versioning between ocrdma and be2net RDMA/ocrdma: Allow DPP QP creation RDMA/ocrdma: Read ASIC_ID register to select asic_gen RDMA/ocrdma: SQ and RQ doorbell offset clean up RDMA/ocrdma: EQ full catastrophe avoidance RDMA/cxgb4: Disable DSGL use by default RDMA/cxgb4: rx_data() needs to hold the ep mutex ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mlx5/cq.h1
-rw-r--r--include/linux/mlx5/device.h43
-rw-r--r--include/linux/mlx5/driver.h41
-rw-r--r--include/linux/mlx5/qp.h67
4 files changed, 152 insertions, 0 deletions
diff --git a/include/linux/mlx5/cq.h b/include/linux/mlx5/cq.h
index 2202c7f72b75..f6b17ac601bd 100644
--- a/include/linux/mlx5/cq.h
+++ b/include/linux/mlx5/cq.h
@@ -80,6 +80,7 @@ enum {
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 = 5, 82 MLX5_CQE_RESIZE_CQ = 5,
83 MLX5_CQE_SIG_ERR = 12,
83 MLX5_CQE_REQ_ERR = 13, 84 MLX5_CQE_REQ_ERR = 13,
84 MLX5_CQE_RESP_ERR = 14, 85 MLX5_CQE_RESP_ERR = 14,
85 MLX5_CQE_INVALID = 15, 86 MLX5_CQE_INVALID = 15,
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 817a6fae6d2c..407bdb67fd4f 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -48,6 +48,8 @@ enum {
48 MLX5_MAX_COMMANDS = 32, 48 MLX5_MAX_COMMANDS = 32,
49 MLX5_CMD_DATA_BLOCK_SIZE = 512, 49 MLX5_CMD_DATA_BLOCK_SIZE = 512,
50 MLX5_PCI_CMD_XPORT = 7, 50 MLX5_PCI_CMD_XPORT = 7,
51 MLX5_MKEY_BSF_OCTO_SIZE = 4,
52 MLX5_MAX_PSVS = 4,
51}; 53};
52 54
53enum { 55enum {
@@ -116,6 +118,7 @@ enum {
116 MLX5_MKEY_MASK_START_ADDR = 1ull << 6, 118 MLX5_MKEY_MASK_START_ADDR = 1ull << 6,
117 MLX5_MKEY_MASK_PD = 1ull << 7, 119 MLX5_MKEY_MASK_PD = 1ull << 7,
118 MLX5_MKEY_MASK_EN_RINVAL = 1ull << 8, 120 MLX5_MKEY_MASK_EN_RINVAL = 1ull << 8,
121 MLX5_MKEY_MASK_EN_SIGERR = 1ull << 9,
119 MLX5_MKEY_MASK_BSF_EN = 1ull << 12, 122 MLX5_MKEY_MASK_BSF_EN = 1ull << 12,
120 MLX5_MKEY_MASK_KEY = 1ull << 13, 123 MLX5_MKEY_MASK_KEY = 1ull << 13,
121 MLX5_MKEY_MASK_QPN = 1ull << 14, 124 MLX5_MKEY_MASK_QPN = 1ull << 14,
@@ -555,6 +558,23 @@ struct mlx5_cqe64 {
555 u8 op_own; 558 u8 op_own;
556}; 559};
557 560
561struct mlx5_sig_err_cqe {
562 u8 rsvd0[16];
563 __be32 expected_trans_sig;
564 __be32 actual_trans_sig;
565 __be32 expected_reftag;
566 __be32 actual_reftag;
567 __be16 syndrome;
568 u8 rsvd22[2];
569 __be32 mkey;
570 __be64 err_offset;
571 u8 rsvd30[8];
572 __be32 qpn;
573 u8 rsvd38[2];
574 u8 signature;
575 u8 op_own;
576};
577
558struct mlx5_wqe_srq_next_seg { 578struct mlx5_wqe_srq_next_seg {
559 u8 rsvd0[2]; 579 u8 rsvd0[2];
560 __be16 next_wqe_index; 580 __be16 next_wqe_index;
@@ -936,4 +956,27 @@ enum {
936 MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO = 1 << 0 956 MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO = 1 << 0
937}; 957};
938 958
959struct mlx5_allocate_psv_in {
960 struct mlx5_inbox_hdr hdr;
961 __be32 npsv_pd;
962 __be32 rsvd_psv0;
963};
964
965struct mlx5_allocate_psv_out {
966 struct mlx5_outbox_hdr hdr;
967 u8 rsvd[8];
968 __be32 psv_idx[4];
969};
970
971struct mlx5_destroy_psv_in {
972 struct mlx5_inbox_hdr hdr;
973 __be32 psv_number;
974 u8 rsvd[4];
975};
976
977struct mlx5_destroy_psv_out {
978 struct mlx5_outbox_hdr hdr;
979 u8 rsvd[8];
980};
981
939#endif /* MLX5_DEVICE_H */ 982#endif /* MLX5_DEVICE_H */
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 130bc8d77fa5..93cef6313e72 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -401,6 +401,26 @@ struct mlx5_eq {
401 struct mlx5_rsc_debug *dbg; 401 struct mlx5_rsc_debug *dbg;
402}; 402};
403 403
404struct mlx5_core_psv {
405 u32 psv_idx;
406 struct psv_layout {
407 u32 pd;
408 u16 syndrome;
409 u16 reserved;
410 u16 bg;
411 u16 app_tag;
412 u32 ref_tag;
413 } psv;
414};
415
416struct mlx5_core_sig_ctx {
417 struct mlx5_core_psv psv_memory;
418 struct mlx5_core_psv psv_wire;
419 struct ib_sig_err err_item;
420 bool sig_status_checked;
421 bool sig_err_exists;
422 u32 sigerr_count;
423};
404 424
405struct mlx5_core_mr { 425struct mlx5_core_mr {
406 u64 iova; 426 u64 iova;
@@ -475,6 +495,13 @@ struct mlx5_srq_table {
475 struct radix_tree_root tree; 495 struct radix_tree_root tree;
476}; 496};
477 497
498struct mlx5_mr_table {
499 /* protect radix tree
500 */
501 rwlock_t lock;
502 struct radix_tree_root tree;
503};
504
478struct mlx5_priv { 505struct mlx5_priv {
479 char name[MLX5_MAX_NAME_LEN]; 506 char name[MLX5_MAX_NAME_LEN];
480 struct mlx5_eq_table eq_table; 507 struct mlx5_eq_table eq_table;
@@ -504,6 +531,10 @@ struct mlx5_priv {
504 struct mlx5_cq_table cq_table; 531 struct mlx5_cq_table cq_table;
505 /* end: cq staff */ 532 /* end: cq staff */
506 533
534 /* start: mr staff */
535 struct mlx5_mr_table mr_table;
536 /* end: mr staff */
537
507 /* start: alloc staff */ 538 /* start: alloc staff */
508 struct mutex pgdir_mutex; 539 struct mutex pgdir_mutex;
509 struct list_head pgdir_list; 540 struct list_head pgdir_list;
@@ -651,6 +682,11 @@ static inline void mlx5_vfree(const void *addr)
651 kfree(addr); 682 kfree(addr);
652} 683}
653 684
685static inline u32 mlx5_base_mkey(const u32 key)
686{
687 return key & 0xffffff00u;
688}
689
654int mlx5_dev_init(struct mlx5_core_dev *dev, struct pci_dev *pdev); 690int mlx5_dev_init(struct mlx5_core_dev *dev, struct pci_dev *pdev);
655void mlx5_dev_cleanup(struct mlx5_core_dev *dev); 691void mlx5_dev_cleanup(struct mlx5_core_dev *dev);
656int mlx5_cmd_init(struct mlx5_core_dev *dev); 692int mlx5_cmd_init(struct mlx5_core_dev *dev);
@@ -685,6 +721,8 @@ int mlx5_core_query_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq,
685 struct mlx5_query_srq_mbox_out *out); 721 struct mlx5_query_srq_mbox_out *out);
686int mlx5_core_arm_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, 722int mlx5_core_arm_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq,
687 u16 lwm, int is_srq); 723 u16 lwm, int is_srq);
724void mlx5_init_mr_table(struct mlx5_core_dev *dev);
725void mlx5_cleanup_mr_table(struct mlx5_core_dev *dev);
688int mlx5_core_create_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, 726int mlx5_core_create_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr,
689 struct mlx5_create_mkey_mbox_in *in, int inlen, 727 struct mlx5_create_mkey_mbox_in *in, int inlen,
690 mlx5_cmd_cbk_t callback, void *context, 728 mlx5_cmd_cbk_t callback, void *context,
@@ -746,6 +784,9 @@ void mlx5_db_free(struct mlx5_core_dev *dev, struct mlx5_db *db);
746const char *mlx5_command_str(int command); 784const char *mlx5_command_str(int command);
747int mlx5_cmdif_debugfs_init(struct mlx5_core_dev *dev); 785int mlx5_cmdif_debugfs_init(struct mlx5_core_dev *dev);
748void mlx5_cmdif_debugfs_cleanup(struct mlx5_core_dev *dev); 786void mlx5_cmdif_debugfs_cleanup(struct mlx5_core_dev *dev);
787int mlx5_core_create_psv(struct mlx5_core_dev *dev, u32 pdn,
788 int npsvs, u32 *sig_index);
789int mlx5_core_destroy_psv(struct mlx5_core_dev *dev, int psv_num);
749 790
750static inline u32 mlx5_mkey_to_idx(u32 mkey) 791static inline u32 mlx5_mkey_to_idx(u32 mkey)
751{ 792{
diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h
index d51eff713549..f829ad80ff28 100644
--- a/include/linux/mlx5/qp.h
+++ b/include/linux/mlx5/qp.h
@@ -37,6 +37,9 @@
37#include <linux/mlx5/driver.h> 37#include <linux/mlx5/driver.h>
38 38
39#define MLX5_INVALID_LKEY 0x100 39#define MLX5_INVALID_LKEY 0x100
40#define MLX5_SIG_WQE_SIZE (MLX5_SEND_WQE_BB * 5)
41#define MLX5_DIF_SIZE 8
42#define MLX5_STRIDE_BLOCK_OP 0x400
40 43
41enum mlx5_qp_optpar { 44enum mlx5_qp_optpar {
42 MLX5_QP_OPTPAR_ALT_ADDR_PATH = 1 << 0, 45 MLX5_QP_OPTPAR_ALT_ADDR_PATH = 1 << 0,
@@ -151,6 +154,11 @@ enum {
151 MLX5_SND_DBR = 1, 154 MLX5_SND_DBR = 1,
152}; 155};
153 156
157enum {
158 MLX5_FLAGS_INLINE = 1<<7,
159 MLX5_FLAGS_CHECK_FREE = 1<<5,
160};
161
154struct mlx5_wqe_fmr_seg { 162struct mlx5_wqe_fmr_seg {
155 __be32 flags; 163 __be32 flags;
156 __be32 mem_key; 164 __be32 mem_key;
@@ -278,6 +286,60 @@ struct mlx5_wqe_inline_seg {
278 __be32 byte_count; 286 __be32 byte_count;
279}; 287};
280 288
289struct mlx5_bsf {
290 struct mlx5_bsf_basic {
291 u8 bsf_size_sbs;
292 u8 check_byte_mask;
293 union {
294 u8 copy_byte_mask;
295 u8 bs_selector;
296 u8 rsvd_wflags;
297 } wire;
298 union {
299 u8 bs_selector;
300 u8 rsvd_mflags;
301 } mem;
302 __be32 raw_data_size;
303 __be32 w_bfs_psv;
304 __be32 m_bfs_psv;
305 } basic;
306 struct mlx5_bsf_ext {
307 __be32 t_init_gen_pro_size;
308 __be32 rsvd_epi_size;
309 __be32 w_tfs_psv;
310 __be32 m_tfs_psv;
311 } ext;
312 struct mlx5_bsf_inl {
313 __be32 w_inl_vld;
314 __be32 w_rsvd;
315 __be64 w_block_format;
316 __be32 m_inl_vld;
317 __be32 m_rsvd;
318 __be64 m_block_format;
319 } inl;
320};
321
322struct mlx5_klm {
323 __be32 bcount;
324 __be32 key;
325 __be64 va;
326};
327
328struct mlx5_stride_block_entry {
329 __be16 stride;
330 __be16 bcount;
331 __be32 key;
332 __be64 va;
333};
334
335struct mlx5_stride_block_ctrl_seg {
336 __be32 bcount_per_cycle;
337 __be32 op;
338 __be32 repeat_count;
339 u16 rsvd;
340 __be16 num_entries;
341};
342
281struct mlx5_core_qp { 343struct mlx5_core_qp {
282 void (*event) (struct mlx5_core_qp *, int); 344 void (*event) (struct mlx5_core_qp *, int);
283 int qpn; 345 int qpn;
@@ -444,6 +506,11 @@ static inline struct mlx5_core_qp *__mlx5_qp_lookup(struct mlx5_core_dev *dev, u
444 return radix_tree_lookup(&dev->priv.qp_table.tree, qpn); 506 return radix_tree_lookup(&dev->priv.qp_table.tree, qpn);
445} 507}
446 508
509static inline struct mlx5_core_mr *__mlx5_mr_lookup(struct mlx5_core_dev *dev, u32 key)
510{
511 return radix_tree_lookup(&dev->priv.mr_table.tree, key);
512}
513
447int mlx5_core_create_qp(struct mlx5_core_dev *dev, 514int mlx5_core_create_qp(struct mlx5_core_dev *dev,
448 struct mlx5_core_qp *qp, 515 struct mlx5_core_qp *qp,
449 struct mlx5_create_qp_mbox_in *in, 516 struct mlx5_create_qp_mbox_in *in,