[openib-general] [PATCH] IB/core: Set static rate in ib_init_ah_from_path()

Sean Hefty mshefty at ichips.intel.com
Mon Feb 26 10:15:41 PST 2007


> 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;

I'm not sure about the '& 0x7f', but...

> I have a feeling that this function doesn't handle the src_path_bits as 
> it should because
> it doesn't care what is the LMC value of the slid (i think that if the 
> LMC is < 8) wrong bits
> may be set in the src_path_bits.

Wouldn't the function simply include the port's base LID in the source path 
bits?  I would think that the LMC would mask out those bits in the address 
vector before ANDing the base LID back in to form the SLID.  But even if the 
bits weren't masked out, ANDing the source path bits with the base LID should 
produce the same result.

If I'm not seeing this correctly, can you describe the problem more?

- Sean




More information about the general mailing list