[openib-general] Different low level drivers returns different return values incase of an error

Dotan Barak dotanb at dev.mellanox.co.il
Mon Dec 18 03:47:09 PST 2006


Hi Hoang-Nam.

Hoang-Nam Nguyen wrote:
> Hi Dotan!
>   
> Good point. I can speak for ehca only. We prefer to reuse existing
> errno values and not to define new ones as it's also a question of
> how much information we want to tell the consumer in case of error
> and what it can handle for. To me the defined errno values give
> enough information to caller. Anyway we should use same error
> codes for both kernel and user space verbs.
> Regards
> Nam
>   
I think that there should be 2 modes to the drivers:
mode 1 (release mode): return "standard" errno values
mode 2 (debug mode) : return "IB oriented" values
This can be done in compilation time, for example:
#ifdef IB_DEBUG
#define IB_EINVAL_MTU 1000
#define IB_EINVAL_LID    1001
#else
#define IB_EINVAL_MTU EINVAL
#define IB_EINVAL_LID    EINVAL
#endif
 
This way, we will be able to help developers to find out what is the 
problem in case of an error when using debug driver.

Anyway, we need to decide on a common behavior of all low level drivers.

thanks
Dotan




More information about the general mailing list