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