diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2014-02-23 07:19:06 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-03-07 14:26:49 -0500 |
commit | 3121e3c441b5eccdd15e6c320ec32215b334b9ec (patch) | |
tree | caee56913d52fd2019ff11fcb7ce3af2d765eb36 /include | |
parent | 1b01d33560e78417334c2dc673bbfac6c644424c (diff) |
mlx5: Implement create_mr and destroy_mr
Support create_mr and destroy_mr verbs. Creating ib_mr may be done
for either ib_mr that will register regular page lists like
alloc_fast_reg_mr routine, or indirect ib_mrs that can register other
(pre-registered) ib_mrs in an indirect manner.
In addition user may request signature enable, that will mean that the
created ib_mr may be attached with signature attributes (BSF, PSVs).
Currently we only allow direct/indirect registration modes.
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mlx5/device.h | 25 | ||||
-rw-r--r-- | include/linux/mlx5/driver.h | 19 |
2 files changed, 44 insertions, 0 deletions
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index 817a6fae6d2c..f714fc427765 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 | ||
53 | enum { | 55 | enum { |
@@ -936,4 +938,27 @@ enum { | |||
936 | MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO = 1 << 0 | 938 | MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO = 1 << 0 |
937 | }; | 939 | }; |
938 | 940 | ||
941 | struct mlx5_allocate_psv_in { | ||
942 | struct mlx5_inbox_hdr hdr; | ||
943 | __be32 npsv_pd; | ||
944 | __be32 rsvd_psv0; | ||
945 | }; | ||
946 | |||
947 | struct mlx5_allocate_psv_out { | ||
948 | struct mlx5_outbox_hdr hdr; | ||
949 | u8 rsvd[8]; | ||
950 | __be32 psv_idx[4]; | ||
951 | }; | ||
952 | |||
953 | struct mlx5_destroy_psv_in { | ||
954 | struct mlx5_inbox_hdr hdr; | ||
955 | __be32 psv_number; | ||
956 | u8 rsvd[4]; | ||
957 | }; | ||
958 | |||
959 | struct mlx5_destroy_psv_out { | ||
960 | struct mlx5_outbox_hdr hdr; | ||
961 | u8 rsvd[8]; | ||
962 | }; | ||
963 | |||
939 | #endif /* MLX5_DEVICE_H */ | 964 | #endif /* MLX5_DEVICE_H */ |
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 130bc8d77fa5..e1cb657ccade 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h | |||
@@ -401,6 +401,22 @@ struct mlx5_eq { | |||
401 | struct mlx5_rsc_debug *dbg; | 401 | struct mlx5_rsc_debug *dbg; |
402 | }; | 402 | }; |
403 | 403 | ||
404 | struct 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 | |||
416 | struct mlx5_core_sig_ctx { | ||
417 | struct mlx5_core_psv psv_memory; | ||
418 | struct mlx5_core_psv psv_wire; | ||
419 | }; | ||
404 | 420 | ||
405 | struct mlx5_core_mr { | 421 | struct mlx5_core_mr { |
406 | u64 iova; | 422 | u64 iova; |
@@ -746,6 +762,9 @@ void mlx5_db_free(struct mlx5_core_dev *dev, struct mlx5_db *db); | |||
746 | const char *mlx5_command_str(int command); | 762 | const char *mlx5_command_str(int command); |
747 | int mlx5_cmdif_debugfs_init(struct mlx5_core_dev *dev); | 763 | int mlx5_cmdif_debugfs_init(struct mlx5_core_dev *dev); |
748 | void mlx5_cmdif_debugfs_cleanup(struct mlx5_core_dev *dev); | 764 | void mlx5_cmdif_debugfs_cleanup(struct mlx5_core_dev *dev); |
765 | int mlx5_core_create_psv(struct mlx5_core_dev *dev, u32 pdn, | ||
766 | int npsvs, u32 *sig_index); | ||
767 | int mlx5_core_destroy_psv(struct mlx5_core_dev *dev, int psv_num); | ||
749 | 768 | ||
750 | static inline u32 mlx5_mkey_to_idx(u32 mkey) | 769 | static inline u32 mlx5_mkey_to_idx(u32 mkey) |
751 | { | 770 | { |