[ofa-general] Re: [PATCH 2/10] infiniband-diags: Convert ibaddr to "new" ibmad interface

Ira Weiny weiny2 at llnl.gov
Fri Mar 6 10:04:05 PST 2009


On Mon, 2 Mar 2009 16:06:59 -0800
Ira Weiny <weiny2 at llnl.gov> wrote:

> On Sun, 1 Mar 2009 10:08:04 +0200
> Sasha Khapyorsky <sashak at voltaire.com> wrote:
> 
> > On 19:05 Thu 19 Feb     , Ira Weiny wrote:
> 
> [snip]
> 
> > >  
> > > -	madrpc_init(ibd_ca, ibd_ca_port, mgmt_classes, 3);
> > > +	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
> > > +	if (!srcport)
> > > +		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
> > 
> > Here and in almost all other infiniband-diags patches:
> > 
> > madrpc_init() in case of failures calls IBPANIC() which prints error
> > message and calls exit(). Unlike this mad_rpc_open_port() sets errno and
> > returns NULL, IBERROR() just prints error message - the program will
> > continue execution...
> 
> Good catch I will update with a proper exit call.
>

Actually I think I was right the first time.  IBERROR is a macro which calls
iberror.  iberror calls exit(-1) at the end.

ibdiag_common.h:
   #define IBERROR(fmt, ...) iberror(__FUNCTION__, fmt, ## __VA_ARGS__)

ibdiag_common.c:
   void iberror(const char *fn, char *msg, ...)
   {
   ...
   	exit(-1);
   }

Is this not correct?  We can change the behavior of IBERROR but I think we
have enough to deal with right now.

Ira

> [snip]



More information about the general mailing list