* [PATCH infiniband-diags] libibnetdisc/ibnetdisc.c: improve log information to stdout
@ 2014-01-02 6:44 Dan Ben Yosef
[not found] ` <20140102064415.GA4568-d8864ACYL78DyJZ7l8Lk7nI+JuX82XLG@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Dan Ben Yosef @ 2014-01-02 6:44 UTC (permalink / raw)
To: Ira Weiny; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Write to stdout the route-path when smp returns
with status error.
Signed-off-by: Dan Ben Yosef <danby-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
libibnetdisc/src/internal.h | 10 +++++++---
libibnetdisc/src/query_smp.c | 6 ++++++
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/libibnetdisc/src/internal.h b/libibnetdisc/src/internal.h
index 1ccd29c..47b2a4c 100644
--- a/libibnetdisc/src/internal.h
+++ b/libibnetdisc/src/internal.h
@@ -42,12 +42,16 @@
#include <complib/cl_qmap.h>
#include <glib.h>
+#define IBND_ERROR(fmt, ...) \
+ fprintf(stderr, "%s:%u; " fmt, __FILE__, __LINE__, ## __VA_ARGS__)
+
+#define IBND_INFO(fmt, ...) \
+ printf("%s:%u; " fmt, __FILE__, __LINE__, ## __VA_ARGS__);
+
#define IBND_DEBUG(fmt, ...) \
if (ibdebug) { \
- printf("%s:%u; " fmt, __FILE__, __LINE__, ## __VA_ARGS__); \
+ IBND_INFO(fmt,## __VA_ARGS__); \
}
-#define IBND_ERROR(fmt, ...) \
- fprintf(stderr, "%s:%u; " fmt, __FILE__, __LINE__, ## __VA_ARGS__)
/* HASH table defines */
#define HASHGUID(guid) ((uint32_t)(((uint32_t)(guid) * 101) ^ ((uint32_t)((guid) >> 32) * 103)))
diff --git a/libibnetdisc/src/query_smp.c b/libibnetdisc/src/query_smp.c
index 28620b4..ac4984e 100644
--- a/libibnetdisc/src/query_smp.c
+++ b/libibnetdisc/src/query_smp.c
@@ -192,6 +192,9 @@ static int process_one_recv(smp_engine_t * engine)
goto error;
if ((status = umad_status(umad))) {
+ IBND_INFO("umad (%s Attr 0x%x:%u) bad status %d; %s\n",
+ portid2str(&smp->path), smp->rpc.attr.id,
+ smp->rpc.attr.mod, status, strerror(status));
IBND_ERROR("umad (%s Attr 0x%x:%u) bad status %d; %s\n",
portid2str(&smp->path), smp->rpc.attr.id,
smp->rpc.attr.mod, status, strerror(status));
@@ -199,6 +202,9 @@ static int process_one_recv(smp_engine_t * engine)
rc = mlnx_ext_port_info_err(engine, smp, mad,
smp->cb_data);
} else if ((status = mad_get_field(mad, 0, IB_DRSMP_STATUS_F))) {
+ IBND_INFO("mad (%s Attr 0x%x:%u) bad status 0x%x\n",
+ portid2str(&smp->path), smp->rpc.attr.id,
+ smp->rpc.attr.mod, status);
IBND_ERROR("mad (%s Attr 0x%x:%u) bad status 0x%x\n",
portid2str(&smp->path), smp->rpc.attr.id,
smp->rpc.attr.mod, status);
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: [PATCH infiniband-diags] libibnetdisc/ibnetdisc.c: improve log information to stdout
[not found] ` <20140102064415.GA4568-d8864ACYL78DyJZ7l8Lk7nI+JuX82XLG@public.gmane.org>
@ 2014-01-12 15:37 ` Weiny, Ira
[not found] ` <2807E5FD2F6FDA4886F6618EAC48510E04A94D41-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Weiny, Ira @ 2014-01-12 15:37 UTC (permalink / raw)
To: Dan Ben Yosef; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> -----Original Message-----
> From: Dan Ben Yosef [mailto:danby-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org]
> Sent: Wednesday, January 01, 2014 10:44 PM
> Subject: [PATCH infiniband-diags] libibnetdisc/ibnetdisc.c: improve log
> information to stdout
>
> Write to stdout the route-path when smp returns with status error.
As part of a library this will affect many tools outputs and perhaps subsequently any scripts written against those tools.
Is this really a requirement or simply a "nice to have"?
Ira
>
> Signed-off-by: Dan Ben Yosef <danby-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> libibnetdisc/src/internal.h | 10 +++++++---
> libibnetdisc/src/query_smp.c | 6 ++++++
> 2 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/libibnetdisc/src/internal.h b/libibnetdisc/src/internal.h index
> 1ccd29c..47b2a4c 100644
> --- a/libibnetdisc/src/internal.h
> +++ b/libibnetdisc/src/internal.h
> @@ -42,12 +42,16 @@
> #include <complib/cl_qmap.h>
> #include <glib.h>
>
> +#define IBND_ERROR(fmt, ...) \
> + fprintf(stderr, "%s:%u; " fmt, __FILE__, __LINE__, ##
> __VA_ARGS__)
> +
> +#define IBND_INFO(fmt, ...) \
> + printf("%s:%u; " fmt, __FILE__, __LINE__, ##
> __VA_ARGS__);
> +
> #define IBND_DEBUG(fmt, ...) \
> if (ibdebug) { \
> - printf("%s:%u; " fmt, __FILE__, __LINE__, ##
> __VA_ARGS__); \
> + IBND_INFO(fmt,## __VA_ARGS__); \
> }
> -#define IBND_ERROR(fmt, ...) \
> - fprintf(stderr, "%s:%u; " fmt, __FILE__, __LINE__, ##
> __VA_ARGS__)
>
> /* HASH table defines */
> #define HASHGUID(guid) ((uint32_t)(((uint32_t)(guid) * 101) ^
> ((uint32_t)((guid) >> 32) * 103))) diff --git a/libibnetdisc/src/query_smp.c
> b/libibnetdisc/src/query_smp.c index 28620b4..ac4984e 100644
> --- a/libibnetdisc/src/query_smp.c
> +++ b/libibnetdisc/src/query_smp.c
> @@ -192,6 +192,9 @@ static int process_one_recv(smp_engine_t * engine)
> goto error;
>
> if ((status = umad_status(umad))) {
> + IBND_INFO("umad (%s Attr 0x%x:%u) bad status %d; %s\n",
> + portid2str(&smp->path), smp->rpc.attr.id,
> + smp->rpc.attr.mod, status, strerror(status));
> IBND_ERROR("umad (%s Attr 0x%x:%u) bad status %d;
> %s\n",
> portid2str(&smp->path), smp->rpc.attr.id,
> smp->rpc.attr.mod, status, strerror(status)); @@ -
> 199,6 +202,9 @@ static int process_one_recv(smp_engine_t * engine)
> rc = mlnx_ext_port_info_err(engine, smp, mad,
> smp->cb_data);
> } else if ((status = mad_get_field(mad, 0, IB_DRSMP_STATUS_F))) {
> + IBND_INFO("mad (%s Attr 0x%x:%u) bad status 0x%x\n",
> + portid2str(&smp->path), smp->rpc.attr.id,
> + smp->rpc.attr.mod, status);
> IBND_ERROR("mad (%s Attr 0x%x:%u) bad status 0x%x\n",
> portid2str(&smp->path), smp->rpc.attr.id,
> smp->rpc.attr.mod, status);
> --
> 1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH infiniband-diags] libibnetdisc/ibnetdisc.c: improve log information to stdout
[not found] ` <2807E5FD2F6FDA4886F6618EAC48510E04A94D41-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2014-01-19 8:19 ` Dan Ben Yosef
[not found] ` <20140119081953.GB26599-d8864ACYL78DyJZ7l8Lk7nI+JuX82XLG@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Dan Ben Yosef @ 2014-01-19 8:19 UTC (permalink / raw)
To: Weiny, Ira; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On 15:37 Sun 12 Jan , Weiny, Ira wrote:
> > -----Original Message-----
> > From: Dan Ben Yosef [mailto:danby-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org]
> > Sent: Wednesday, January 01, 2014 10:44 PM
> > Subject: [PATCH infiniband-diags] libibnetdisc/ibnetdisc.c: improve log
> > information to stdout
> >
> > Write to stdout the route-path when smp returns with status error.
>
> As part of a library this will affect many tools outputs and perhaps subsequently any scripts written against those tools.
>
> Is this really a requirement or simply a "nice to have"?
That was a customer request to get the query path to stdout when getting an error.
This way when getting smp error they could see DR path to the node in stdout.
-- Dan
>
> Ira
>
> >
> > Signed-off-by: Dan Ben Yosef <danby-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > ---
> > libibnetdisc/src/internal.h | 10 +++++++---
> > libibnetdisc/src/query_smp.c | 6 ++++++
> > 2 files changed, 13 insertions(+), 3 deletions(-)
> >
> > diff --git a/libibnetdisc/src/internal.h b/libibnetdisc/src/internal.h index
> > 1ccd29c..47b2a4c 100644
> > --- a/libibnetdisc/src/internal.h
> > +++ b/libibnetdisc/src/internal.h
> > @@ -42,12 +42,16 @@
> > #include <complib/cl_qmap.h>
> > #include <glib.h>
> >
> > +#define IBND_ERROR(fmt, ...) \
> > + fprintf(stderr, "%s:%u; " fmt, __FILE__, __LINE__, ##
> > __VA_ARGS__)
> > +
> > +#define IBND_INFO(fmt, ...) \
> > + printf("%s:%u; " fmt, __FILE__, __LINE__, ##
> > __VA_ARGS__);
> > +
> > #define IBND_DEBUG(fmt, ...) \
> > if (ibdebug) { \
> > - printf("%s:%u; " fmt, __FILE__, __LINE__, ##
> > __VA_ARGS__); \
> > + IBND_INFO(fmt,## __VA_ARGS__); \
> > }
> > -#define IBND_ERROR(fmt, ...) \
> > - fprintf(stderr, "%s:%u; " fmt, __FILE__, __LINE__, ##
> > __VA_ARGS__)
> >
> > /* HASH table defines */
> > #define HASHGUID(guid) ((uint32_t)(((uint32_t)(guid) * 101) ^
> > ((uint32_t)((guid) >> 32) * 103))) diff --git a/libibnetdisc/src/query_smp.c
> > b/libibnetdisc/src/query_smp.c index 28620b4..ac4984e 100644
> > --- a/libibnetdisc/src/query_smp.c
> > +++ b/libibnetdisc/src/query_smp.c
> > @@ -192,6 +192,9 @@ static int process_one_recv(smp_engine_t * engine)
> > goto error;
> >
> > if ((status = umad_status(umad))) {
> > + IBND_INFO("umad (%s Attr 0x%x:%u) bad status %d; %s\n",
> > + portid2str(&smp->path), smp->rpc.attr.id,
> > + smp->rpc.attr.mod, status, strerror(status));
> > IBND_ERROR("umad (%s Attr 0x%x:%u) bad status %d;
> > %s\n",
> > portid2str(&smp->path), smp->rpc.attr.id,
> > smp->rpc.attr.mod, status, strerror(status)); @@ -
> > 199,6 +202,9 @@ static int process_one_recv(smp_engine_t * engine)
> > rc = mlnx_ext_port_info_err(engine, smp, mad,
> > smp->cb_data);
> > } else if ((status = mad_get_field(mad, 0, IB_DRSMP_STATUS_F))) {
> > + IBND_INFO("mad (%s Attr 0x%x:%u) bad status 0x%x\n",
> > + portid2str(&smp->path), smp->rpc.attr.id,
> > + smp->rpc.attr.mod, status);
> > IBND_ERROR("mad (%s Attr 0x%x:%u) bad status 0x%x\n",
> > portid2str(&smp->path), smp->rpc.attr.id,
> > smp->rpc.attr.mod, status);
> > --
> > 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH infiniband-diags] libibnetdisc/ibnetdisc.c: improve log information to stdout
[not found] ` <20140119081953.GB26599-d8864ACYL78DyJZ7l8Lk7nI+JuX82XLG@public.gmane.org>
@ 2014-01-25 1:20 ` Weiny, Ira
[not found] ` <2807E5FD2F6FDA4886F6618EAC48510E04ADA47A-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Weiny, Ira @ 2014-01-25 1:20 UTC (permalink / raw)
To: Dan Ben Yosef; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> -----Original Message-----
> From: Dan Ben Yosef [mailto:danby-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org]
> Sent: Sunday, January 19, 2014 12:20 AM
> To: Weiny, Ira
> Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: Re: [PATCH infiniband-diags] libibnetdisc/ibnetdisc.c: improve log
> information to stdout
>
> On 15:37 Sun 12 Jan , Weiny, Ira wrote:
> > > -----Original Message-----
> > > From: Dan Ben Yosef [mailto:danby-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org]
> > > Sent: Wednesday, January 01, 2014 10:44 PM
> > > Subject: [PATCH infiniband-diags] libibnetdisc/ibnetdisc.c: improve
> > > log information to stdout
> > >
> > > Write to stdout the route-path when smp returns with status error.
> >
> > As part of a library this will affect many tools outputs and perhaps
> subsequently any scripts written against those tools.
> >
> > Is this really a requirement or simply a "nice to have"?
> That was a customer request to get the query path to stdout when getting an
> error.
>
> This way when getting smp error they could see DR path to the node in
> stdout.
I think this is ok, applied thanks,
Ira
>
> -- Dan
>
> >
> > Ira
> >
> > >
> > > Signed-off-by: Dan Ben Yosef <danby-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > > ---
> > > libibnetdisc/src/internal.h | 10 +++++++---
> > > libibnetdisc/src/query_smp.c | 6 ++++++
> > > 2 files changed, 13 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/libibnetdisc/src/internal.h
> > > b/libibnetdisc/src/internal.h index 1ccd29c..47b2a4c 100644
> > > --- a/libibnetdisc/src/internal.h
> > > +++ b/libibnetdisc/src/internal.h
> > > @@ -42,12 +42,16 @@
> > > #include <complib/cl_qmap.h>
> > > #include <glib.h>
> > >
> > > +#define IBND_ERROR(fmt, ...) \
> > > + fprintf(stderr, "%s:%u; " fmt, __FILE__, __LINE__, ##
> > > __VA_ARGS__)
> > > +
> > > +#define IBND_INFO(fmt, ...) \
> > > + printf("%s:%u; " fmt, __FILE__, __LINE__, ##
> > > __VA_ARGS__);
> > > +
> > > #define IBND_DEBUG(fmt, ...) \
> > > if (ibdebug) { \
> > > - printf("%s:%u; " fmt, __FILE__, __LINE__, ##
> > > __VA_ARGS__); \
> > > + IBND_INFO(fmt,## __VA_ARGS__); \
> > > }
> > > -#define IBND_ERROR(fmt, ...) \
> > > - fprintf(stderr, "%s:%u; " fmt, __FILE__, __LINE__, ##
> > > __VA_ARGS__)
> > >
> > > /* HASH table defines */
> > > #define HASHGUID(guid) ((uint32_t)(((uint32_t)(guid) * 101) ^
> > > ((uint32_t)((guid) >> 32) * 103))) diff --git
> > > a/libibnetdisc/src/query_smp.c b/libibnetdisc/src/query_smp.c index
> > > 28620b4..ac4984e 100644
> > > --- a/libibnetdisc/src/query_smp.c
> > > +++ b/libibnetdisc/src/query_smp.c
> > > @@ -192,6 +192,9 @@ static int process_one_recv(smp_engine_t *
> engine)
> > > goto error;
> > >
> > > if ((status = umad_status(umad))) {
> > > + IBND_INFO("umad (%s Attr 0x%x:%u) bad status %d; %s\n",
> > > + portid2str(&smp->path), smp->rpc.attr.id,
> > > + smp->rpc.attr.mod, status, strerror(status));
> > > IBND_ERROR("umad (%s Attr 0x%x:%u) bad status %d;
> %s\n",
> > > portid2str(&smp->path), smp->rpc.attr.id,
> > > smp->rpc.attr.mod, status, strerror(status)); @@ -
> > > 199,6 +202,9 @@ static int process_one_recv(smp_engine_t * engine)
> > > rc = mlnx_ext_port_info_err(engine, smp, mad,
> > > smp->cb_data);
> > > } else if ((status = mad_get_field(mad, 0, IB_DRSMP_STATUS_F))) {
> > > + IBND_INFO("mad (%s Attr 0x%x:%u) bad status 0x%x\n",
> > > + portid2str(&smp->path), smp->rpc.attr.id,
> > > + smp->rpc.attr.mod, status);
> > > IBND_ERROR("mad (%s Attr 0x%x:%u) bad status 0x%x\n",
> > > portid2str(&smp->path), smp->rpc.attr.id,
> > > smp->rpc.attr.mod, status);
> > > --
> > > 1.7.1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-rdma"
> > in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More
> majordomo
> > info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH infiniband-diags] libibnetdisc/ibnetdisc.c: improve log information to stdout
[not found] ` <2807E5FD2F6FDA4886F6618EAC48510E04ADA47A-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2014-01-25 15:28 ` Hal Rosenstock
[not found] ` <52E3D812.9030009-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Hal Rosenstock @ 2014-01-25 15:28 UTC (permalink / raw)
To: Weiny, Ira
Cc: Dan Ben Yosef, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On 1/24/2014 8:20 PM, Weiny, Ira wrote:
>> -----Original Message-----
>> From: Dan Ben Yosef [mailto:danby-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org]
>> Sent: Sunday, January 19, 2014 12:20 AM
>> To: Weiny, Ira
>> Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> Subject: Re: [PATCH infiniband-diags] libibnetdisc/ibnetdisc.c: improve log
>> information to stdout
>>
>> On 15:37 Sun 12 Jan , Weiny, Ira wrote:
>>>> -----Original Message-----
>>>> From: Dan Ben Yosef [mailto:danby-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org]
>>>> Sent: Wednesday, January 01, 2014 10:44 PM
>>>> Subject: [PATCH infiniband-diags] libibnetdisc/ibnetdisc.c: improve
>>>> log information to stdout
>>>>
>>>> Write to stdout the route-path when smp returns with status error.
>>>
>>> As part of a library this will affect many tools outputs and perhaps
>> subsequently any scripts written against those tools.
>>>
>>> Is this really a requirement or simply a "nice to have"?
>> That was a customer request to get the query path to stdout when getting an
>> error.
>>
>> This way when getting smp error they could see DR path to the node in
>> stdout.
>
> I think this is ok,
Doesn't this change the ibnetdiscover output file format when such
errors are encountered ?
If so, what happens in terms of tools which parse this ?
Should IBND_INFO output be prepended with "# " as that would be safer in
terms of sticking within current output file definition and provides
such feature ?
-- Hal
> applied thanks,
> Ira
>
>>
>> -- Dan
>>
>>>
>>> Ira
>>>
>>>>
>>>> Signed-off-by: Dan Ben Yosef <danby-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>>>> ---
>>>> libibnetdisc/src/internal.h | 10 +++++++---
>>>> libibnetdisc/src/query_smp.c | 6 ++++++
>>>> 2 files changed, 13 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/libibnetdisc/src/internal.h
>>>> b/libibnetdisc/src/internal.h index 1ccd29c..47b2a4c 100644
>>>> --- a/libibnetdisc/src/internal.h
>>>> +++ b/libibnetdisc/src/internal.h
>>>> @@ -42,12 +42,16 @@
>>>> #include <complib/cl_qmap.h>
>>>> #include <glib.h>
>>>>
>>>> +#define IBND_ERROR(fmt, ...) \
>>>> + fprintf(stderr, "%s:%u; " fmt, __FILE__, __LINE__, ##
>>>> __VA_ARGS__)
>>>> +
>>>> +#define IBND_INFO(fmt, ...) \
>>>> + printf("%s:%u; " fmt, __FILE__, __LINE__, ##
>>>> __VA_ARGS__);
>>>> +
>>>> #define IBND_DEBUG(fmt, ...) \
>>>> if (ibdebug) { \
>>>> - printf("%s:%u; " fmt, __FILE__, __LINE__, ##
>>>> __VA_ARGS__); \
>>>> + IBND_INFO(fmt,## __VA_ARGS__); \
>>>> }
>>>> -#define IBND_ERROR(fmt, ...) \
>>>> - fprintf(stderr, "%s:%u; " fmt, __FILE__, __LINE__, ##
>>>> __VA_ARGS__)
>>>>
>>>> /* HASH table defines */
>>>> #define HASHGUID(guid) ((uint32_t)(((uint32_t)(guid) * 101) ^
>>>> ((uint32_t)((guid) >> 32) * 103))) diff --git
>>>> a/libibnetdisc/src/query_smp.c b/libibnetdisc/src/query_smp.c index
>>>> 28620b4..ac4984e 100644
>>>> --- a/libibnetdisc/src/query_smp.c
>>>> +++ b/libibnetdisc/src/query_smp.c
>>>> @@ -192,6 +192,9 @@ static int process_one_recv(smp_engine_t *
>> engine)
>>>> goto error;
>>>>
>>>> if ((status = umad_status(umad))) {
>>>> + IBND_INFO("umad (%s Attr 0x%x:%u) bad status %d; %s\n",
>>>> + portid2str(&smp->path), smp->rpc.attr.id,
>>>> + smp->rpc.attr.mod, status, strerror(status));
>>>> IBND_ERROR("umad (%s Attr 0x%x:%u) bad status %d;
>> %s\n",
>>>> portid2str(&smp->path), smp->rpc.attr.id,
>>>> smp->rpc.attr.mod, status, strerror(status)); @@ -
>>>> 199,6 +202,9 @@ static int process_one_recv(smp_engine_t * engine)
>>>> rc = mlnx_ext_port_info_err(engine, smp, mad,
>>>> smp->cb_data);
>>>> } else if ((status = mad_get_field(mad, 0, IB_DRSMP_STATUS_F))) {
>>>> + IBND_INFO("mad (%s Attr 0x%x:%u) bad status 0x%x\n",
>>>> + portid2str(&smp->path), smp->rpc.attr.id,
>>>> + smp->rpc.attr.mod, status);
>>>> IBND_ERROR("mad (%s Attr 0x%x:%u) bad status 0x%x\n",
>>>> portid2str(&smp->path), smp->rpc.attr.id,
>>>> smp->rpc.attr.mod, status);
>>>> --
>>>> 1.7.1
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-rdma"
>>> in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More
>> majordomo
>>> info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH infiniband-diags] libibnetdisc/ibnetdisc.c: improve log information to stdout
[not found] ` <52E3D812.9030009-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2014-01-26 6:04 ` Weiny, Ira
0 siblings, 0 replies; 6+ messages in thread
From: Weiny, Ira @ 2014-01-26 6:04 UTC (permalink / raw)
To: Hal Rosenstock
Cc: Dan Ben Yosef, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> >>>
> >>> As part of a library this will affect many tools outputs and perhaps
> >> subsequently any scripts written against those tools.
> >>>
> >>> Is this really a requirement or simply a "nice to have"?
> >> That was a customer request to get the query path to stdout when
> >> getting an error.
> >>
> >> This way when getting smp error they could see DR path to the node in
> >> stdout.
> >
> > I think this is ok,
>
> Doesn't this change the ibnetdiscover output file format when such errors
> are encountered ?
yes
>
> If so, what happens in terms of tools which parse this ?
They may break.
>
> Should IBND_INFO output be prepended with "# " as that would be safer in
> terms of sticking within current output file definition and provides such
> feature ?
At first, I thought this would be a good compromise but I looked back before libibnetdisc was created and I see no indication that "# " prefixed errors in ibnetdiscover back then. It appears that all errors have always gone to stderr AFAICS.
I understand the issues with users not seeing any indication of error in their output. But this really is a mistake and I should not have accepted this patch as submitted.
I'm sorry Dan, I'm reverting the patch and re-releasing for the upcoming OFED.
I think there are 2 solutions for this.
1) users can direct stderr to stdout to capture all the output
2) I'd be open to a patch which adds an option to the library to allow the user to add error output to stdout.
Sorry for the confusion,
Ira
>
> -- Hal
>
> > applied thanks,
> > Ira
> >
> >>
> >> -- Dan
> >>
> >>>
> >>> Ira
> >>>
> >>>>
> >>>> Signed-off-by: Dan Ben Yosef <danby-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> >>>> ---
> >>>> libibnetdisc/src/internal.h | 10 +++++++---
> >>>> libibnetdisc/src/query_smp.c | 6 ++++++
> >>>> 2 files changed, 13 insertions(+), 3 deletions(-)
> >>>>
> >>>> diff --git a/libibnetdisc/src/internal.h
> >>>> b/libibnetdisc/src/internal.h index 1ccd29c..47b2a4c 100644
> >>>> --- a/libibnetdisc/src/internal.h
> >>>> +++ b/libibnetdisc/src/internal.h
> >>>> @@ -42,12 +42,16 @@
> >>>> #include <complib/cl_qmap.h>
> >>>> #include <glib.h>
> >>>>
> >>>> +#define IBND_ERROR(fmt, ...) \
> >>>> + fprintf(stderr, "%s:%u; " fmt, __FILE__, __LINE__, ##
> >>>> __VA_ARGS__)
> >>>> +
> >>>> +#define IBND_INFO(fmt, ...) \
> >>>> + printf("%s:%u; " fmt, __FILE__, __LINE__, ##
> >>>> __VA_ARGS__);
> >>>> +
> >>>> #define IBND_DEBUG(fmt, ...) \
> >>>> if (ibdebug) { \
> >>>> - printf("%s:%u; " fmt, __FILE__, __LINE__, ##
> >>>> __VA_ARGS__); \
> >>>> + IBND_INFO(fmt,## __VA_ARGS__); \
> >>>> }
> >>>> -#define IBND_ERROR(fmt, ...) \
> >>>> - fprintf(stderr, "%s:%u; " fmt, __FILE__, __LINE__, ##
> >>>> __VA_ARGS__)
> >>>>
> >>>> /* HASH table defines */
> >>>> #define HASHGUID(guid) ((uint32_t)(((uint32_t)(guid) * 101) ^
> >>>> ((uint32_t)((guid) >> 32) * 103))) diff --git
> >>>> a/libibnetdisc/src/query_smp.c b/libibnetdisc/src/query_smp.c index
> >>>> 28620b4..ac4984e 100644
> >>>> --- a/libibnetdisc/src/query_smp.c
> >>>> +++ b/libibnetdisc/src/query_smp.c
> >>>> @@ -192,6 +192,9 @@ static int process_one_recv(smp_engine_t *
> >> engine)
> >>>> goto error;
> >>>>
> >>>> if ((status = umad_status(umad))) {
> >>>> + IBND_INFO("umad (%s Attr 0x%x:%u) bad status %d; %s\n",
> >>>> + portid2str(&smp->path), smp->rpc.attr.id,
> >>>> + smp->rpc.attr.mod, status, strerror(status));
> >>>> IBND_ERROR("umad (%s Attr 0x%x:%u) bad status %d;
> >> %s\n",
> >>>> portid2str(&smp->path), smp->rpc.attr.id,
> >>>> smp->rpc.attr.mod, status, strerror(status)); @@ -
> >>>> 199,6 +202,9 @@ static int process_one_recv(smp_engine_t * engine)
> >>>> rc = mlnx_ext_port_info_err(engine, smp, mad,
> >>>> smp->cb_data);
> >>>> } else if ((status = mad_get_field(mad, 0, IB_DRSMP_STATUS_F))) {
> >>>> + IBND_INFO("mad (%s Attr 0x%x:%u) bad status 0x%x\n",
> >>>> + portid2str(&smp->path), smp->rpc.attr.id,
> >>>> + smp->rpc.attr.mod, status);
> >>>> IBND_ERROR("mad (%s Attr 0x%x:%u) bad status 0x%x\n",
> >>>> portid2str(&smp->path), smp->rpc.attr.id,
> >>>> smp->rpc.attr.mod, status);
> >>>> --
> >>>> 1.7.1
> >>>
> >>> --
> >>> To unsubscribe from this list: send the line "unsubscribe linux-rdma"
> >>> in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More
> >> majordomo
> >>> info at http://vger.kernel.org/majordomo-info.html
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-rdma"
> > in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More
> majordomo
> > info at http://vger.kernel.org/majordomo-info.html
> >
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-01-26 6:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-02 6:44 [PATCH infiniband-diags] libibnetdisc/ibnetdisc.c: improve log information to stdout Dan Ben Yosef
[not found] ` <20140102064415.GA4568-d8864ACYL78DyJZ7l8Lk7nI+JuX82XLG@public.gmane.org>
2014-01-12 15:37 ` Weiny, Ira
[not found] ` <2807E5FD2F6FDA4886F6618EAC48510E04A94D41-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-01-19 8:19 ` Dan Ben Yosef
[not found] ` <20140119081953.GB26599-d8864ACYL78DyJZ7l8Lk7nI+JuX82XLG@public.gmane.org>
2014-01-25 1:20 ` Weiny, Ira
[not found] ` <2807E5FD2F6FDA4886F6618EAC48510E04ADA47A-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-01-25 15:28 ` Hal Rosenstock
[not found] ` <52E3D812.9030009-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2014-01-26 6:04 ` Weiny, Ira
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox