aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/ulp/srp')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c27
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.h1
2 files changed, 26 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 5e8ac577f0ad..39bf057fbc43 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -197,7 +197,7 @@ static int srp_create_target_ib(struct srp_target_port *target)
197 return -ENOMEM; 197 return -ENOMEM;
198 198
199 target->cq = ib_create_cq(target->srp_host->dev->dev, srp_completion, 199 target->cq = ib_create_cq(target->srp_host->dev->dev, srp_completion,
200 NULL, target, SRP_CQ_SIZE); 200 NULL, target, SRP_CQ_SIZE, 0);
201 if (IS_ERR(target->cq)) { 201 if (IS_ERR(target->cq)) {
202 ret = PTR_ERR(target->cq); 202 ret = PTR_ERR(target->cq);
203 goto out; 203 goto out;
@@ -1468,6 +1468,25 @@ static ssize_t show_dgid(struct class_device *cdev, char *buf)
1468 be16_to_cpu(((__be16 *) target->path.dgid.raw)[7])); 1468 be16_to_cpu(((__be16 *) target->path.dgid.raw)[7]));
1469} 1469}
1470 1470
1471static ssize_t show_orig_dgid(struct class_device *cdev, char *buf)
1472{
1473 struct srp_target_port *target = host_to_target(class_to_shost(cdev));
1474
1475 if (target->state == SRP_TARGET_DEAD ||
1476 target->state == SRP_TARGET_REMOVED)
1477 return -ENODEV;
1478
1479 return sprintf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
1480 be16_to_cpu(target->orig_dgid[0]),
1481 be16_to_cpu(target->orig_dgid[1]),
1482 be16_to_cpu(target->orig_dgid[2]),
1483 be16_to_cpu(target->orig_dgid[3]),
1484 be16_to_cpu(target->orig_dgid[4]),
1485 be16_to_cpu(target->orig_dgid[5]),
1486 be16_to_cpu(target->orig_dgid[6]),
1487 be16_to_cpu(target->orig_dgid[7]));
1488}
1489
1471static ssize_t show_zero_req_lim(struct class_device *cdev, char *buf) 1490static ssize_t show_zero_req_lim(struct class_device *cdev, char *buf)
1472{ 1491{
1473 struct srp_target_port *target = host_to_target(class_to_shost(cdev)); 1492 struct srp_target_port *target = host_to_target(class_to_shost(cdev));
@@ -1498,6 +1517,7 @@ static CLASS_DEVICE_ATTR(ioc_guid, S_IRUGO, show_ioc_guid, NULL);
1498static CLASS_DEVICE_ATTR(service_id, S_IRUGO, show_service_id, NULL); 1517static CLASS_DEVICE_ATTR(service_id, S_IRUGO, show_service_id, NULL);
1499static CLASS_DEVICE_ATTR(pkey, S_IRUGO, show_pkey, NULL); 1518static CLASS_DEVICE_ATTR(pkey, S_IRUGO, show_pkey, NULL);
1500static CLASS_DEVICE_ATTR(dgid, S_IRUGO, show_dgid, NULL); 1519static CLASS_DEVICE_ATTR(dgid, S_IRUGO, show_dgid, NULL);
1520static CLASS_DEVICE_ATTR(orig_dgid, S_IRUGO, show_orig_dgid, NULL);
1501static CLASS_DEVICE_ATTR(zero_req_lim, S_IRUGO, show_zero_req_lim, NULL); 1521static CLASS_DEVICE_ATTR(zero_req_lim, S_IRUGO, show_zero_req_lim, NULL);
1502static CLASS_DEVICE_ATTR(local_ib_port, S_IRUGO, show_local_ib_port, NULL); 1522static CLASS_DEVICE_ATTR(local_ib_port, S_IRUGO, show_local_ib_port, NULL);
1503static CLASS_DEVICE_ATTR(local_ib_device, S_IRUGO, show_local_ib_device, NULL); 1523static CLASS_DEVICE_ATTR(local_ib_device, S_IRUGO, show_local_ib_device, NULL);
@@ -1508,6 +1528,7 @@ static struct class_device_attribute *srp_host_attrs[] = {
1508 &class_device_attr_service_id, 1528 &class_device_attr_service_id,
1509 &class_device_attr_pkey, 1529 &class_device_attr_pkey,
1510 &class_device_attr_dgid, 1530 &class_device_attr_dgid,
1531 &class_device_attr_orig_dgid,
1511 &class_device_attr_zero_req_lim, 1532 &class_device_attr_zero_req_lim,
1512 &class_device_attr_local_ib_port, 1533 &class_device_attr_local_ib_port,
1513 &class_device_attr_local_ib_device, 1534 &class_device_attr_local_ib_device,
@@ -1516,7 +1537,8 @@ static struct class_device_attribute *srp_host_attrs[] = {
1516 1537
1517static struct scsi_host_template srp_template = { 1538static struct scsi_host_template srp_template = {
1518 .module = THIS_MODULE, 1539 .module = THIS_MODULE,
1519 .name = DRV_NAME, 1540 .name = "InfiniBand SRP initiator",
1541 .proc_name = DRV_NAME,
1520 .info = srp_target_info, 1542 .info = srp_target_info,
1521 .queuecommand = srp_queuecommand, 1543 .queuecommand = srp_queuecommand,
1522 .eh_abort_handler = srp_abort, 1544 .eh_abort_handler = srp_abort,
@@ -1662,6 +1684,7 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target)
1662 target->path.dgid.raw[i] = simple_strtoul(dgid, NULL, 16); 1684 target->path.dgid.raw[i] = simple_strtoul(dgid, NULL, 16);
1663 } 1685 }
1664 kfree(p); 1686 kfree(p);
1687 memcpy(target->orig_dgid, target->path.dgid.raw, 16);
1665 break; 1688 break;
1666 1689
1667 case SRP_OPT_PKEY: 1690 case SRP_OPT_PKEY:
diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
index 2f3319c719a5..1d53c7bc368f 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.h
+++ b/drivers/infiniband/ulp/srp/ib_srp.h
@@ -129,6 +129,7 @@ struct srp_target_port {
129 unsigned int scsi_id; 129 unsigned int scsi_id;
130 130
131 struct ib_sa_path_rec path; 131 struct ib_sa_path_rec path;
132 __be16 orig_dgid[8];
132 struct ib_sa_query *path_query; 133 struct ib_sa_query *path_query;
133 int path_query_id; 134 int path_query_id;
134 135