[ofa-general] Re: [PATCH] allow explicit HCA selection by functions from libibmad

Sasha Khapyorsky sashak at voltaire.com
Wed Jun 25 14:39:54 PDT 2008


On 22:16 Tue 24 Jun     , Max Matveev wrote:
> 
> Add extra entry points to allow explicit selection of
> HCA ports used to send MAD rpcs.
> 
> Signed-off-by: Max Matveev <makc at sgi.com>

Good work! Thanks. Applied.

[snip...]

> diff --git a/libibmad/src/smp.c b/libibmad/src/smp.c
> index cc4c776..e3795e4 100644
> --- a/libibmad/src/smp.c
> +++ b/libibmad/src/smp.c
> @@ -49,7 +49,7 @@
>  #define DEBUG 	if (ibdebug)	IBWARN
>  
>  uint8_t *
> -smp_set(void *data, ib_portid_t *portid, unsigned attrid, unsigned mod, unsigned timeout)
> +smp_set_via(void *data, ib_portid_t *portid, unsigned attrid, unsigned mod, unsigned timeout, const void *srcport)
>  {
>  	ib_rpc_t rpc = {0};
>  
> @@ -71,12 +71,22 @@ smp_set(void *data, ib_portid_t *portid, unsigned attrid, unsigned mod, unsigned
>  	portid->sl = 0;
>  	portid->qp = 0;
>  
> -	return madrpc(&rpc, portid, data, data);
> +	if (srcport) {
> +		return mad_rpc(srcport, &rpc, portid, data, data);
> +	} else {
> +		return madrpc(&rpc, portid, data, data);
> +	}
> +}
> +
> +uint8_t *
> +smp_set(void *data, ib_portid_t *portid, unsigned attrid, unsigned mod, unsigned timeout)
> +{
> +	return smp_set_via(data, portid, attrid, mod, timeout, NULL);
>  }
>  
>  uint8_t *
> -smp_query(void *rcvbuf, ib_portid_t *portid, unsigned attrid, unsigned mod,
> -	  unsigned timeout)
> +smp_query_via(void *rcvbuf, ib_portid_t *portid, unsigned attrid, unsigned mod,
> +	      unsigned timeout, const void *srcport)
>  {
>  	ib_rpc_t rpc = {0};

Somehow you removed smp_query() function. I fixed this in merge time.

Sasha

>  
> @@ -98,5 +108,9 @@ smp_query(void *rcvbuf, ib_portid_t *portid, unsigned attrid, unsigned mod,
>  	portid->sl = 0;
>  	portid->qp = 0;
>  
> -	return madrpc(&rpc, portid, 0, rcvbuf);
> +	if (srcport) {
> +		return mad_rpc(srcport, &rpc, portid, 0, rcvbuf);
> +	} else {
> +		return madrpc(&rpc, portid, 0, rcvbuf);
> +	}
>  }




More information about the general mailing list