|
@@ -78,34 +78,28 @@ static void iser_event_handler(struct ib_event_handler *handler,
|
|
*/
|
|
*/
|
|
static int iser_create_device_ib_res(struct iser_device *device)
|
|
static int iser_create_device_ib_res(struct iser_device *device)
|
|
{
|
|
{
|
|
- struct ib_device_attr *dev_attr = &device->dev_attr;
|
|
|
|
|
|
+ struct ib_device *ib_dev = device->ib_device;
|
|
int ret, i, max_cqe;
|
|
int ret, i, max_cqe;
|
|
|
|
|
|
- ret = ib_query_device(device->ib_device, dev_attr);
|
|
|
|
- if (ret) {
|
|
|
|
- pr_warn("Query device failed for %s\n", device->ib_device->name);
|
|
|
|
- return ret;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
ret = iser_assign_reg_ops(device);
|
|
ret = iser_assign_reg_ops(device);
|
|
if (ret)
|
|
if (ret)
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
device->comps_used = min_t(int, num_online_cpus(),
|
|
device->comps_used = min_t(int, num_online_cpus(),
|
|
- device->ib_device->num_comp_vectors);
|
|
|
|
|
|
+ ib_dev->num_comp_vectors);
|
|
|
|
|
|
device->comps = kcalloc(device->comps_used, sizeof(*device->comps),
|
|
device->comps = kcalloc(device->comps_used, sizeof(*device->comps),
|
|
GFP_KERNEL);
|
|
GFP_KERNEL);
|
|
if (!device->comps)
|
|
if (!device->comps)
|
|
goto comps_err;
|
|
goto comps_err;
|
|
|
|
|
|
- max_cqe = min(ISER_MAX_CQ_LEN, dev_attr->max_cqe);
|
|
|
|
|
|
+ max_cqe = min(ISER_MAX_CQ_LEN, ib_dev->attrs.max_cqe);
|
|
|
|
|
|
iser_info("using %d CQs, device %s supports %d vectors max_cqe %d\n",
|
|
iser_info("using %d CQs, device %s supports %d vectors max_cqe %d\n",
|
|
- device->comps_used, device->ib_device->name,
|
|
|
|
- device->ib_device->num_comp_vectors, max_cqe);
|
|
|
|
|
|
+ device->comps_used, ib_dev->name,
|
|
|
|
+ ib_dev->num_comp_vectors, max_cqe);
|
|
|
|
|
|
- device->pd = ib_alloc_pd(device->ib_device);
|
|
|
|
|
|
+ device->pd = ib_alloc_pd(ib_dev);
|
|
if (IS_ERR(device->pd))
|
|
if (IS_ERR(device->pd))
|
|
goto pd_err;
|
|
goto pd_err;
|
|
|
|
|
|
@@ -116,7 +110,7 @@ static int iser_create_device_ib_res(struct iser_device *device)
|
|
comp->device = device;
|
|
comp->device = device;
|
|
cq_attr.cqe = max_cqe;
|
|
cq_attr.cqe = max_cqe;
|
|
cq_attr.comp_vector = i;
|
|
cq_attr.comp_vector = i;
|
|
- comp->cq = ib_create_cq(device->ib_device,
|
|
|
|
|
|
+ comp->cq = ib_create_cq(ib_dev,
|
|
iser_cq_callback,
|
|
iser_cq_callback,
|
|
iser_cq_event_callback,
|
|
iser_cq_event_callback,
|
|
(void *)comp,
|
|
(void *)comp,
|
|
@@ -464,7 +458,7 @@ static int iser_create_ib_conn_res(struct ib_conn *ib_conn)
|
|
struct iser_conn *iser_conn = container_of(ib_conn, struct iser_conn,
|
|
struct iser_conn *iser_conn = container_of(ib_conn, struct iser_conn,
|
|
ib_conn);
|
|
ib_conn);
|
|
struct iser_device *device;
|
|
struct iser_device *device;
|
|
- struct ib_device_attr *dev_attr;
|
|
|
|
|
|
+ struct ib_device *ib_dev;
|
|
struct ib_qp_init_attr init_attr;
|
|
struct ib_qp_init_attr init_attr;
|
|
int ret = -ENOMEM;
|
|
int ret = -ENOMEM;
|
|
int index, min_index = 0;
|
|
int index, min_index = 0;
|
|
@@ -472,7 +466,7 @@ static int iser_create_ib_conn_res(struct ib_conn *ib_conn)
|
|
BUG_ON(ib_conn->device == NULL);
|
|
BUG_ON(ib_conn->device == NULL);
|
|
|
|
|
|
device = ib_conn->device;
|
|
device = ib_conn->device;
|
|
- dev_attr = &device->dev_attr;
|
|
|
|
|
|
+ ib_dev = device->ib_device;
|
|
|
|
|
|
memset(&init_attr, 0, sizeof init_attr);
|
|
memset(&init_attr, 0, sizeof init_attr);
|
|
|
|
|
|
@@ -503,16 +497,16 @@ static int iser_create_ib_conn_res(struct ib_conn *ib_conn)
|
|
iser_conn->max_cmds =
|
|
iser_conn->max_cmds =
|
|
ISER_GET_MAX_XMIT_CMDS(ISER_QP_SIG_MAX_REQ_DTOS);
|
|
ISER_GET_MAX_XMIT_CMDS(ISER_QP_SIG_MAX_REQ_DTOS);
|
|
} else {
|
|
} else {
|
|
- if (dev_attr->max_qp_wr > ISER_QP_MAX_REQ_DTOS) {
|
|
|
|
|
|
+ if (ib_dev->attrs.max_qp_wr > ISER_QP_MAX_REQ_DTOS) {
|
|
init_attr.cap.max_send_wr = ISER_QP_MAX_REQ_DTOS + 1;
|
|
init_attr.cap.max_send_wr = ISER_QP_MAX_REQ_DTOS + 1;
|
|
iser_conn->max_cmds =
|
|
iser_conn->max_cmds =
|
|
ISER_GET_MAX_XMIT_CMDS(ISER_QP_MAX_REQ_DTOS);
|
|
ISER_GET_MAX_XMIT_CMDS(ISER_QP_MAX_REQ_DTOS);
|
|
} else {
|
|
} else {
|
|
- init_attr.cap.max_send_wr = dev_attr->max_qp_wr;
|
|
|
|
|
|
+ init_attr.cap.max_send_wr = ib_dev->attrs.max_qp_wr;
|
|
iser_conn->max_cmds =
|
|
iser_conn->max_cmds =
|
|
- ISER_GET_MAX_XMIT_CMDS(dev_attr->max_qp_wr);
|
|
|
|
|
|
+ ISER_GET_MAX_XMIT_CMDS(ib_dev->attrs.max_qp_wr);
|
|
iser_dbg("device %s supports max_send_wr %d\n",
|
|
iser_dbg("device %s supports max_send_wr %d\n",
|
|
- device->ib_device->name, dev_attr->max_qp_wr);
|
|
|
|
|
|
+ device->ib_device->name, ib_dev->attrs.max_qp_wr);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -756,7 +750,7 @@ iser_calc_scsi_params(struct iser_conn *iser_conn,
|
|
|
|
|
|
sg_tablesize = DIV_ROUND_UP(max_sectors * 512, SIZE_4K);
|
|
sg_tablesize = DIV_ROUND_UP(max_sectors * 512, SIZE_4K);
|
|
sup_sg_tablesize = min_t(unsigned, ISCSI_ISER_MAX_SG_TABLESIZE,
|
|
sup_sg_tablesize = min_t(unsigned, ISCSI_ISER_MAX_SG_TABLESIZE,
|
|
- device->dev_attr.max_fast_reg_page_list_len);
|
|
|
|
|
|
+ device->ib_device->attrs.max_fast_reg_page_list_len);
|
|
|
|
|
|
if (sg_tablesize > sup_sg_tablesize) {
|
|
if (sg_tablesize > sup_sg_tablesize) {
|
|
sg_tablesize = sup_sg_tablesize;
|
|
sg_tablesize = sup_sg_tablesize;
|
|
@@ -799,7 +793,7 @@ static void iser_addr_handler(struct rdma_cm_id *cma_id)
|
|
|
|
|
|
/* connection T10-PI support */
|
|
/* connection T10-PI support */
|
|
if (iser_pi_enable) {
|
|
if (iser_pi_enable) {
|
|
- if (!(device->dev_attr.device_cap_flags &
|
|
|
|
|
|
+ if (!(device->ib_device->attrs.device_cap_flags &
|
|
IB_DEVICE_SIGNATURE_HANDOVER)) {
|
|
IB_DEVICE_SIGNATURE_HANDOVER)) {
|
|
iser_warn("T10-PI requested but not supported on %s, "
|
|
iser_warn("T10-PI requested but not supported on %s, "
|
|
"continue without T10-PI\n",
|
|
"continue without T10-PI\n",
|
|
@@ -841,7 +835,7 @@ static void iser_route_handler(struct rdma_cm_id *cma_id)
|
|
goto failure;
|
|
goto failure;
|
|
|
|
|
|
memset(&conn_param, 0, sizeof conn_param);
|
|
memset(&conn_param, 0, sizeof conn_param);
|
|
- conn_param.responder_resources = device->dev_attr.max_qp_rd_atom;
|
|
|
|
|
|
+ conn_param.responder_resources = device->ib_device->attrs.max_qp_rd_atom;
|
|
conn_param.initiator_depth = 1;
|
|
conn_param.initiator_depth = 1;
|
|
conn_param.retry_count = 7;
|
|
conn_param.retry_count = 7;
|
|
conn_param.rnr_retry_count = 6;
|
|
conn_param.rnr_retry_count = 6;
|