aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4/main.c
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2008-07-23 11:12:26 -0400
committerRoland Dreier <rolandd@cisco.com>2008-07-23 11:12:26 -0400
commit95d04f0735b4fc837bff9aedcc3f3efb20ddc3d1 (patch)
tree900cd7debae9827c3e20f5199307ae27e83ba862 /drivers/infiniband/hw/mlx4/main.c
parente4044cfc493338cd09870bd45dc646336bb66e9f (diff)
IB/mlx4: Add support for memory management extensions and local DMA L_Key
Add support for the following operations to mlx4 when device firmware supports them: - Send with invalidate and local invalidate send queue work requests; - Allocate/free fast register MRs; - Allocate/free fast register MR page lists; - Fast register MR send queue work requests; - Local DMA L_Key. Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/main.c')
-rw-r--r--drivers/infiniband/hw/mlx4/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index bcf50648fa18..38d6907ab521 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -104,6 +104,12 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
104 props->device_cap_flags |= IB_DEVICE_UD_IP_CSUM; 104 props->device_cap_flags |= IB_DEVICE_UD_IP_CSUM;
105 if (dev->dev->caps.max_gso_sz) 105 if (dev->dev->caps.max_gso_sz)
106 props->device_cap_flags |= IB_DEVICE_UD_TSO; 106 props->device_cap_flags |= IB_DEVICE_UD_TSO;
107 if (dev->dev->caps.bmme_flags & MLX4_BMME_FLAG_RESERVED_LKEY)
108 props->device_cap_flags |= IB_DEVICE_LOCAL_DMA_LKEY;
109 if ((dev->dev->caps.bmme_flags & MLX4_BMME_FLAG_LOCAL_INV) &&
110 (dev->dev->caps.bmme_flags & MLX4_BMME_FLAG_REMOTE_INV) &&
111 (dev->dev->caps.bmme_flags & MLX4_BMME_FLAG_FAST_REG_WR))
112 props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS;
107 113
108 props->vendor_id = be32_to_cpup((__be32 *) (out_mad->data + 36)) & 114 props->vendor_id = be32_to_cpup((__be32 *) (out_mad->data + 36)) &
109 0xffffff; 115 0xffffff;
@@ -127,6 +133,7 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
127 props->max_srq = dev->dev->caps.num_srqs - dev->dev->caps.reserved_srqs; 133 props->max_srq = dev->dev->caps.num_srqs - dev->dev->caps.reserved_srqs;
128 props->max_srq_wr = dev->dev->caps.max_srq_wqes - 1; 134 props->max_srq_wr = dev->dev->caps.max_srq_wqes - 1;
129 props->max_srq_sge = dev->dev->caps.max_srq_sge; 135 props->max_srq_sge = dev->dev->caps.max_srq_sge;
136 props->max_fast_reg_page_list_len = PAGE_SIZE / sizeof (u64);
130 props->local_ca_ack_delay = dev->dev->caps.local_ca_ack_delay; 137 props->local_ca_ack_delay = dev->dev->caps.local_ca_ack_delay;
131 props->atomic_cap = dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_ATOMIC ? 138 props->atomic_cap = dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_ATOMIC ?
132 IB_ATOMIC_HCA : IB_ATOMIC_NONE; 139 IB_ATOMIC_HCA : IB_ATOMIC_NONE;
@@ -565,6 +572,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
565 strlcpy(ibdev->ib_dev.name, "mlx4_%d", IB_DEVICE_NAME_MAX); 572 strlcpy(ibdev->ib_dev.name, "mlx4_%d", IB_DEVICE_NAME_MAX);
566 ibdev->ib_dev.owner = THIS_MODULE; 573 ibdev->ib_dev.owner = THIS_MODULE;
567 ibdev->ib_dev.node_type = RDMA_NODE_IB_CA; 574 ibdev->ib_dev.node_type = RDMA_NODE_IB_CA;
575 ibdev->ib_dev.local_dma_lkey = dev->caps.reserved_lkey;
568 ibdev->ib_dev.phys_port_cnt = dev->caps.num_ports; 576 ibdev->ib_dev.phys_port_cnt = dev->caps.num_ports;
569 ibdev->ib_dev.num_comp_vectors = 1; 577 ibdev->ib_dev.num_comp_vectors = 1;
570 ibdev->ib_dev.dma_device = &dev->pdev->dev; 578 ibdev->ib_dev.dma_device = &dev->pdev->dev;
@@ -627,6 +635,9 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
627 ibdev->ib_dev.get_dma_mr = mlx4_ib_get_dma_mr; 635 ibdev->ib_dev.get_dma_mr = mlx4_ib_get_dma_mr;
628 ibdev->ib_dev.reg_user_mr = mlx4_ib_reg_user_mr; 636 ibdev->ib_dev.reg_user_mr = mlx4_ib_reg_user_mr;
629 ibdev->ib_dev.dereg_mr = mlx4_ib_dereg_mr; 637 ibdev->ib_dev.dereg_mr = mlx4_ib_dereg_mr;
638 ibdev->ib_dev.alloc_fast_reg_mr = mlx4_ib_alloc_fast_reg_mr;
639 ibdev->ib_dev.alloc_fast_reg_page_list = mlx4_ib_alloc_fast_reg_page_list;
640 ibdev->ib_dev.free_fast_reg_page_list = mlx4_ib_free_fast_reg_page_list;
630 ibdev->ib_dev.attach_mcast = mlx4_ib_mcg_attach; 641 ibdev->ib_dev.attach_mcast = mlx4_ib_mcg_attach;
631 ibdev->ib_dev.detach_mcast = mlx4_ib_mcg_detach; 642 ibdev->ib_dev.detach_mcast = mlx4_ib_mcg_detach;
632 ibdev->ib_dev.process_mad = mlx4_ib_process_mad; 643 ibdev->ib_dev.process_mad = mlx4_ib_process_mad;