All of lore.kernel.org
 help / color / mirror / Atom feed
* ibswitches command displays wrong information when switch description string includes "base"
@ 2012-01-07  0:22 pierre orzechowski
       [not found] ` <4F079048.8050709-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: pierre orzechowski @ 2012-01-07  0:22 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hello,

We have a customer reporting an issue with the "ibswitches" command part 
of the infiniband-diags package.
If the switch description includes the string "base" anywhere, then the 
match operation in the awk section of ibwitches does not behave as 
expected and output is garbled.

Example :

[root@slcc09sw-ib2 tmp]# grep Switch ibnetdisc.out
Switch  36 "S-002128468ee1a0a0"         # "SUN DCS 36P QDR basesw-ib3 
10.242.48.23" enhanced port 0 lid 1 lmc 0
Switch  36 "S-0021286cc8a3a0a0"         # "SUN DCS 46P QDR slcc09sw-ib3 
10.242.48.24" enhanced port 0 lid 12 lmc 0
[root@slcc09sw-ib2 tmp]# ibswitches ibnetdisc.out
Switch  : 0x002128468ee1a0a0 ports 36 "SUN DCS 36P QDR base port 0 lid 1 
lmc 0
Switch  : 0x0021286cc8a3a0a0 ports 36 "SUN DCS 46P QDR slcc09sw-ib3 
10.242.48.24" enhanced port 0 lid 12 lmc 0

The 1 liner workaround we have is to replace in red :
echo "$text" | awk '
/^Switch/       {
                         l=$0
                         desc=substr(l, match(l, "#[ \t]*")+RLENGTH)
                         pi=match(desc, "port 0.*")
                         pinfo=substr(desc, pi)
                         desc=substr(desc, 1, pi-2)
type="base"
                         ti=match(desc, type)
...

With

echo "$text" | awk '
/^Switch/       {
                         l=$0
                         desc=substr(l, match(l, "#[ \t]*")+RLENGTH)
                         pi=match(desc, "port 0.*")
                         pinfo=substr(desc, pi)
                         desc=substr(desc, 1, pi-2)
type="\base\"
                         ti=match(desc, type)
...

Thanks for your help in reviewing this potential defect.
Apologies if posting to the wrong mailing list.

Best regards,
Pierre Orzechowski

--
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] 3+ messages in thread

* Re: ibswitches command displays wrong information when switch description string includes "base"
       [not found] ` <4F079048.8050709-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
@ 2012-01-07  0:51   ` Jason Gunthorpe
  2012-01-12  7:36   ` Ira Weiny
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2012-01-07  0:51 UTC (permalink / raw)
  To: pierre orzechowski; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Fri, Jan 06, 2012 at 04:22:32PM -0800, pierre orzechowski wrote:

> We have a customer reporting an issue with the "ibswitches" command
> part of the infiniband-diags package.
> If the switch description includes the string "base" anywhere, then
> the match operation in the awk section of ibwitches does not behave
> as expected and output is garbled.

These shell tools have all been de-supported by the infiniband-diags
maintainer, exactly because they are prone to these sorts of problems
due to inherent design flaws.

The recommendation is to use the new C based commands, but there is
not an exact correspondence.

python-rdma's ibtool command has work-alikes for all of the old
commands that do not have these issues for people who absolutely must
have the old commands.

Jason
--
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] 3+ messages in thread

* Re: ibswitches command displays wrong information when switch description string includes "base"
       [not found] ` <4F079048.8050709-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
  2012-01-07  0:51   ` Jason Gunthorpe
@ 2012-01-12  7:36   ` Ira Weiny
  1 sibling, 0 replies; 3+ messages in thread
From: Ira Weiny @ 2012-01-12  7:36 UTC (permalink / raw)
  To: pierre orzechowski; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

While Jason is correct that I am working to deprecate the scripts this bug still exists in the 1.5 branch.

Thanks for pointing this out.  As Open Fabrics is doing an additional 1.5 release I will attempt to fix before that release.

Thanks,
Ira

On Fri, 6 Jan 2012 16:22:32 -0800
pierre orzechowski <pierre.e.orzechowski-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:

> Hello,
> 
> We have a customer reporting an issue with the "ibswitches" command part 
> of the infiniband-diags package.
> If the switch description includes the string "base" anywhere, then the 
> match operation in the awk section of ibwitches does not behave as 
> expected and output is garbled.
> 
> Example :
> 
> [root@slcc09sw-ib2 tmp]# grep Switch ibnetdisc.out
> Switch  36 "S-002128468ee1a0a0"         # "SUN DCS 36P QDR basesw-ib3 
> 10.242.48.23" enhanced port 0 lid 1 lmc 0
> Switch  36 "S-0021286cc8a3a0a0"         # "SUN DCS 46P QDR slcc09sw-ib3 
> 10.242.48.24" enhanced port 0 lid 12 lmc 0
> [root@slcc09sw-ib2 tmp]# ibswitches ibnetdisc.out
> Switch  : 0x002128468ee1a0a0 ports 36 "SUN DCS 36P QDR base port 0 lid 1 
> lmc 0
> Switch  : 0x0021286cc8a3a0a0 ports 36 "SUN DCS 46P QDR slcc09sw-ib3 
> 10.242.48.24" enhanced port 0 lid 12 lmc 0
> 
> The 1 liner workaround we have is to replace in red :
> echo "$text" | awk '
> /^Switch/       {
>                          l=$0
>                          desc=substr(l, match(l, "#[ \t]*")+RLENGTH)
>                          pi=match(desc, "port 0.*")
>                          pinfo=substr(desc, pi)
>                          desc=substr(desc, 1, pi-2)
> type="base"
>                          ti=match(desc, type)
> ...
> 
> With
> 
> echo "$text" | awk '
> /^Switch/       {
>                          l=$0
>                          desc=substr(l, match(l, "#[ \t]*")+RLENGTH)
>                          pi=match(desc, "port 0.*")
>                          pinfo=substr(desc, pi)
>                          desc=substr(desc, 1, pi-2)
> type="\base\"
>                          ti=match(desc, type)
> ...
> 
> Thanks for your help in reviewing this potential defect.
> Apologies if posting to the wrong mailing list.
> 
> Best regards,
> Pierre Orzechowski
> 
> --
> 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


-- 
Ira Weiny
Member of Technical Staff
Lawrence Livermore National Lab
925-423-8008
weiny2-i2BcT+NCU+M@public.gmane.org
--
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] 3+ messages in thread

end of thread, other threads:[~2012-01-12  7:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-07  0:22 ibswitches command displays wrong information when switch description string includes "base" pierre orzechowski
     [not found] ` <4F079048.8050709-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2012-01-07  0:51   ` Jason Gunthorpe
2012-01-12  7:36   ` Ira Weiny

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.