[openib-general] [PATCH] vendor: identify rmpp mads

Ofer Gigi oferg at mellanox.co.il
Thu Mar 16 09:26:19 PST 2006


Hi Hal,

Same thing should be applied in the function below in
/drivers/infiniband/core/mad.c

Thanks!
Ofer 

static inline int is_rmpp_data(struct ib_mad *mad)
{
        /* check if has rmpp header */
        if (mad->mad_hdr.mgmt_class != IB_MGMT_CLASS_SUBN_ADM && 
            mad->mad_hdr.mgmt_class != IB_MCLASS_DEV_MGMT &&
            (mad->mad_hdr.mgmt_class < IB_MGMT_CLASS_VENDOR_RANGE2_START
||
             mad->mad_hdr.mgmt_class > IB_MGMT_CLASS_VENDOR_RANGE2_END))
                return 0;

        return ((ib_get_rmpp_flags(&((struct ib_rmpp_mad
*)mad)->rmpp_hdr) &
                 IB_MGMT_RMPP_FLAG_ACTIVE) &&
                ((struct ib_rmpp_mad *)mad)->rmpp_hdr.rmpp_type ==
                IB_MGMT_RMPP_TYPE_DATA);
}

-----Original Message-----
From: openib-general-bounces at openib.org
[mailto:openib-general-bounces at openib.org] On Behalf Of Ofer Gigi
Sent: Thursday, March 16, 2006 7:14 PM
To: OPENIB
Subject: [openib-general] [PATCH] vendor: identify rmpp mads 

Hi Hal,

RMPP mad can only sent in 4 kinds of mad:
1. IB_MCLASS_SUBN_ADM 
2. IB_MCLASS_DEV_MGMT 
3. BIS 
4. DevAdm

If the packet is not 1 or 2 - the mad is not checked and returned in
advance as not a 
rmpp packet.
Since 3,4 are not management classes (see 13.4.4 page 720 in the spec) I
don't know 
whether they are defined as constants or not - so I didn't handle them. 

Thanks

Ofer G.

Signed-off-by:  Ofer Gigi <oferg at mellanox.co.il>

Index: osm_vendor_mlx_svc.h
===================================================================
--- osm_vendor_mlx_svc.h        (revision 5836)
+++ osm_vendor_mlx_svc.h        (working copy)
@@ -116,6 +116,9 @@ osmv_mad_is_rmpp(IN const ib_mad_t *p_ma
     CL_ASSERT(NULL != p_mad);
 
     rmpp_flags = ((ib_rmpp_mad_t*)p_mad)->rmpp_flags;
+    /* HACK - JUST SA and DevMgt for now - need to add BIS and DevAdm*/
+    if ( (p_mad->mgmt_class != CL_NTOH16(IB_MCLASS_SUBN_ADM)) &&
+                (p_mad->mgmt_class != CL_NTOH16(IB_MCLASS_DEV_MGMT)) )
return(0);
     return (0 != (rmpp_flags & IB_RMPP_FLAG_ACTIVE));
 }


_______________________________________________
openib-general mailing list
openib-general at openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit
http://openib.org/mailman/listinfo/openib-general



More information about the general mailing list