[openib-general] [PATCH 2/3] SA: add call to initialize ib_ah_attr from a path record
Sean Hefty
mshefty at ichips.intel.com
Thu May 18 16:24:16 PDT 2006
Sean Hefty wrote:
> +int ib_init_ah_from_path(struct ib_device *device, u8 port_num,
> + struct ib_sa_path_rec *rec, struct ib_ah_attr *ah_attr)
> +{
> + int ret;
> + u16 gid_index;
> +
> + memset(ah_attr, 0, sizeof *ah_attr);
> + ah_attr->dlid = be16_to_cpu(rec->dlid);
> + ah_attr->sl = rec->sl;
> + ah_attr->src_path_bits = be16_to_cpu(rec->slid) & 0x7F;
> + ah_attr->port_num = port_num;
> +
> + if (rec->sgid.global.subnet_prefix != rec->dgid.global.subnet_prefix) {
> + ah_attr->ah_flags = IB_AH_GRH;
I should note that I compared the subnet prefixes to determine if the GRH should
be used. Reading back over the 'GRH flag in ib_ah_attr' thread, it looks like
there's consensus that hop_limit > 1 is the check that we want. I will update
the code accordingly.
- Sean
More information about the general
mailing list