All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: ibqueryerrors.c: Add support for additional counters in PortCountersExtended
@ 2017-09-30  1:42 Weiny, Ira
       [not found] ` <2807E5FD2F6FDA4886F6618EAC48510E67D31C52-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Weiny, Ira @ 2017-09-30  1:42 UTC (permalink / raw)
  To: 'Hal Rosenstock
	(hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org)',
	odedni-VPRAkNaXOzVWk0Htik3J/w
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hal, Oded,

I have lost the original email from this submission but got it off of patchwork.

Question on the hunk below.

diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c                                                       
index 304dc154c4b4..4ea762a1f344 100644                                                                      
--- a/src/ibqueryerrors.c                                                                                    
+++ b/src/ibqueryerrors.c                                                                                    
@@ -105,15 +105,15 @@ static unsigned valid_gid(ib_gid_t * gid)                                              
        return memcmp(&zero_gid, gid, sizeof(*gid));                                                         
 }                                                                                                           
                                                                                                             
-static void set_thres(char *name, uint32_t val)                                                             
+static void set_thres(char *name, uint64_t val)                                                             
 {                                                                                                           
        int f;                                                                                               
        int n;                                                                                               
        char tmp[256];                                                                                       
-       for (f = IB_PC_FIRST_F; f <= IB_PC_LAST_F; f++) {                                                    
+       for (f = IB_PC_EXT_ERR_SYM_F; f <= IB_PC_EXT_XMT_WAIT_F; f++) {                                      

How does this change allow for users to set the old Port Counters thresholds?

Ira


                if (strcmp(name, mad_field_name(f)) == 0) {                                                  
                        mad_encode_field(thresholds, f, &val);                                               
-                       snprintf(tmp, 255, "[%s = %u]", name, val);                                          
+                       snprintf(tmp, 255, "[%s = %lu]", name, val);                                         
                        threshold_str = realloc(threshold_str,                                               
                                        strlen(threshold_str)+strlen(tmp)+1);                                
                        if (!threshold_str) {                                                                
--
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] 4+ messages in thread

* RE: ibqueryerrors.c: Add support for additional counters in PortCountersExtended
       [not found] ` <2807E5FD2F6FDA4886F6618EAC48510E67D31C52-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2017-10-01  8:07   ` Oded Nissan
       [not found]     ` <DB6PR0501MB2245E78D6118FE145C8141D8A87C0-wTfl6qNNZ1OA0EDQtjEfCcDSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Oded Nissan @ 2017-10-01  8:07 UTC (permalink / raw)
  To: Weiny, Ira,
	'Hal Rosenstock
	(hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org)'
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hi Ira,

Users don't set thresholds for old/new counters, they just set thresholds and if new counters are supported then thresholds are checked against new counters and if only old counters are supported then thresholds are checked against old counters.

-----Original Message-----
From: Weiny, Ira [mailto:ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org] 
Sent: Saturday, September 30, 2017 4:42 AM
To: 'Hal Rosenstock (hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org)' <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>; Oded Nissan <odedni-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: RE: ibqueryerrors.c: Add support for additional counters in PortCountersExtended

Hal, Oded,

I have lost the original email from this submission but got it off of patchwork.

Question on the hunk below.

diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c                                                       
index 304dc154c4b4..4ea762a1f344 100644                                                                      
--- a/src/ibqueryerrors.c                                                                                    
+++ b/src/ibqueryerrors.c                                                                                    
@@ -105,15 +105,15 @@ static unsigned valid_gid(ib_gid_t * gid)                                              
        return memcmp(&zero_gid, gid, sizeof(*gid));                                                         
 }                                                                                                           
                                                                                                             
