Re: ibacm: struct ib_sa_mad.status interpretation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/31/2018 7:37 AM, Håkon Bugge wrote:
> Hi,
> 
> Somewhat confused. We have in ibacm/include/acm_mad.h:
> 
> struct ib_sa_mad {
> 	[]
>         __be16 status;
> 	[]
> };
> 
> In ibacm/prov/acmp/src/acmp.c, acmp_process_join_resp():
> 
>         if (mad->status) {
>                 acm_log(0, "ERROR - join response status 0x%x\n", mad->status);
>                 goto out;
>         }
> 
> So, I thought, simple enough, the above is an endian conversion bug, and the code should read:
> 
>         if (be16toh(mad->status)) {
>                 acm_log(0, "ERROR - join response status 0x%x\n", be16toh(mad->status));
>                 goto out;
>         }
> 
> On a real system, I saw:
> 
> acmp_process_join_resp: ERROR - join response status 0x2
> 
> So, since the conversion is missing, the status value is actually 0x200.
> 
> Looking at IBTA, MAD Common Status Field Bit Values, status 0x200 is (bit #0) not busy, (bit #1) no redirection, (bits #2-4) no invalid fields, and a Class Specific status of 2, which from Table SA MAD Class-Specific Status Encodings is ERR_REQ_INVALID.
> 
> Is this the correct interpretation? 

Yes.

> If so, should the status print divide the Common and Class-Specific in two? Or are we only interested in the Class-Specific error here?

I think it should handle both common and SA class specific errors here.

-- Hal

> 
> Thxs, Håkon
> 
> 
> 



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux