Skip to content

Commit

Permalink
Merge branches 'amso1100', 'cma', 'cxgb3', 'cxgb4', 'ehca', 'iboe', '…
Browse files Browse the repository at this point in the history
…ipoib', 'misc', 'mlx4', 'nes', 'qib' and 'srp' into for-next
  • Loading branch information
Roland Dreier committed Oct 26, 2010
12 parents fc4ec9b + 97cb7e4 + ca7cf94 + aa1ad26 + 625fbd3 + 8ad330a + c3aa9b1 + 7454159 + d0d68b8 + 52106bd + 2ca78d2 + 19081f3 commit 116e953
Show file tree
Hide file tree
Showing 74 changed files with 2,671 additions and 726 deletions.
12 changes: 11 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2951,7 +2951,7 @@ M: Roland Dreier <rolandd@cisco.com>
M: Sean Hefty <sean.hefty@intel.com>
M: Hal Rosenstock <hal.rosenstock@gmail.com>
L: linux-rdma@vger.kernel.org
W: http://www.openib.org/
W: http://www.openfabrics.org/
Q: http://patchwork.kernel.org/project/linux-rdma/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git
S: Supported
Expand Down Expand Up @@ -5035,6 +5035,16 @@ W: http://www.kernel.dk
S: Maintained
F: drivers/scsi/sr*

SCSI RDMA PROTOCOL (SRP) INITIATOR
M: David Dillow <dillowda@ornl.gov>
L: linux-rdma@vger.kernel.org
S: Supported
W: http://www.openfabrics.org
Q: http://patchwork.kernel.org/project/linux-rdma/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/dad/srp-initiator.git
F: drivers/infiniband/ulp/srp/
F: include/scsi/srp.h

SCSI SG DRIVER
M: Doug Gilbert <dgilbert@interlog.com>
L: linux-scsi@vger.kernel.org
Expand Down
29 changes: 17 additions & 12 deletions drivers/infiniband/core/agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ __ib_get_agent_port(struct ib_device *device, int port_num)
struct ib_agent_port_private *entry;

list_for_each_entry(entry, &ib_agent_port_list, port_list) {
if (entry->agent[0]->device == device &&
entry->agent[0]->port_num == port_num)
if (entry->agent[1]->device == device &&
entry->agent[1]->port_num == port_num)
return entry;
}
return NULL;
Expand Down Expand Up @@ -155,14 +155,16 @@ int ib_agent_port_open(struct ib_device *device, int port_num)
goto error1;
}

/* Obtain send only MAD agent for SMI QP */
port_priv->agent[0] = ib_register_mad_agent(device, port_num,
IB_QPT_SMI, NULL, 0,
&agent_send_handler,
NULL, NULL);
if (IS_ERR(port_priv->agent[0])) {
ret = PTR_ERR(port_priv->agent[0]);
goto error2;
if (rdma_port_get_link_layer(device, port_num) == IB_LINK_LAYER_INFINIBAND) {
/* Obtain send only MAD agent for SMI QP */
port_priv->agent[0] = ib_register_mad_agent(device, port_num,
IB_QPT_SMI, NULL, 0,
&agent_send_handler,
NULL, NULL);
if (IS_ERR(port_priv->agent[0])) {
ret = PTR_ERR(port_priv->agent[0]);
goto error2;
}
}

/* Obtain send only MAD agent for GSI QP */
Expand All @@ -182,7 +184,8 @@ int ib_agent_port_open(struct ib_device *device, int port_num)
return 0;

error3:
ib_unregister_mad_agent(port_priv->agent[0]);
if (port_priv->agent[0])
ib_unregister_mad_agent(port_priv->agent[0]);
error2:
kfree(port_priv);
error1:
Expand All @@ -205,7 +208,9 @@ int ib_agent_port_close(struct ib_device *device, int port_num)
spin_unlock_irqrestore(&ib_agent_port_list_lock, flags);

ib_unregister_mad_agent(port_priv->agent[1]);
ib_unregister_mad_agent(port_priv->agent[0]);
if (port_priv->agent[0])
ib_unregister_mad_agent(port_priv->agent[0]);

kfree(port_priv);
return 0;
}
Loading

0 comments on commit 116e953

Please sign in to comment.