-static void set_thres(char *name, uint32_t val)                                                             
+static void set_thres(char *name, uint64_t val)                                                             
 {                                                                                                           
        int f;                                                                                               
        int n;                                                                                               
        char tmp[256];                                                                                       
-       for (f = IB_PC_FIRST_F; f <= IB_PC_LAST_F; f++) {                                                    
+       for (f = IB_PC_EXT_ERR_SYM_F; f <= IB_PC_EXT_XMT_WAIT_F; f++) {                                      

How does this change allow for users to set the old Port Counters thresholds?

Ira


                if (strcmp(name, mad_field_name(f)) == 0) {                                                  
                        mad_encode_field(thresholds, f, &val);                                               
-                       snprintf(tmp, 255, "[%s = %u]", name, val);                                          
+                       snprintf(tmp, 255, "[%s = %lu]", name, val);                                         
                        threshold_str = realloc(threshold_str,                                               
                                        strlen(threshold_str)+strlen(tmp)+1);                                
                        if (!threshold_str) {                                                                
--
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] 4+ messages in thread

* RE: ibqueryerrors.c: Add support for additional counters in PortCountersExtended
       [not found]     ` <DB6PR0501MB2245E78D6118FE145C8141D8A87C0-wTfl6qNNZ1OA0EDQtjEfCcDSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
@ 2017-10-24 20:20       ` Weiny, Ira
       [not found]         ` <2807E5FD2F6FDA4886F6618EAC48510E67D4459A-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Weiny, Ira @ 2017-10-24 20:20 UTC (permalink / raw)
  To: Oded Nissan,
	'Hal Rosenstock
	(hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org)'
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> 
> Hi Ira,
> 
> Users don't set thresholds for old/new counters, they just set thresholds and if
> new counters are supported then thresholds are checked against new counters
> and if only old counters are supported then thresholds are checked against old
> counters.

But you are not checking the same set of counters.

        IB_PC_EXT_ERR_SYM_F,                                                                                                                               
        IB_PC_EXT_LINK_RECOVERS_F,                                              
        IB_PC_EXT_LINK_DOWNED_F,                                                
        IB_PC_EXT_ERR_RCV_F,                                                    
        IB_PC_EXT_ERR_PHYSRCV_F,                                                
        IB_PC_EXT_ERR_SWITCH_REL_F,                                             
        IB_PC_EXT_XMT_DISCARDS_F,                                               
        IB_PC_EXT_ERR_XMTCONSTR_F,                                              
        IB_PC_EXT_ERR_RCVCONSTR_F,                                              
        IB_PC_EXT_ERR_LOCALINTEG_F,                                             
        IB_PC_EXT_ERR_EXCESS_OVR_F,                                             
        IB_PC_EXT_VL15_DROPPED_F,                                               
        IB_PC_EXT_XMT_WAIT_F,                                                   
        IB_PC_EXT_QP1_DROP_F,                                                   
        IB_PC_EXT_ERR_LAST_F,                                                   


VS.

        /*                                                                      
         * GS Performance                                                       
         */                                                                     
        IB_PC_FIRST_F,                                                          
        IB_PC_PORT_SELECT_F = IB_PC_FIRST_F,                                    
        IB_PC_COUNTER_SELECT_F,                                                 
        IB_PC_ERR_SYM_F,                                                        
        IB_PC_LINK_RECOVERS_F,                                                  
        IB_PC_LINK_DOWNED_F,                                                    
        IB_PC_ERR_RCV_F,                                                        
        IB_PC_ERR_PHYSRCV_F,                                                    
        IB_PC_ERR_SWITCH_REL_F,                                                 
        IB_PC_XMT_DISCARDS_F,                                                   
        IB_PC_ERR_XMTCONSTR_F,                                                  
        IB_PC_ERR_RCVCONSTR_F,                                                  
        IB_PC_COUNTER_SELECT2_F,                                                
        IB_PC_ERR_LOCALINTEG_F,                                                 
        IB_PC_ERR_EXCESS_OVR_F,                                                 
        IB_PC_VL15_DROPPED_F,                                                   
        IB_PC_XMT_BYTES_F,                                                      
        IB_PC_RCV_BYTES_F,                                                      
        IB_PC_XMT_PKTS_F,                                                       
        IB_PC_RCV_PKTS_F,                                                       
        IB_PC_XMT_WAIT_F,                                                       
        IB_PC_LAST_F,                                                           

For example you no longer can specify IB_PC_XMT_BYTES_F.

As I don't think anyone uses these thresholds for this counter I'm going to let the patch go.  But generally this probably should be cleaned up somehow.  I just don't have the time as I am sure you don't...  ;-)

Ira


> 
> -----Original Message-----
> From: Weiny, Ira [mailto:ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org]
> Sent: Saturday, September 30, 2017 4:42 AM
> To: 'Hal Rosenstock (hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org)' <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>; Oded
> Nissan <odedni-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: RE: ibqueryerrors.c: Add support for additional counters in
> PortCountersExtended
> 
> Hal, Oded,
> 
> I have lost the original email from this submission but got it off of patchwork.
> 
> Question on the hunk below.
> 
> diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c
> index 304dc154c4b4..4ea762a1f344 100644
> --- a/src/ibqueryerrors.c
> +++ b/src/ibqueryerrors.c
> @@ -105,15 +105,15 @@ static unsigned valid_gid(ib_gid_t * gid)
>         return memcmp(&zero_gid, gid, sizeof(*gid));
>  }
> 
> -static void set_thres(char *name, uint32_t val)
> +static void set_thres(char *name, uint64_t val)
>  {
>         int f;
>         int n;
>         char tmp[256];
> -       for (f = IB_PC_FIRST_F; f <= IB_PC_LAST_F; f++) {
> +       for (f = IB_PC_EXT_ERR_SYM_F; f <= IB_PC_EXT_XMT_WAIT_F; f++) {
> 
> How does this change allow for users to set the old Port Counters thresholds?
> 
> Ira
> 
> 
>                 if (strcmp(name, mad_field_name(f)) == 0) {
>                         mad_encode_field(thresholds, f, &val);
> -                       snprintf(tmp, 255, "[%s = %u]", name, val);
> +                       snprintf(tmp, 255, "[%s = %lu]", name, val);
>                         threshold_str = realloc(threshold_str,
>                                         strlen(threshold_str)+strlen(tmp)+1);
>                         if (!threshold_str) {
--
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] 4+ messages in thread

* RE: ibqueryerrors.c: Add support for additional counters in PortCountersExtended
       [not found]         ` <2807E5FD2F6FDA4886F6618EAC48510E67D4459A-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2017-10-25  9:04           ` Oded Nissan
  0 siblings, 0 replies; 4+ messages in thread
From: Oded Nissan @ 2017-10-25  9:04 UTC (permalink / raw)
  To: Weiny, Ira,
	'Hal Rosenstock
	(hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org)'
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA


> -----Original Message-----
> From: Weiny, Ira [mailto:ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org]
> Sent: Tuesday, October 24, 2017 11:20 PM
> To: Oded Nissan <odedni-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>; 'Hal Rosenstock
> (hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org)' <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
> Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: RE: ibqueryerrors.c: Add support for additional counters in
> PortCountersExtended
> 
> >
> > Hi Ira,
> >
> > Users don't set thresholds for old/new counters, they just set
> > thresholds and if new counters are supported then thresholds are
> > checked against new counters and if only old counters are supported
> > then thresholds are checked against old counters.
> 
> But you are not checking the same set of counters.
> 
>         IB_PC_EXT_ERR_SYM_F,
>         IB_PC_EXT_LINK_RECOVERS_F,
>         IB_PC_EXT_LINK_DOWNED_F,
>         IB_PC_EXT_ERR_RCV_F,
>         IB_PC_EXT_ERR_PHYSRCV_F,
>         IB_PC_EXT_ERR_SWITCH_REL_F,
>         IB_PC_EXT_XMT_DISCARDS_F,
>         IB_PC_EXT_ERR_XMTCONSTR_F,
>         IB_PC_EXT_ERR_RCVCONSTR_F,
>         IB_PC_EXT_ERR_LOCALINTEG_F,
>         IB_PC_EXT_ERR_EXCESS_OVR_F,
>         IB_PC_EXT_VL15_DROPPED_F,
>         IB_PC_EXT_XMT_WAIT_F,
>         IB_PC_EXT_QP1_DROP_F,
>         IB_PC_EXT_ERR_LAST_F,
> 
> 
> VS.
> 
>         /*
>          * GS Performance
>          */
>         IB_PC_FIRST_F,
>         IB_PC_PORT_SELECT_F = IB_PC_FIRST_F,
>         IB_PC_COUNTER_SELECT_F,
>         IB_PC_ERR_SYM_F,
>         IB_PC_LINK_RECOVERS_F,
>         IB_PC_LINK_DOWNED_F,
>         IB_PC_ERR_RCV_F,
>         IB_PC_ERR_PHYSRCV_F,
>         IB_PC_ERR_SWITCH_REL_F,
>         IB_PC_XMT_DISCARDS_F,
>         IB_PC_ERR_XMTCONSTR_F,
>         IB_PC_ERR_RCVCONSTR_F,
>         IB_PC_COUNTER_SELECT2_F,
>         IB_PC_ERR_LOCALINTEG_F,
>         IB_PC_ERR_EXCESS_OVR_F,
>         IB_PC_VL15_DROPPED_F,
>         IB_PC_XMT_BYTES_F,
>         IB_PC_RCV_BYTES_F,
>         IB_PC_XMT_PKTS_F,
>         IB_PC_RCV_PKTS_F,
>         IB_PC_XMT_WAIT_F,
>         IB_PC_LAST_F,
> 
> For example you no longer can specify IB_PC_XMT_BYTES_F.
> 
> As I don't think anyone uses these thresholds for this counter I'm going to let
> the patch go.  But generally this probably should be cleaned up somehow.  I
> just don't have the time as I am sure you don't...  ;-)
> 
> Ira
> 
>

These counters:

IB_PC_XMT_BYTES_F,
IB_PC_RCV_BYTES_F,
IB_PC_XMT_PKTS_F,
IB_PC_RCV_PKTS_F,

Are not error counters and also in the old version users couldn't set thresholds for them.
 
Oded 

> >
> > -----Original Message-----
> > From: Weiny, Ira [mailto:ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org]
> > Sent: Saturday, September 30, 2017 4:42 AM
> > To: 'Hal Rosenstock (hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org)'
> > <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>; Oded Nissan <odedni-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > Subject: RE: ibqueryerrors.c: Add support for additional counters in
> > PortCountersExtended
> >
> > Hal, Oded,
> >
> > I have lost the original email from this submission but got it off of
> patchwork.
> >
> > Question on the hunk below.
> >
> > diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c index
> > 304dc154c4b4..4ea762a1f344 100644
> > --- a/src/ibqueryerrors.c
> > +++ b/src/ibqueryerrors.c
> > @@ -105,15 +105,15 @@ static unsigned valid_gid(ib_gid_t * gid)
> >         return memcmp(&zero_gid, gid, sizeof(*gid));  }
> >
> > -static void set_thres(char *name, uint32_t val)
> > +static void set_thres(char *name, uint64_t val)
> >  {
> >         int f;
> >         int n;
> >         char tmp[256];
> > -       for (f = IB_PC_FIRST_F; f <= IB_PC_LAST_F; f++) {
> > +       for (f = IB_PC_EXT_ERR_SYM_F; f <= IB_PC_EXT_XMT_WAIT_F; f++)
> > + {
> >
> > How does this change allow for users to set the old Port Counters
> thresholds?
> >
> > Ira
> >
> >
> >                 if (strcmp(name, mad_field_name(f)) == 0) {
> >                         mad_encode_field(thresholds, f, &val);
> > -                       snprintf(tmp, 255, "[%s = %u]", name, val);
> > +                       snprintf(tmp, 255, "[%s = %lu]", name, val);
> >                         threshold_str = realloc(threshold_str,
> >                                         strlen(threshold_str)+strlen(tmp)+1);
> >                         if (!threshold_str) {
--
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] 4+ messages in thread

end of thread, other threads:[~2017-10-25  9:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-30  1:42 ibqueryerrors.c: Add support for additional counters in PortCountersExtended Weiny, Ira
     [not found] ` <2807E5FD2F6FDA4886F6618EAC48510E67D31C52-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-10-01  8:07   ` Oded Nissan
     [not found]     ` <DB6PR0501MB2245E78D6118FE145C8141D8A87C0-wTfl6qNNZ1OA0EDQtjEfCcDSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-10-24 20:20       ` Weiny, Ira
     [not found]         ` <2807E5FD2F6FDA4886F6618EAC48510E67D4459A-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-10-25  9:04           ` Oded Nissan

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.