Commit 394194df authored by Grzegorz Daniluk's avatar Grzegorz Daniluk Committed by Adam Wujek

userspace/snmp: adding NIC TX frame counter to exported Pstats

parent 950856e1
......@@ -2036,7 +2036,8 @@ WrsPstatsHCEntry ::=
wrsPstatsHCFastMatchRespValid Counter64,
wrsPstatsHCFullMatchRespValid Counter64,
wrsPstatsHCForwarded Counter64,
wrsPstatsHCTRURespValid Counter64
wrsPstatsHCTRURespValid Counter64,
wrsPstatsHCNICTXFrames Counter64
}
wrsPstatsHCIndex OBJECT-TYPE
......@@ -2376,7 +2377,15 @@ wrsPstatsHCTRURespValid OBJECT-TYPE
DESCRIPTION
"Number of TRU decisions"
::= { wrsPstatsHCEntry 41 }
wrsPstatsHCNICTXFrames OBJECT-TYPE
SYNTAX Counter64
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of TX frames coming from CPU"
::= { wrsPstatsHCEntry 42 }
--wrsNetworking
--Configuration
END
\ No newline at end of file
END
......@@ -46,6 +46,7 @@ static struct pickinfo wrsPstatsHCTable_pickinfo[] = {
FIELD(wrsPstatsHCTable_s, ASN_COUNTER64, wrsPstatsHCFullMatchRespValid),
FIELD(wrsPstatsHCTable_s, ASN_COUNTER64, wrsPstatsHCForwarded),
FIELD(wrsPstatsHCTable_s, ASN_COUNTER64, wrsPstatsHCTRURespValid),
FIELD(wrsPstatsHCTable_s, ASN_COUNTER64, wrsPstatsHCNICTXFrames),
};
time_t
......@@ -171,6 +172,7 @@ wrsPstatsHCTable_data_fill(unsigned int *n_rows)
pstats_array[wrport].wrsPstatsHCFullMatchRespValid = counters[36];
pstats_array[wrport].wrsPstatsHCForwarded = counters[37];
pstats_array[wrport].wrsPstatsHCTRURespValid = counters[38];
pstats_array[wrport].wrsPstatsHCNICTXFrames = counters[39];
break;
case 2:
default:
......
......@@ -4,7 +4,7 @@
#define WRSPSTATSHCTABLE_CACHE_TIMEOUT 5
#define WRSPSTATSHCTABLE_OID WRS_OID, 7, 7
#define PSTATS_MAX_N_COUNTERS 39 /* maximum number of counters */
#define PSTATS_MAX_N_COUNTERS 40 /* maximum number of counters */
#define PSTATS_SYSCTL_PATH "/proc/sys/pstats/" /* Path to sysclt entries */
#define PSTATS_SYSCTL_INFO_FILE "info" /* file with version of pstats counters
* and number of counters */
......@@ -53,6 +53,7 @@ struct wrsPstatsHCTable_s {
uint64_t wrsPstatsHCFullMatchRespValid;
uint64_t wrsPstatsHCForwarded;
uint64_t wrsPstatsHCTRURespValid;
uint64_t wrsPstatsHCNICTXFrames;
};
extern struct wrsPstatsHCTable_s pstats_array[WRS_N_PORTS];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment