[openib-general] [RFC] [PATCHv2] mad: Add RMPP support foradditional management classes which support it

Sean Hefty sean.hefty at intel.com
Fri Mar 17 10:00:39 PST 2006


>-static int data_offset(u8 mgmt_class)
>+int ib_get_rmpp_data_offset(u8 mgmt_class)
> {
> 	if (mgmt_class == IB_MGMT_CLASS_SUBN_ADM)
> 		return IB_MGMT_SA_HDR;
>+	else if ((mgmt_class == IB_MGMT_CLASS_DEVICE_MGMT) ||
>+		 (mgmt_class == IB_MGMT_CLASS_DEVICE_ADM) ||
>+		 (mgmt_class == IB_MGMT_CLASS_BIS))
>+		return IB_MGMT_DEVICE_HDR;
> 	else if ((mgmt_class >= IB_MGMT_CLASS_VENDOR_RANGE2_START) &&
> 		 (mgmt_class <= IB_MGMT_CLASS_VENDOR_RANGE2_END))
> 		return IB_MGMT_VENDOR_HDR;
> 	else
> 		return IB_MGMT_RMPP_HDR;
> }
>+EXPORT_SYMBOL(ib_get_rmpp_data_offset);

Is the base RMPP header (return value of IB_MGMT_RMPP_HDR) ever actually used by
any class?  Maybe we should rename this routine to ib_get_mad_data_offset(), and
let it work on any type of MAD, versus RMPP only.  Then change IB_MGMT_RMPP_HDR
to IB_MGMT_MAD_HDR.

>+	hdr_len = ib_get_rmpp_data_offset(rmpp_mad->mad_hdr.mgmt_class);
>+	if (hdr_len == IB_MGMT_RMPP_HDR) {

This looks like a check to see if the mgmt_class uses RMPP or not.  If we want
to keep ib_get_rmpp_data_offset as shown above, maybe we can check whether the
mad_agent uses RMPP, and only call ib_get_rmpp_data_offset if it does.

- Sean



More information about the general mailing list