[ofa-general] [PATCH] opensm: set SA attribute offset to 0 when no records are returned

Yevgeny Kliteynik kliteyn at mellanox.co.il
Sun Mar 2 14:21:36 PST 2008


Sasha Khapyorsky wrote:
> IBA 1.2.1 clarifies (t.187, p.897) that SA Attribute offset shell be set
> to zero if zero attributes are returned. Fix this.
>   

Nice catch, thanks.
BTW, are you aware of any other IBA 1.2.1 - related issues that need to 
be fixed?
I mean, is OpenSM fully IBA 1.2.1 compliant?

-- Yevgeny

> Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
> ---
>  opensm/opensm/osm_sa.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/opensm/opensm/osm_sa.c b/opensm/opensm/osm_sa.c
> index d85463e..46c5bf7 100644
> --- a/opensm/opensm/osm_sa.c
> +++ b/opensm/opensm/osm_sa.c
> @@ -372,6 +372,8 @@ osm_sa_send_error(IN osm_sa_t * sa,
>  
>  	if (p_resp_sa_mad->method == IB_MAD_METHOD_SET)
>  		p_resp_sa_mad->method = IB_MAD_METHOD_GET;
> +	else if (p_resp_sa_mad->method == IB_MAD_METHOD_GETTABLE)
> +		p_resp_sa_mad->attr_offset = 0;
>  
>  	p_resp_sa_mad->method |= IB_MAD_METHOD_RESP_MASK;
>  
> @@ -473,7 +475,7 @@ void osm_sa_respond(osm_sa_t *sa, osm_madw_t *madw, size_t attr_size,
>  	resp_sa_mad->sm_key = 0;
>  
>  	/* Fill in the offset (paylen will be done by the rmpp SAR) */
> -	resp_sa_mad->attr_offset = ib_get_attr_offset(attr_size);
> +	resp_sa_mad->attr_offset = num_rec ? ib_get_attr_offset(attr_size) : 0;
>  
>  	p = ib_sa_mad_get_payload_ptr(resp_sa_mad);
>  
>   



More information about the general mailing list