[openib-general] [PATCH] librdmacm: fix bug causing failure to work with partial membership pkey

Hal Rosenstock halr at voltaire.com
Tue Feb 20 07:06:51 PST 2007


On Mon, 2007-02-19 at 01:40, Or Gerlitz wrote:
> Hi Sean,
> 
> this fixes a bug which did not allow to run librdmacm apps over a node
> which is partial member of a partition. The patch takes the approach of the
> kernel ib_find_cached_pkey implementation.
> 
> If you approve this, i suggest pushing it also into OFED 1.2 as a bug fix.
> 
> Or.
> 
> ----------------------------------------------------------------------
> The pkey extracted by the RDMA CM from the IPoIB device hardware address always
> has the full membership bit set. However, when looking in the pkey table the
> search must mask out the full membership bit.
> 
> Signed-off-by: Or Gerlitz <ogerlitz at voltaire.com>
> Signed-off-by: Olga Shern <olgas at voltaire.com>
> 
> diff --git a/src/cma.c b/src/cma.c
> index c5f8cd9..9c24c6a 100644
> --- a/src/cma.c
> +++ b/src/cma.c
> @@ -661,7 +661,7 @@ static int ucma_find_pkey(struct cma_dev
> 
>  	for (i = 0, ret = 0; !ret; i++) {
>  		ret = ibv_query_pkey(cma_dev->verbs, port_num, i, &chk_pkey);
> -		if (!ret && pkey == chk_pkey) {
> +		if ((!ret && pkey  == chk_pkey) || (!ret && htons(ntohs(pkey) & 0x7fff)  == chk_pkey)) {

Is this true for both RC and UD QPs ? I thought that at least the UD QPs
were being used for multicast in which case  wouldn't full member be
required for this ?

-- Hal

>  			*pkey_index = (uint16_t) i;
>  			return 0;
>  		}
> 
> _______________________________________________
> 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