diff options
author | Shani Michaeli <shanim@mellanox.com> | 2013-02-06 11:19:16 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-02-25 13:44:32 -0500 |
commit | b425388dc1f5672006517f8927d66bf7f22649d6 (patch) | |
tree | 8678b49487bce0c0855c76450b09e676902e1455 /drivers/infiniband | |
parent | 6ff63e194066a1f14aee805366a1d79c541fddae (diff) |
IB/mlx4: Advertise MW support
Indicate memory windows support through device capabilities, kernel
verb entries and the relevant uverbs command mask entries.
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 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/mlx4/main.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 3fdd1c17cef7..23d734349d8e 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
@@ -137,6 +137,14 @@ static int mlx4_ib_query_device(struct ib_device *ibdev, | |||
137 | props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS; | 137 | props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS; |
138 | if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_XRC) | 138 | if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_XRC) |
139 | props->device_cap_flags |= IB_DEVICE_XRC; | 139 | props->device_cap_flags |= IB_DEVICE_XRC; |
140 | if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_MEM_WINDOW) | ||
141 | props->device_cap_flags |= IB_DEVICE_MEM_WINDOW; | ||
142 | if (dev->dev->caps.bmme_flags & MLX4_BMME_FLAG_TYPE_2_WIN) { | ||
143 | if (dev->dev->caps.bmme_flags & MLX4_BMME_FLAG_WIN_TYPE_2B) | ||
144 | props->device_cap_flags |= IB_DEVICE_MEM_WINDOW_TYPE_2B; | ||
145 | else | ||
146 | props->device_cap_flags |= IB_DEVICE_MEM_WINDOW_TYPE_2A; | ||
147 | } | ||
140 | 148 | ||
141 | props->vendor_id = be32_to_cpup((__be32 *) (out_mad->data + 36)) & | 149 | props->vendor_id = be32_to_cpup((__be32 *) (out_mad->data + 36)) & |
142 | 0xffffff; | 150 | 0xffffff; |
@@ -1434,6 +1442,17 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) | |||
1434 | ibdev->ib_dev.dealloc_fmr = mlx4_ib_fmr_dealloc; | 1442 | ibdev->ib_dev.dealloc_fmr = mlx4_ib_fmr_dealloc; |
1435 | } | 1443 | } |
1436 | 1444 | ||
1445 | if (dev->caps.flags & MLX4_DEV_CAP_FLAG_MEM_WINDOW || | ||
1446 | dev->caps.bmme_flags & MLX4_BMME_FLAG_TYPE_2_WIN) { | ||
1447 | ibdev->ib_dev.alloc_mw = mlx4_ib_alloc_mw; | ||
1448 | ibdev->ib_dev.bind_mw = mlx4_ib_bind_mw; | ||
1449 | ibdev->ib_dev.dealloc_mw = mlx4_ib_dealloc_mw; | ||
1450 | |||
1451 | ibdev->ib_dev.uverbs_cmd_mask |= | ||
1452 | (1ull << IB_USER_VERBS_CMD_ALLOC_MW) | | ||
1453 | (1ull << IB_USER_VERBS_CMD_DEALLOC_MW); | ||
1454 | } | ||
1455 | |||
1437 | if (dev->caps.flags & MLX4_DEV_CAP_FLAG_XRC) { | 1456 | if (dev->caps.flags & MLX4_DEV_CAP_FLAG_XRC) { |
1438 | ibdev->ib_dev.alloc_xrcd = mlx4_ib_alloc_xrcd; | 1457 | ibdev->ib_dev.alloc_xrcd = mlx4_ib_alloc_xrcd; |
1439 | ibdev->ib_dev.dealloc_xrcd = mlx4_ib_dealloc_xrcd; | 1458 | ibdev->ib_dev.dealloc_xrcd = mlx4_ib_dealloc_xrcd; |