]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ib_mad: incoming sminfo SMPs gets discarded if no process_mad function is registered
authorDag Moxnes <dag.moxnes@oracle.com>
Tue, 21 Apr 2015 10:20:02 +0000 (12:20 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Wed, 8 Jul 2015 01:10:55 +0000 (18:10 -0700)
The process_mad function is an optional IB driver entry point
allows a driver to intercept or modify MAD traffic.

This fix allows MAD traffic to flow down to the device also
when MAD traffic is completely handled by the device and
no process_mad function is provided.

Orabug: 20930262

Signed-off-by: Knut Omang <knut.omang@oracle.com>
Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
drivers/infiniband/core/mad.c
drivers/infiniband/core/smi.h

index af878a71ee3fe80dd6864620282ddf2b38e87969..11354a2a487d60b7b1281a3946158aa6c2af56d5 100644 (file)
@@ -762,6 +762,9 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
                goto out;
        }
 
+       if (!device->process_mad)
+               goto out;
+
        /* Check to post send on QP or process locally */
        if (smi_check_local_smp(smp, device) == IB_SMI_DISCARD &&
            smi_check_local_returning_smp(smp, device) == IB_SMI_DISCARD)
index aff96bac49b4c9e126a1e4b6fd309bc4b3b256aa..52adf7960402995de6605df7be98fa709db9dbb2 100644 (file)
@@ -67,8 +67,7 @@ static inline enum smi_action smi_check_local_smp(struct ib_smp *smp,
 {
        /* C14-9:3 -- We're at the end of the DR segment of path */
        /* C14-9:4 -- Hop Pointer = Hop Count + 1 -> give to SMA/SM */
-       return ((device->process_mad &&
-               !ib_get_smp_direction(smp) &&
+       return ((!ib_get_smp_direction(smp) &&
                (smp->hop_ptr == smp->hop_cnt + 1)) ?
                IB_SMI_HANDLE : IB_SMI_DISCARD);
 }
@@ -82,8 +81,7 @@ static inline enum smi_action smi_check_local_returning_smp(struct ib_smp *smp,
 {
        /* C14-13:3 -- We're at the end of the DR segment of path */
        /* C14-13:4 -- Hop Pointer == 0 -> give to SM */
-       return ((device->process_mad &&
-               ib_get_smp_direction(smp) &&
+       return ((ib_get_smp_direction(smp) &&
                !smp->hop_ptr) ? IB_SMI_HANDLE : IB_SMI_DISCARD);
 }