[openib-general] [PATCH] libibmad - Fix bit field access of RMPP Header

Hal Rosenstock halr at voltaire.com
Wed Apr 26 03:39:12 PDT 2006


On Tue, 2006-04-25 at 15:59, Jan Daley wrote:
> The wrong macro is being used to access the RMPP header in libibmad.
> Discovered 
> this issue by using mad_set/get_field on an RMPP header.  With this
> change,
> reading and writing the RMPP header fields is done correctly.  

Thanks.

> Signed-off-by:  Jan Daley  <jdaley at systemfabricworks.com>

Patch was line wrapped but I modified the patch manually and applied it
to both trunk and 1.0 branch.

-- Hal

> Index: fields.c
> ===================================================================
> --- fields.c	(revision 6631)
> +++ fields.c	(working copy)
> @@ -241,11 +241,11 @@
>  	/*
>  	 * SA RMPP
>  	 */
> -	[IB_SA_RMPP_VERS_F]		{BITSOFFS(24*8+24, 8),
> "RmppVers", mad_dump_uint},
> -	[IB_SA_RMPP_TYPE_F]		{BITSOFFS(24*8+16, 8),
> "RmppType", mad_dump_uint},
> -	[IB_SA_RMPP_RESP_F]		{BITSOFFS(24*8+11, 5),
> "RmppResp", mad_dump_uint},
> -	[IB_SA_RMPP_FLAGS_F]		{BITSOFFS(24*8+8, 3),
> "RmppFlags", mad_dump_hex},
> -	[IB_SA_RMPP_STATUS_F]		{BITSOFFS(24*8+0, 8),
> "RmppStatus", mad_dump_hex},
> +	[IB_SA_RMPP_VERS_F]		{BE_OFFS(24*8+24, 8),
> "RmppVers", mad_dump_uint},
> +	[IB_SA_RMPP_TYPE_F]		{BE_OFFS(24*8+16, 8),
> "RmppType", mad_dump_uint},
> +	[IB_SA_RMPP_RESP_F]		{BE_OFFS(24*8+11, 5),
> "RmppResp", mad_dump_uint},
> +	[IB_SA_RMPP_FLAGS_F]		{BE_OFFS(24*8+8, 3),
> "RmppFlags", mad_dump_hex},
> +	[IB_SA_RMPP_STATUS_F]		{BE_OFFS(24*8+0, 8),
> "RmppStatus", mad_dump_hex},
>  
>  	/* data1 */
>  	[IB_SA_RMPP_D1_F]		{28*8, 32, "RmppData1",
> mad_dump_hex},
> 
> 
> Jan Daley
> System Fabric Works
> (512) 343-6101 x 14
> 
> 
> 
> _______________________________________________
> 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