Commit 8cf3f04f authored by Ralph Campbell's avatar Ralph Campbell Committed by Roland Dreier

IB/mad: Handle DR SMPs with a LID routed part

Fix handling of directed route SMPs with a beginning or ending LID
routed part.
Signed-off-by: default avatarRalph Campbell <ralphc@pathscale.com>
Signed-off-by: default avatarHal Rosenstock <halr@voltaire.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 3c3b809e
...@@ -665,7 +665,15 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv, ...@@ -665,7 +665,15 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
struct ib_wc mad_wc; struct ib_wc mad_wc;
struct ib_send_wr *send_wr = &mad_send_wr->send_wr; struct ib_send_wr *send_wr = &mad_send_wr->send_wr;
if (!smi_handle_dr_smp_send(smp, device->node_type, port_num)) { /*
* Directed route handling starts if the initial LID routed part of
* a request or the ending LID routed part of a response is empty.
* If we are at the start of the LID routed part, don't update the
* hop_ptr or hop_cnt. See section 14.2.2, Vol 1 IB spec.
*/
if ((ib_get_smp_direction(smp) ? smp->dr_dlid : smp->dr_slid) ==
IB_LID_PERMISSIVE &&
!smi_handle_dr_smp_send(smp, device->node_type, port_num)) {
ret = -EINVAL; ret = -EINVAL;
printk(KERN_ERR PFX "Invalid directed route\n"); printk(KERN_ERR PFX "Invalid directed route\n");
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment