[openib-general] Re: [openib-commits] r2195 - in gen2/trunk/src/linux-kernel/infiniband: core include

Tom Duffy tduffy at sun.com
Wed Apr 20 13:12:35 PDT 2005


On Wed, 2005-04-20 at 10:35 -0700, sean.hefty at openib.org wrote:
> Modified: gen2/trunk/src/linux-kernel/infiniband/core/verbs.c
> ===================================================================
> --- gen2/trunk/src/linux-kernel/infiniband/core/verbs.c	2005-04-20 16:54:38 UTC (rev 2194)
> +++ gen2/trunk/src/linux-kernel/infiniband/core/verbs.c	2005-04-20 17:35:52 UTC (rev 2195)
> @@ -40,6 +40,7 @@
>  #include <linux/err.h>
>  
>  #include <ib_verbs.h>
> +#include <ib_cache.h>
>  
>  /* Protection domains */
>  
> @@ -87,6 +88,40 @@
>  }
>  EXPORT_SYMBOL(ib_create_ah);
>  
> +struct ib_ah *ib_create_ah_from_wc(struct ib_pd *pd, struct ib_wc *wc,
> +				   struct ib_grh *grh, u8 port_num)
> +{
> +	struct ib_ah_attr ah_attr;
> +	u32 flow_class;
> +	u16 gid_index;
> +	int ret;
> +
> +	memset(&ah_attr, 0, sizeof ah_attr);
> +	ah_attr.dlid = wc->slid;
> +	ah_attr.sl = wc->sl;
> +	ah_attr.src_path_bits = wc->dlid_path_bits;
> +	ah_attr.port_num = port_num;
> +	
> +	if (wc->wc_flags & IB_WC_GRH) {
> +		ah_attr.ah_flags = IB_AH_GRH;
> +		ah_attr.grh.dgid = grh->dgid;
> +
> +		ret = ib_find_cached_gid(pd->device, &grh->sgid, &port_num,
> +					 &gid_index);
> +		if (ret)
> +			return ERR_PTR(ret);
> +
> +		ah_attr.grh.sgid_index = (u8) gid_index;
> +		flow_class = be32_to_cpu(&grh->version_tclass_flow);
> +		ah_attr.grh.flow_label = flow_class & 0xFFFFF;
> +		ah_attr.grh.traffic_class = (flow_class >> 20) & 0xFF;
> +		ah_attr.grh.hop_limit = grh->hop_limit;
> +	}
> +
> +	return ib_create_ah(pd, &ah_attr);
> +}
> +EXPORT_SYMBOL(ib_create_ah_from_wc);
> +
>  int ib_modify_ah(struct ib_ah *ah, struct ib_ah_attr *ah_attr)
>  {
>  	return ah->device->modify_ah ?

Causes build warning on 64bit:

  CC [M]  drivers/infiniband/core/verbs.o
/build1/tduffy/openib-work/linux-2.6.11-openib/drivers/infiniband/core/verbs.c: In function ‘ib_create_ah_from_wc’:
/build1/tduffy/openib-work/linux-2.6.11-openib/drivers/infiniband/core/verbs.c:115: warning: cast from pointer to integer of different size
/build1/tduffy/openib-work/linux-2.6.11-openib/drivers/infiniband/core/verbs.c:115: warning: cast from pointer to integer of different size
/build1/tduffy/openib-work/linux-2.6.11-openib/drivers/infiniband/core/verbs.c:115: warning: cast from pointer to integer of different size

-tduffy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20050420/4b83769d/attachment.sig>


More information about the general mailing list