Merge branch 'feature-kni2a-keepalive' into 'kni2a'

调整kni.conf

See merge request tango/kni!15
This commit is contained in:
崔一鸣
2019-06-21 20:34:17 +08:00
2 changed files with 6 additions and 6 deletions

View File

@@ -30,9 +30,9 @@ listen_eth = eth0
listen_port = 2475 listen_port = 2475
[watch_dog] [watch_dog]
switch = 1
listen_eth = eth0 listen_eth = eth0
listen_port = 2476 listen_port = 2476
keepalive_switch = 1
keepalive_idle = 2 keepalive_idle = 2
keepalive_intvl = 1 keepalive_intvl = 1
keepalive_cnt = 3 keepalive_cnt = 3

View File

@@ -18,7 +18,7 @@ struct tfe_mgr{
int tfe_enabled_node_count; int tfe_enabled_node_count;
int tfe_alive_nodes[TFE_COUNT_MAX]; int tfe_alive_nodes[TFE_COUNT_MAX];
int tfe_alive_node_count; int tfe_alive_node_count;
int keepalive_switch; int watch_dog_switch;
void *logger; void *logger;
}; };
@@ -290,9 +290,9 @@ struct tfe_mgr* tfe_mgr_init(int tfe_node_count, const char* profile, void *logg
int ret; int ret;
//load keepalive conf //load keepalive conf
char section[KNI_SYMBOL_MAX] = "watch_dog"; char section[KNI_SYMBOL_MAX] = "watch_dog";
MESA_load_profile_int_def(profile, section, "keepalive_switch", &(mgr->keepalive_switch), 0); MESA_load_profile_int_def(profile, section, "switch", &(mgr->watch_dog_switch), 0);
KNI_LOG_ERROR(logger, "MESA_prof_load, [%s]:\n keepalive_switch: %d", section, mgr->keepalive_switch); KNI_LOG_ERROR(logger, "MESA_prof_load, [%s]:\n switch: %d", section, mgr->watch_dog_switch);
if(mgr->keepalive_switch == 0){ if(mgr->watch_dog_switch == 0){
return mgr; return mgr;
} }
int keepalive_idle, keepalive_cnt, keepalive_intvl; int keepalive_idle, keepalive_cnt, keepalive_intvl;
@@ -386,7 +386,7 @@ error_out:
int tfe_mgr_alive_node_get(struct tfe_mgr *mgr, int thread_seq){ int tfe_mgr_alive_node_get(struct tfe_mgr *mgr, int thread_seq){
int tfe_id = -1; int tfe_id = -1;
if(mgr->keepalive_switch == 0){ if(mgr->watch_dog_switch == 0){
if(mgr->tfe_enabled_node_count > 0){ if(mgr->tfe_enabled_node_count > 0){
int i = thread_seq % mgr->tfe_enabled_node_count; int i = thread_seq % mgr->tfe_enabled_node_count;
tfe_id = mgr->tfe_enabled_nodes[i].tfe_id; tfe_id = mgr->tfe_enabled_nodes[i].tfe_id;