Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39204
b: refs/heads/master
c: 01cb9bc
h: refs/heads/master
v: v3
  • Loading branch information
Ishai Rabinovitz authored and Roland Dreier committed Oct 10, 2006
1 parent 1255a76 commit 494ceb4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9b0af401aae336975e620fccdd294bb763424f3f
refs/heads/master: 01cb9bcbd34b7ba768a7f05375faf43becdb8a60
26 changes: 17 additions & 9 deletions trunk/drivers/infiniband/ulp/srp/ib_srp.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,29 +343,32 @@ static int srp_send_req(struct srp_target_port *target)
*/
if (target->io_class == SRP_REV10_IB_IO_CLASS) {
memcpy(req->priv.initiator_port_id,
target->srp_host->initiator_port_id + 8, 8);
&target->path.sgid.global.interface_id, 8);
memcpy(req->priv.initiator_port_id + 8,
target->srp_host->initiator_port_id, 8);
&target->initiator_ext, 8);
memcpy(req->priv.target_port_id, &target->ioc_guid, 8);
memcpy(req->priv.target_port_id + 8, &target->id_ext, 8);
} else {
memcpy(req->priv.initiator_port_id,
target->srp_host->initiator_port_id, 16);
&target->initiator_ext, 8);
memcpy(req->priv.initiator_port_id + 8,
&target->path.sgid.global.interface_id, 8);
memcpy(req->priv.target_port_id, &target->id_ext, 8);
memcpy(req->priv.target_port_id + 8, &target->ioc_guid, 8);
}

/*
* Topspin/Cisco SRP targets will reject our login unless we
* zero out the first 8 bytes of our initiator port ID. The
* second 8 bytes must be our local node GUID, but we always
* use that anyway.
* zero out the first 8 bytes of our initiator port ID and set
* the second 8 bytes to the local node GUID.
*/
if (topspin_workarounds && !memcmp(&target->ioc_guid, topspin_oui, 3)) {
printk(KERN_DEBUG PFX "Topspin/Cisco initiator port ID workaround "
"activated for target GUID %016llx\n",
(unsigned long long) be64_to_cpu(target->ioc_guid));
memset(req->priv.initiator_port_id, 0, 8);
memcpy(req->priv.initiator_port_id + 8,
&target->srp_host->dev->dev->node_guid, 8);
}

status = ib_send_cm_req(target->cm_id, &req->param);
Expand Down Expand Up @@ -1553,6 +1556,7 @@ enum {
SRP_OPT_MAX_SECT = 1 << 5,
SRP_OPT_MAX_CMD_PER_LUN = 1 << 6,
SRP_OPT_IO_CLASS = 1 << 7,
SRP_OPT_INITIATOR_EXT = 1 << 8,
SRP_OPT_ALL = (SRP_OPT_ID_EXT |
SRP_OPT_IOC_GUID |
SRP_OPT_DGID |
Expand All @@ -1569,6 +1573,7 @@ static match_table_t srp_opt_tokens = {
{ SRP_OPT_MAX_SECT, "max_sect=%d" },
{ SRP_OPT_MAX_CMD_PER_LUN, "max_cmd_per_lun=%d" },
{ SRP_OPT_IO_CLASS, "io_class=%x" },
{ SRP_OPT_INITIATOR_EXT, "initiator_ext=%s" },
{ SRP_OPT_ERR, NULL }
};

Expand Down Expand Up @@ -1668,6 +1673,12 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target)
target->io_class = token;
break;

case SRP_OPT_INITIATOR_EXT:
p = match_strdup(args);
target->initiator_ext = cpu_to_be64(simple_strtoull(p, NULL, 16));
kfree(p);
break;

default:
printk(KERN_WARNING PFX "unknown parameter or missing value "
"'%s' in target creation request\n", p);
Expand Down Expand Up @@ -1814,9 +1825,6 @@ static struct srp_host *srp_add_port(struct srp_device *device, u8 port)
host->dev = device;
host->port = port;

host->initiator_port_id[7] = port;
memcpy(host->initiator_port_id + 8, &device->dev->node_guid, 8);

host->class_dev.class = &srp_class;
host->class_dev.dev = device->dev->dma_device;
snprintf(host->class_dev.class_id, BUS_ID_SIZE, "srp-%s-%d",
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/ulp/srp/ib_srp.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ struct srp_device {
};

struct srp_host {
u8 initiator_port_id[16];
struct srp_device *dev;
u8 port;
struct class_device class_dev;
Expand Down Expand Up @@ -122,6 +121,7 @@ struct srp_target_port {
__be64 id_ext;
__be64 ioc_guid;
__be64 service_id;
__be64 initiator_ext;
u16 io_class;
struct srp_host *srp_host;
struct Scsi_Host *scsi_host;
Expand Down

0 comments on commit 494ceb4

Please sign in to comment.