Commit 18938d54 authored by Adam Wujek's avatar Adam Wujek 💬

userspace/snmpd: add Kconfig option to disable checking of wrsSwcoreStatus

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent f49c4253
......@@ -673,23 +673,34 @@ config SNMP_TEMP_THOLD_PSR
WR-SWITCH-MIB::wrsTemperatureWarning
Require hal restart after change
config SNMP_SWCORESTATUS_HP_FRAME_RATE
int "Maximum allowed rate of HP frames on a port"
default "0"
help
Error via SNMP if rate of HP frames on any port exceed given value.
config SNMP_SWCORESTATUS_RX_FRAME_RATE
int "Maximum allowed rate of RX frames on a port"
default "0"
help
Error via SNMP if rate of RX frames on any port exceed given value.
config SNMP_SWCORESTATUS_RX_PRIO_FRAME_RATE
int "Maximum allowed rate of any RX priority"
default "0"
help
Error if frame rate of any RX priority exceed given value.
config SNMP_SWCORESTATUS_DISABLE
bool "Force SNMP object wrsSwcoreStatus to be always OK"
default false
help
Disable checking SNMP object wrsSwcoreStatus"
# config items below are not implemented in the SNMP
#config SNMP_SWCORESTATUS_HP_FRAME_RATE
# int "Maximum allowed rate of HP frames on a port"
# depends on !SNMP_SWCORESTATUS_DISABLE
# default "0"
# help
# Error via SNMP if rate of HP frames on any port exceed given value.
#
#config SNMP_SWCORESTATUS_RX_FRAME_RATE
# int "Maximum allowed rate of RX frames on a port"
# depends on !SNMP_SWCORESTATUS_DISABLE
# default "0"
# help
# Error via SNMP if rate of RX frames on any port exceed given value.
#
#config SNMP_SWCORESTATUS_RX_PRIO_FRAME_RATE
# int "Maximum allowed rate of any RX priority"
# depends on !SNMP_SWCORESTATUS_DISABLE
# default "0"
# help
# Error if frame rate of any RX priority exceed given value.
#
endmenu
......@@ -855,13 +866,16 @@ config FAN_HYSTERESIS_PWM_VAL
help
PWM value used to drive fans. Range from 4 to 1000.
endmenu
endmenu # "Fan speed control"
config READ_SFP_DIAG_ENABLE
bool "Read SFPs Diagnostic Monitoring"
default n
help
Let HAL to read Diagnostic Monitoring from SFP's eeprom.
endmenu
endmenu # "Developer options"
menu "RTU HP mask"
config RTU_HP_MASK_ENABLE
......
......@@ -804,20 +804,25 @@ appropriate way, before the respective service is started.
threshold level, SNMP object @t{WR-SWITCH-MIB::tempWarning} will change
accordingly.
@item CONFIG_SNMP_SWCORESTATUS_HP_FRAME_RATE
@item CONFIG_SNMP_SWCORESTATUS_DISABLE
Error via SNMP if the rate of HP frames on any port exceed given value.
(currently not implemented)
Force SNMP object @t{wrsSwcoreStatus} to be always OK. It can be used
to mask all potential problems with sw-core.
@item CONFIG_SNMP_SWCORESTATUS_RX_FRAME_RATE
@c @item CONFIG_SNMP_SWCORESTATUS_HP_FRAME_RATE
@c
@c Error via SNMP if the rate of HP frames on any port exceed given value.
@c (currently not implemented)
Error via SNMP if rate of RX frames on any port exceed given value.
(currently not implemented)
@c@item CONFIG_SNMP_SWCORESTATUS_RX_FRAME_RATE
@c
@c Error via SNMP if rate of RX frames on any port exceed given value.
@c (currently not implemented)
@item CONFIG_SNMP_SWCORESTATUS_RX_PRIO_FRAME_RATE
Error if frame rate of any RX priority exceed given value.
(currently not implemented)
@c@item CONFIG_SNMP_SWCORESTATUS_RX_PRIO_FRAME_RATE
@c
@c Error if frame rate of any RX priority exceed given value.
@c (currently not implemented)
@item CONFIG_WRSAUXCLK_FREQ
@itemx CONFIG_WRSAUXCLK_DUTY
......
......@@ -102,6 +102,8 @@ static int get_swcore_status(struct ns_pstats *old,
uint64_t tx_delta;
slog_obj_name = wrsSwcoreStatus_str;
if (ns_dotconfig.disable_wrsSwcoreStatus)
return 0;
for (i = 0; i < rows; i++) {
/* TXFrames and Forwarded described in 2.2.3 "Problem with the
......@@ -182,6 +184,15 @@ static void load_dot_config(void)
{
char *tmp;
ns_dotconfig.disable_wrsSwcoreStatus = 0;
tmp = libwr_cfg_get("SNMP_SWCORESTATUS_DISABLE");
if (tmp && !strcmp(tmp, "y")) {
ns_dotconfig.disable_wrsSwcoreStatus = 1;
snmp_log(LOG_WARNING, "SNMP: "SL_W" %s: "
"SNMP_SWCORESTATUS_DISABLE=y in dot-config\n",
wrsSwcoreStatus_str);
}
tmp = libwr_cfg_get("SNMP_SWCORESTATUS_HP_FRAME_RATE");
if (tmp)
ns_dotconfig.hp_frame_rate = atoi(tmp);
......
......@@ -67,6 +67,7 @@ struct ns_pstats {
/* parameters read from dot-config */
struct wrsNetworkingStatus_config {
int disable_wrsSwcoreStatus;
float hp_frame_rate;
float rx_frame_rate;
float rx_prio_frame_rate;
......
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