]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
IB/core - Don't modify outgoing DR SMP if first part is LID routed
authorRalph Campbell <ralph.campbell@qlogic.com>
Wed, 17 Oct 2007 20:07:17 +0000 (13:07 -0700)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 21:38:10 +0000 (14:38 -0700)
The code in handle_outgoing_dr_smp() checks to see if the directed
route SMP has an initial LID routed part and correctly does not
modify the hop pointer but it then proceeds to process the packet
as if there was no initial LID routed part.  Instead, if there
is an initial LID routed part, the packet should just be sent on
to the destination and not processed further since it can't be
destined for the local SM/SMA.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
drivers/infiniband/core/mad.c

index 74c30f4c557e015df74ec153417e09d626f8da2e..4b759308ff3df9efa13f14c7d1e036da0d7dea59 100644 (file)
@@ -749,9 +749,10 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
         * 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) ==
+       if ((ib_get_smp_direction(smp) ? smp->dr_dlid : smp->dr_slid) !=
+            IB_LID_PERMISSIVE)
+               goto out;
+       if (smi_handle_dr_smp_send(smp, device->node_type, port_num) ==
             IB_SMI_DISCARD) {
                ret = -EINVAL;
                dev_err(&device->dev, "Invalid directed route\n");