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>
This commit is contained in:
Steve Wise 2008-07-14 23:48:47 -07:00 коммит произвёл Roland Dreier
Родитель 6f7bc01a73
Коммит 97d1cc8055
3 изменённых файлов: 29 добавлений и 3 удалений

Просмотреть файл

@ -45,13 +45,14 @@
#define T3_CTRL_QP_SIZE_LOG2 8 #define T3_CTRL_QP_SIZE_LOG2 8
#define T3_CTRL_CQ_ID 0 #define T3_CTRL_CQ_ID 0
/* TBD */
#define T3_MAX_NUM_RI (1<<15) #define T3_MAX_NUM_RI (1<<15)
#define T3_MAX_NUM_QP (1<<15) #define T3_MAX_NUM_QP (1<<15)
#define T3_MAX_NUM_CQ (1<<15) #define T3_MAX_NUM_CQ (1<<15)
#define T3_MAX_NUM_PD (1<<15) #define T3_MAX_NUM_PD (1<<15)
#define T3_MAX_PBL_SIZE 256 #define T3_MAX_PBL_SIZE 256
#define T3_MAX_RQ_SIZE 1024 #define T3_MAX_RQ_SIZE 1024
#define T3_MAX_QP_DEPTH (T3_MAX_RQ_SIZE-1)
#define T3_MAX_CQ_DEPTH 8192
#define T3_MAX_NUM_STAG (1<<15) #define T3_MAX_NUM_STAG (1<<15)
#define T3_MAX_MR_SIZE 0x100000000ULL #define T3_MAX_MR_SIZE 0x100000000ULL

Просмотреть файл

@ -74,11 +74,11 @@ static void rnic_init(struct iwch_dev *rnicp)
rnicp->attr.vendor_id = 0x168; rnicp->attr.vendor_id = 0x168;
rnicp->attr.vendor_part_id = 7; rnicp->attr.vendor_part_id = 7;
rnicp->attr.max_qps = T3_MAX_NUM_QP - 32; rnicp->attr.max_qps = T3_MAX_NUM_QP - 32;
rnicp->attr.max_wrs = (1UL << 24) - 1; rnicp->attr.max_wrs = T3_MAX_QP_DEPTH;
rnicp->attr.max_sge_per_wr = T3_MAX_SGE; rnicp->attr.max_sge_per_wr = T3_MAX_SGE;
rnicp->attr.max_sge_per_rdma_write_wr = T3_MAX_SGE; rnicp->attr.max_sge_per_rdma_write_wr = T3_MAX_SGE;
rnicp->attr.max_cqs = T3_MAX_NUM_CQ - 1; rnicp->attr.max_cqs = T3_MAX_NUM_CQ - 1;
rnicp->attr.max_cqes_per_cq = (1UL << 24) - 1; rnicp->attr.max_cqes_per_cq = T3_MAX_CQ_DEPTH;
rnicp->attr.max_mem_regs = cxio_num_stags(&rnicp->rdev); rnicp->attr.max_mem_regs = cxio_num_stags(&rnicp->rdev);
rnicp->attr.max_phys_buf_entries = T3_MAX_PBL_SIZE; rnicp->attr.max_phys_buf_entries = T3_MAX_PBL_SIZE;
rnicp->attr.max_pds = T3_MAX_NUM_PD - 1; rnicp->attr.max_pds = T3_MAX_NUM_PD - 1;

Просмотреть файл

@ -1093,6 +1093,29 @@ static int iwch_query_gid(struct ib_device *ibdev, u8 port,
return 0; return 0;
} }
static u64 fw_vers_string_to_u64(struct iwch_dev *iwch_dev)
{
struct ethtool_drvinfo info;
struct net_device *lldev = iwch_dev->rdev.t3cdev_p->lldev;
char *cp, *next;
unsigned fw_maj, fw_min, fw_mic;
rtnl_lock();
lldev->ethtool_ops->get_drvinfo(lldev, &info);
rtnl_unlock();
next = info.fw_version + 1;
cp = strsep(&next, ".");
sscanf(cp, "%i", &fw_maj);
cp = strsep(&next, ".");
sscanf(cp, "%i", &fw_min);
cp = strsep(&next, ".");
sscanf(cp, "%i", &fw_mic);
return (((u64)fw_maj & 0xffff) << 32) | ((fw_min & 0xffff) << 16) |
(fw_mic & 0xffff);
}
static int iwch_query_device(struct ib_device *ibdev, static int iwch_query_device(struct ib_device *ibdev,
struct ib_device_attr *props) struct ib_device_attr *props)
{ {
@ -1103,6 +1126,8 @@ static int iwch_query_device(struct ib_device *ibdev,
dev = to_iwch_dev(ibdev); dev = to_iwch_dev(ibdev);
memset(props, 0, sizeof *props); memset(props, 0, sizeof *props);
memcpy(&props->sys_image_guid, dev->rdev.t3cdev_p->lldev->dev_addr, 6); memcpy(&props->sys_image_guid, dev->rdev.t3cdev_p->lldev->dev_addr, 6);
props->hw_ver = dev->rdev.t3cdev_p->type;
props->fw_ver = fw_vers_string_to_u64(dev);
props->device_cap_flags = dev->device_cap_flags; props->device_cap_flags = dev->device_cap_flags;
props->vendor_id = (u32)dev->rdev.rnic_info.pdev->vendor; props->vendor_id = (u32)dev->rdev.rnic_info.pdev->vendor;
props->vendor_part_id = (u32)dev->rdev.rnic_info.pdev->device; props->vendor_part_id = (u32)dev->rdev.rnic_info.pdev->device;