diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2014-02-23 07:19:10 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-03-07 14:26:49 -0500 |
commit | 3bcdb17a5e88288ead90be3c107e754a6075a5b0 (patch) | |
tree | 622f8951b185bc090d4b0943786e5cb504f105e6 /include/linux/mlx5 | |
parent | 2ac45934f8700e0c2a579f6ee85a56c6e9ea89d5 (diff) |
IB/mlx5: Keep mlx5 MRs in a radix tree under device
This will be useful when processing signature errors on a specific
key. The mlx5 driver will lookup the matching mlx5 memory region
structure and mark it as dirty (contains signature errors).
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'include/linux/mlx5')
-rw-r--r-- | include/linux/mlx5/driver.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index e1cb657ccade..e562e01e59c7 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h | |||
@@ -491,6 +491,13 @@ struct mlx5_srq_table { | |||
491 | struct radix_tree_root tree; | 491 | struct radix_tree_root tree; |
492 | }; | 492 | }; |
493 | 493 | ||
494 | struct mlx5_mr_table { | ||
495 | /* protect radix tree | ||
496 | */ | ||
497 | rwlock_t lock; | ||
498 | struct radix_tree_root tree; | ||
499 | }; | ||
500 | |||
494 | struct mlx5_priv { | 501 | struct mlx5_priv { |
495 | char name[MLX5_MAX_NAME_LEN]; | 502 | char name[MLX5_MAX_NAME_LEN]; |
496 | struct mlx5_eq_table eq_table; | 503 | struct mlx5_eq_table eq_table; |
@@ -520,6 +527,10 @@ struct mlx5_priv { | |||
520 | struct mlx5_cq_table cq_table; | 527 | struct mlx5_cq_table cq_table; |
521 | /* end: cq staff */ | 528 | /* end: cq staff */ |
522 | 529 | ||
530 | /* start: mr staff */ | ||
531 | struct mlx5_mr_table mr_table; | ||
532 | /* end: mr staff */ | ||
533 | |||
523 | /* start: alloc staff */ | 534 | /* start: alloc staff */ |
524 | struct mutex pgdir_mutex; | 535 | struct mutex pgdir_mutex; |
525 | struct list_head pgdir_list; | 536 | struct list_head pgdir_list; |
@@ -667,6 +678,11 @@ static inline void mlx5_vfree(const void *addr) | |||
667 | kfree(addr); | 678 | kfree(addr); |
668 | } | 679 | } |
669 | 680 | ||
681 | static inline u32 mlx5_base_mkey(const u32 key) | ||
682 | { | ||
683 | return key & 0xffffff00u; | ||
684 | } | ||
685 | |||
670 | int mlx5_dev_init(struct mlx5_core_dev *dev, struct pci_dev *pdev); | 686 | int mlx5_dev_init(struct mlx5_core_dev *dev, struct pci_dev *pdev); |
671 | void mlx5_dev_cleanup(struct mlx5_core_dev *dev); | 687 | void mlx5_dev_cleanup(struct mlx5_core_dev *dev); |
672 | int mlx5_cmd_init(struct mlx5_core_dev *dev); | 688 | int mlx5_cmd_init(struct mlx5_core_dev *dev); |
@@ -701,6 +717,8 @@ int mlx5_core_query_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, | |||
701 | struct mlx5_query_srq_mbox_out *out); | 717 | struct mlx5_query_srq_mbox_out *out); |
702 | int mlx5_core_arm_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, | 718 | int mlx5_core_arm_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, |
703 | u16 lwm, int is_srq); | 719 | u16 lwm, int is_srq); |
720 | void mlx5_init_mr_table(struct mlx5_core_dev *dev); | ||
721 | void mlx5_cleanup_mr_table(struct mlx5_core_dev *dev); | ||
704 | int mlx5_core_create_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, | 722 | int mlx5_core_create_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, |
705 | struct mlx5_create_mkey_mbox_in *in, int inlen, | 723 | struct mlx5_create_mkey_mbox_in *in, int inlen, |
706 | mlx5_cmd_cbk_t callback, void *context, | 724 | mlx5_cmd_cbk_t callback, void *context, |