diff options
| author | Shani Michaeli <shanim@mellanox.com> | 2013-02-06 11:19:14 -0500 |
|---|---|---|
| committer | Roland Dreier <roland@purestorage.com> | 2013-02-25 13:44:32 -0500 |
| commit | 804d6a89a5c0b076317966bcbcd7a63d42241831 (patch) | |
| tree | 07360d8b8c6f099bfc5007b951844a133d4c43bd /include/linux/mlx4 | |
| parent | e448834e3545e02789897ab68905220aea39cd40 (diff) | |
mlx4: Implement memory windows allocation and deallocation
Implement MW allocation and deallocation in mlx4_core and mlx4_ib.
Pass down the enable bind flag when registering memory regions.
Signed-off-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Shani Michaeli <shanim@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'include/linux/mlx4')
| -rw-r--r-- | include/linux/mlx4/device.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index e9fe8caaf8bb..67b4695e5940 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -170,6 +170,7 @@ enum { | |||
| 170 | #define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) | 170 | #define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) |
| 171 | 171 | ||
| 172 | enum { | 172 | enum { |
| 173 | MLX4_BMME_FLAG_WIN_TYPE_2B = 1 << 1, | ||
| 173 | MLX4_BMME_FLAG_LOCAL_INV = 1 << 6, | 174 | MLX4_BMME_FLAG_LOCAL_INV = 1 << 6, |
| 174 | MLX4_BMME_FLAG_REMOTE_INV = 1 << 7, | 175 | MLX4_BMME_FLAG_REMOTE_INV = 1 << 7, |
| 175 | MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, | 176 | MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, |
| @@ -237,7 +238,8 @@ enum { | |||
| 237 | MLX4_PERM_LOCAL_WRITE = 1 << 11, | 238 | MLX4_PERM_LOCAL_WRITE = 1 << 11, |
| 238 | MLX4_PERM_REMOTE_READ = 1 << 12, | 239 | MLX4_PERM_REMOTE_READ = 1 << 12, |
| 239 | MLX4_PERM_REMOTE_WRITE = 1 << 13, | 240 | MLX4_PERM_REMOTE_WRITE = 1 << 13, |
| 240 | MLX4_PERM_ATOMIC = 1 << 14 | 241 | MLX4_PERM_ATOMIC = 1 << 14, |
| 242 | MLX4_PERM_BIND_MW = 1 << 15, | ||
| 241 | }; | 243 | }; |
| 242 | 244 | ||
| 243 | enum { | 245 | enum { |
| @@ -503,6 +505,18 @@ struct mlx4_mr { | |||
| 503 | int enabled; | 505 | int enabled; |
| 504 | }; | 506 | }; |
| 505 | 507 | ||
| 508 | enum mlx4_mw_type { | ||
| 509 | MLX4_MW_TYPE_1 = 1, | ||
| 510 | MLX4_MW_TYPE_2 = 2, | ||
| 511 | }; | ||
| 512 | |||
| 513 | struct mlx4_mw { | ||
| 514 | u32 key; | ||
| 515 | u32 pd; | ||
| 516 | enum mlx4_mw_type type; | ||
| 517 | int enabled; | ||
| 518 | }; | ||
| 519 | |||
| 506 | struct mlx4_fmr { | 520 | struct mlx4_fmr { |
| 507 | struct mlx4_mr mr; | 521 | struct mlx4_mr mr; |
| 508 | struct mlx4_mpt_entry *mpt; | 522 | struct mlx4_mpt_entry *mpt; |
| @@ -803,6 +817,10 @@ int mlx4_mr_alloc(struct mlx4_dev *dev, u32 pd, u64 iova, u64 size, u32 access, | |||
| 803 | int npages, int page_shift, struct mlx4_mr *mr); | 817 | int npages, int page_shift, struct mlx4_mr *mr); |
| 804 | int mlx4_mr_free(struct mlx4_dev *dev, struct mlx4_mr *mr); | 818 | int mlx4_mr_free(struct mlx4_dev *dev, struct mlx4_mr *mr); |
| 805 | int mlx4_mr_enable(struct mlx4_dev *dev, struct mlx4_mr *mr); | 819 | int mlx4_mr_enable(struct mlx4_dev *dev, struct mlx4_mr *mr); |
| 820 | int mlx4_mw_alloc(struct mlx4_dev *dev, u32 pd, enum mlx4_mw_type type, | ||
| 821 | struct mlx4_mw *mw); | ||
| 822 | void mlx4_mw_free(struct mlx4_dev *dev, struct mlx4_mw *mw); | ||
| 823 | int mlx4_mw_enable(struct mlx4_dev *dev, struct mlx4_mw *mw); | ||
| 806 | int mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | 824 | int mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, |
| 807 | int start_index, int npages, u64 *page_list); | 825 | int start_index, int npages, u64 *page_list); |
| 808 | int mlx4_buf_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | 826 | int mlx4_buf_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, |
