[ofa-general] Re: [PATCH] ibsim: Drop vendor MADs and vendor specific SM MADs

Sasha Khapyorsky sashak at voltaire.com
Mon Jul 27 08:20:36 PDT 2009


On 13:38 Mon 27 Jul     , sebastien dugue wrote:
> 
>   This is useful for testing applications that send those kind of MADS.

How this is useful in such test? I see that this just drops every sort
of such MADs without letting chance to client to process it. No?

Sasha


> 
> Signed-off-by: Sebastien Dugue <sebastien.dugue at bull.net>
> ---
>  ibsim/sim_mad.c |   19 +++++++++++++++++++
>  1 files changed, 19 insertions(+), 0 deletions(-)
> 
> diff --git a/ibsim/sim_mad.c b/ibsim/sim_mad.c
> index 61d4866..b79a5e7 100644
> --- a/ibsim/sim_mad.c
> +++ b/ibsim/sim_mad.c
> @@ -1170,6 +1170,25 @@ int process_packet(Client * cl, void *p, int size, Client ** dcl)
>  	if ((response = decode_sim_MAD(cl, r, &rpc, &path, data)) < 0)
>  		return -1;
>  
> +	/* Drop vendor MADs */
> +	if (((rpc.mgtclass >= IB_VENDOR_RANGE1_START_CLASS) &&
> +	     (rpc.mgtclass <= IB_VENDOR_RANGE1_END_CLASS)) ||
> +	    ((rpc.mgtclass >= IB_VENDOR_RANGE2_START_CLASS) &&
> +	     (rpc.mgtclass <= IB_VENDOR_RANGE2_END_CLASS))) {
> +		IBWARN("ignoring vendor MAD: class 0x%x, attr 0x%x",
> +		       rpc.mgtclass, rpc.attr.id);
> +		goto _dropped;
> +	}
> +
> +	/* Drop vendor specific SM MADs */
> +	if (((rpc.mgtclass == IB_SMI_CLASS) ||
> +	     (rpc.mgtclass == IB_SMI_DIRECT_CLASS)) &&
> +	    (rpc.attr.id >= 0xff00)) {
> +		IBWARN("ignoring vendor specific SM MAD: attr 0x%x",
> +		       rpc.attr.id);
> +		goto _dropped;
> +	}
> +
>  	if (rpc.method == 0x7) {
>  		IBWARN("lid %u got trap repress - dropping", ntohs(r->dlid));
>  		*dcl = 0;
> -- 
> 1.6.3.1
> 



More information about the general mailing list