aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorSteve Wise <swise@opengridcomputing.com>2008-07-15 02:48:47 -0400
committerRoland Dreier <rolandd@cisco.com>2008-07-15 02:48:47 -0400
commit97d1cc8055c7b3fbd35bf693775d61102e65d174 (patch)
treee120b64dacf4a7b2dc3de88aefbe4888807fd7fb /drivers/infiniband
parent6f7bc01a7382641c61ec036d68ff3a9140b48a1c (diff)
RDMA/cxgb3: Fix up some ib_device_attr fields
- set fw_ver - set hw_ver - set max_qp_wr to something reasonable - set max_cqe to something reasonable Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/cxgb3/cxio_hal.h3
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch.c4
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_provider.c25
3 files changed, 29 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.h b/drivers/infiniband/hw/cxgb3/cxio_hal.h
index 25a880664e6b..a9ff32c36211 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_hal.h
+++ b/drivers/infiniband/hw/cxgb3/cxio_hal.h
@@ -45,13 +45,14 @@
45#define T3_CTRL_QP_SIZE_LOG2 8 45#define T3_CTRL_QP_SIZE_LOG2 8
46#define T3_CTRL_CQ_ID 0 46#define T3_CTRL_CQ_ID 0
47 47
48/* TBD */
49#define T3_MAX_NUM_RI (1<<15) 48#define T3_MAX_NUM_RI (1<<15)
50#define T3_MAX_NUM_QP (1<<15) 49#define T3_MAX_NUM_QP (1<<15)
51#define T3_MAX_NUM_CQ (1<<15) 50#define T3_MAX_NUM_CQ (1<<15)
52#define T3_MAX_NUM_PD (1<<15) 51#define T3_MAX_NUM_PD (1<<15)
53#define T3_MAX_PBL_SIZE 256 52#define T3_MAX_PBL_SIZE 256
54#define T3_MAX_RQ_SIZE 1024 53#define T3_MAX_RQ_SIZE 1024
54#define T3_MAX_QP_DEPTH (T3_MAX_RQ_SIZE-1)
55#define T3_MAX_CQ_DEPTH 8192
55#define T3_MAX_NUM_STAG (1<<15) 56#define T3_MAX_NUM_STAG (1<<15)
56#define T3_MAX_MR_SIZE 0x100000000ULL 57#define T3_MAX_MR_SIZE 0x100000000ULL
57 58
diff --git a/drivers/infiniband/hw/cxgb3/iwch.c b/drivers/infiniband/hw/cxgb3/iwch.c
index 71554eacb13c..e09cc1a81999 100644
--- a/drivers/infiniband/hw/cxgb3/iwch.c
+++ b/drivers/infiniband/hw/cxgb3/iwch.c
@@ -74,11 +74,11 @@ static void rnic_init(struct iwch_dev *rnicp)
74 rnicp->attr.vendor_id = 0x168; 74 rnicp->attr.vendor_id = 0x168;
75 rnicp->attr.vendor_part_id = 7; 75 rnicp->attr.vendor_part_id = 7;
76 rnicp->attr.max_qps = T3_MAX_NUM_QP - 32; 76 rnicp->attr.max_qps = T3_MAX_NUM_QP - 32;
77 rnicp->attr.max_wrs = (1UL << 24) - 1; 77 rnicp->attr.max_wrs = T3_MAX_QP_DEPTH;
78 rnicp->attr.max_sge_per_wr = T3_MAX_SGE; 78 rnicp->attr.max_sge_per_wr = T3_MAX_SGE;
79 rnicp->attr.max_sge_per_rdma_write_wr = T3_MAX_SGE; 79 rnicp->attr.max_sge_per_rdma_write_wr = T3_MAX_SGE;
80 rnicp->attr.max_cqs = T3_MAX_NUM_CQ - 1; 80 rnicp->attr.max_cqs = T3_MAX_NUM_CQ - 1;
81 rnicp->attr.max_cqes_per_cq = (1UL << 24) - 1; 81 rnicp->attr.max_cqes_per_cq = T3_MAX_CQ_DEPTH;
82 rnicp->attr.max_mem_regs = cxio_num_stags(&rnicp->rdev); 82 rnicp->attr.max_mem_regs = cxio_num_stags(&rnicp->rdev);
83 rnicp->attr.max_phys_buf_entries = T3_MAX_PBL_SIZE; 83 rnicp->attr.max_phys_buf_entries = T3_MAX_PBL_SIZE;
84 rnicp->attr.max_pds = T3_MAX_NUM_PD - 1; 84 rnicp->attr.max_pds = T3_MAX_NUM_PD - 1;
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
index 5d504f3ed68b..5f4380657392 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
@@ -1093,6 +1093,29 @@ static int iwch_query_gid(struct ib_device *ibdev, u8 port,
1093 return 0; 1093 return 0;
1094} 1094}
1095 1095
1096static u64 fw_vers_string_to_u64(struct iwch_dev *iwch_dev)
1097{
1098 struct ethtool_drvinfo info;
1099 struct net_device *lldev = iwch_dev->rdev.t3cdev_p->lldev;
1100 char *cp, *next;
1101 unsigned fw_maj, fw_min, fw_mic;
1102
1103 rtnl_lock();
1104 lldev->ethtool_ops->get_drvinfo(lldev, &info);
1105 rtnl_unlock();
1106
1107 next = info.fw_version + 1;
1108 cp = strsep(&next, ".");
1109 sscanf(cp, "%i", &fw_maj);
1110 cp = strsep(&next, ".");
1111 sscanf(cp, "%i", &fw_min);
1112 cp = strsep(&next, ".");
1113 sscanf(cp, "%i", &fw_mic);
1114
1115 return (((u64)fw_maj & 0xffff) << 32) | ((fw_min & 0xffff) << 16) |
1116 (fw_mic & 0xffff);
1117}
1118
1096static int iwch_query_device(struct ib_device *ibdev, 1119static int iwch_query_device(struct ib_device *ibdev,
1097 struct ib_device_attr *props) 1120 struct ib_device_attr *props)
1098{ 1121{
@@ -1103,6 +1126,8 @@ static int iwch_query_device(struct ib_device *ibdev,
1103 dev = to_iwch_dev(ibdev); 1126 dev = to_iwch_dev(ibdev);
1104 memset(props, 0, sizeof *props); 1127 memset(props, 0, sizeof *props);
1105 memcpy(&props->sys_image_guid, dev->rdev.t3cdev_p->lldev->dev_addr, 6); 1128 memcpy(&props->sys_image_guid, dev->rdev.t3cdev_p->lldev->dev_addr, 6);
1129 props->hw_ver = dev->rdev.t3cdev_p->type;
1130 props->fw_ver = fw_vers_string_to_u64(dev);
1106 props->device_cap_flags = dev->device_cap_flags; 1131 props->device_cap_flags = dev->device_cap_flags;
1107 props->vendor_id = (u32)dev->rdev.rnic_info.pdev->vendor; 1132 props->vendor_id = (u32)dev->rdev.rnic_info.pdev->vendor;
1108 props->vendor_part_id = (u32)dev->rdev.rnic_info.pdev->device; 1133 props->vendor_part_id = (u32)dev->rdev.rnic_info.pdev->device;