diff options
author | Eli Cohen <eli@dev.mellanox.co.il> | 2013-10-23 02:53:14 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-11-08 17:42:59 -0500 |
commit | 746b5583c1a48a837f4891adaff5e09d61b204a6 (patch) | |
tree | c939fde4e644095bcf476787aebe031f20150d0c /include/linux/mlx5 | |
parent | 51ee86a4af639e4ee8953dd02ad8a766c40f46a1 (diff) |
IB/mlx5: Multithreaded create MR
Use asynchronous commands to execute up to eight concurrent create MR
commands. This is to fill memory caches faster so we keep consuming
from there. Also, increase timeout for shrinking caches to five
minutes.
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'include/linux/mlx5')
-rw-r--r-- | include/linux/mlx5/driver.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 6b8c496572c8..513619a75695 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h | |||
@@ -557,9 +557,11 @@ typedef void (*mlx5_cmd_cbk_t)(int status, void *context); | |||
557 | struct mlx5_cmd_work_ent { | 557 | struct mlx5_cmd_work_ent { |
558 | struct mlx5_cmd_msg *in; | 558 | struct mlx5_cmd_msg *in; |
559 | struct mlx5_cmd_msg *out; | 559 | struct mlx5_cmd_msg *out; |
560 | void *uout; | ||
561 | int uout_size; | ||
560 | mlx5_cmd_cbk_t callback; | 562 | mlx5_cmd_cbk_t callback; |
561 | void *context; | 563 | void *context; |
562 | int idx; | 564 | int idx; |
563 | struct completion done; | 565 | struct completion done; |
564 | struct mlx5_cmd *cmd; | 566 | struct mlx5_cmd *cmd; |
565 | struct work_struct work; | 567 | struct work_struct work; |
@@ -570,6 +572,7 @@ struct mlx5_cmd_work_ent { | |||
570 | u8 token; | 572 | u8 token; |
571 | struct timespec ts1; | 573 | struct timespec ts1; |
572 | struct timespec ts2; | 574 | struct timespec ts2; |
575 | u16 op; | ||
573 | }; | 576 | }; |
574 | 577 | ||
575 | struct mlx5_pas { | 578 | struct mlx5_pas { |
@@ -653,6 +656,9 @@ void mlx5_cmd_use_polling(struct mlx5_core_dev *dev); | |||
653 | int mlx5_cmd_status_to_err(struct mlx5_outbox_hdr *hdr); | 656 | int mlx5_cmd_status_to_err(struct mlx5_outbox_hdr *hdr); |
654 | int mlx5_cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out, | 657 | int mlx5_cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out, |
655 | int out_size); | 658 | int out_size); |
659 | int mlx5_cmd_exec_cb(struct mlx5_core_dev *dev, void *in, int in_size, | ||
660 | void *out, int out_size, mlx5_cmd_cbk_t callback, | ||
661 | void *context); | ||
656 | int mlx5_cmd_alloc_uar(struct mlx5_core_dev *dev, u32 *uarn); | 662 | int mlx5_cmd_alloc_uar(struct mlx5_core_dev *dev, u32 *uarn); |
657 | int mlx5_cmd_free_uar(struct mlx5_core_dev *dev, u32 uarn); | 663 | int mlx5_cmd_free_uar(struct mlx5_core_dev *dev, u32 uarn); |
658 | int mlx5_alloc_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari); | 664 | int mlx5_alloc_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari); |
@@ -676,7 +682,9 @@ int mlx5_core_query_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, | |||
676 | int mlx5_core_arm_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, | 682 | int mlx5_core_arm_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, |
677 | u16 lwm, int is_srq); | 683 | u16 lwm, int is_srq); |
678 | int mlx5_core_create_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, | 684 | int mlx5_core_create_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, |
679 | struct mlx5_create_mkey_mbox_in *in, int inlen); | 685 | struct mlx5_create_mkey_mbox_in *in, int inlen, |
686 | mlx5_cmd_cbk_t callback, void *context, | ||
687 | struct mlx5_create_mkey_mbox_out *out); | ||
680 | int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr); | 688 | int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr); |
681 | int mlx5_core_query_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, | 689 | int mlx5_core_query_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, |
682 | struct mlx5_query_mkey_mbox_out *out, int outlen); | 690 | struct mlx5_query_mkey_mbox_out *out, int outlen); |
@@ -745,6 +753,11 @@ static inline u32 mlx5_idx_to_mkey(u32 mkey_idx) | |||
745 | return mkey_idx << 8; | 753 | return mkey_idx << 8; |
746 | } | 754 | } |
747 | 755 | ||
756 | static inline u8 mlx5_mkey_variant(u32 mkey) | ||
757 | { | ||
758 | return mkey & 0xff; | ||
759 | } | ||
760 | |||
748 | enum { | 761 | enum { |
749 | MLX5_PROF_MASK_QP_SIZE = (u64)1 << 0, | 762 | MLX5_PROF_MASK_QP_SIZE = (u64)1 << 0, |
750 | MLX5_PROF_MASK_MR_CACHE = (u64)1 << 1, | 763 | MLX5_PROF_MASK_MR_CACHE = (u64)1 << 1, |