RE: ibqueryerrors.c: Add support for additional counters in PortCountersExtended

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx] 
Sent: Saturday, September 30, 2017 4:42 AM
To: 'Hal Rosenstock (hal@xxxxxxxxxxxxxxxxxx)' <hal@xxxxxxxxxxxxxxxxxx>; Oded Nissan <odedni@xxxxxxxxxxxx>
Cc: linux-rdma@xxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux