Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217743
b: refs/heads/master
c: fed1db3
h: refs/heads/master
i:
  217741: 84d1ff8
  217739: 73fb4b4
  217735: be2191c
  217727: 22b7726
v: v3
  • Loading branch information
Christoph Lameter authored and Roland Dreier committed Sep 28, 2010
1 parent 8d47f01 commit f778c1f
Show file tree
Hide file tree
Showing 35 changed files with 230 additions and 1,696 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: 8ad330a002ffbc422f32a77398666832f0df8a3d
refs/heads/master: fed1db33fe85573487a4732d628ac5afdb5dc776
29 changes: 12 additions & 17 deletions trunk/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[1]->device == device &&
entry->agent[1]->port_num == port_num)
if (entry->agent[0]->device == device &&
entry->agent[0]->port_num == port_num)
return entry;
}
return NULL;
Expand Down Expand Up @@ -155,16 +155,14 @@ int ib_agent_port_open(struct ib_device *device, int port_num)
goto error1;
}

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 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 @@ -184,8 +182,7 @@ int ib_agent_port_open(struct ib_device *device, int port_num)
return 0;

error3:
if (port_priv->agent[0])
ib_unregister_mad_agent(port_priv->agent[0]);
ib_unregister_mad_agent(port_priv->agent[0]);
error2:
kfree(port_priv);
error1:
Expand All @@ -208,9 +205,7 @@ 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]);
if (port_priv->agent[0])
ib_unregister_mad_agent(port_priv->agent[0]);

ib_unregister_mad_agent(port_priv->agent[0]);
kfree(port_priv);
return 0;
}
Loading

0 comments on commit f778c1f

Please sign in to comment.