aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5
diff options
context:
space:
mode:
authorEli Cohen <eli@dev.mellanox.co.il>2013-10-23 02:53:14 -0400
committerRoland Dreier <roland@purestorage.com>2013-11-08 17:42:59 -0500
commit746b5583c1a48a837f4891adaff5e09d61b204a6 (patch)
treec939fde4e644095bcf476787aebe031f20150d0c /include/linux/mlx5
parent51ee86a4af639e4ee8953dd02ad8a766c40f46a1 (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.h17
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);
557struct mlx5_cmd_work_ent { 557struct 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
575struct mlx5_pas { 578struct mlx5_pas {
@@ -653,6 +656,9 @@ void mlx5_cmd_use_polling(struct mlx5_core_dev *dev);
653int mlx5_cmd_status_to_err(struct mlx5_outbox_hdr *hdr); 656int mlx5_cmd_status_to_err(struct mlx5_outbox_hdr *hdr);
654int mlx5_cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out, 657int mlx5_cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out,
655 int out_size); 658 int out_size);
659int 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);
656int mlx5_cmd_alloc_uar(struct mlx5_core_dev *dev, u32 *uarn); 662int mlx5_cmd_alloc_uar(struct mlx5_core_dev *dev, u32 *uarn);
657int mlx5_cmd_free_uar(struct mlx5_core_dev *dev, u32 uarn); 663int mlx5_cmd_free_uar(struct mlx5_core_dev *dev, u32 uarn);
658int mlx5_alloc_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari); 664int 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,
676int mlx5_core_arm_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, 682int 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);
678int mlx5_core_create_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, 684int 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);
680int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr); 688int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr);
681int mlx5_core_query_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, 689int 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
756static inline u8 mlx5_mkey_variant(u32 mkey)
757{
758 return mkey & 0xff;
759}
760
748enum { 761enum {
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,