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

Dotan Barak dotanb at dev.mellanox.co.il
Sun Feb 25 06:03:28 PST 2007


Hi and sorry about the delay in the reply.

Roland Dreier wrote:
>  > In issue number 296 that i opened several months ago in the Bugzilla, i
>  > reported about two missing attributes: the first one is the static_rate,
>  > and the second one is the src_path_bits which is not being filled right.
>
> The patch I posted fixes the static rate, right?
>
> You'll need to explain what you mean about src_path_bits, because at
> first glance the code looks OK to me.
>   
Here is the code that handles the src_path_bits:

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

I think that no one noticed any failure in this code (so far) because 
not many users use LMC > 0
in their subnet, and most of the code that will call this function will 
use it with the base port LID.



thanks
Dotan




More information about the general mailing list