From d67966b43e1a13f1993ab7643931ea9df5bea5fd Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 21 Feb 2024 17:20:52 +0100 Subject: [PATCH] ipa_keepalive: Make FSM a bit less quiet Let's make sure we log meaningful log messages whenever an IPA keepalive FSM is started, stopped or if it times out. This allows the user to observe whether IPA keepalive is actually enabled (using what timeout), and also to learn why exactly the connection was dropped. Change-Id: Iad20b86f893c1036affaf14f978099fa858a0031 Related: SYS#6801 --- src/input/ipa_keepalive.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/input/ipa_keepalive.c b/src/input/ipa_keepalive.c index 7fc28f1..de68879 100644 --- a/src/input/ipa_keepalive.c +++ b/src/input/ipa_keepalive.c @@ -147,6 +147,7 @@ static int ipa_ka_fsm_timer_cb(struct osmo_fsm_inst *fi) ifp->params.wait_for_resp, T_PONG_NOT_RECEIVED); return 0; case T_PONG_NOT_RECEIVED: + LOGPFSML(fi, LOGL_NOTICE, "IPA keep-alive FSM timed out: PONG not received\n"); /* PONG not received within time */ if (ifp->srv_conn) conn = ifp->srv_conn; @@ -320,7 +321,10 @@ void ipa_keepalive_fsm_pong_received(struct osmo_fsm_inst *fi) /*! Start the ping/pong procedure of the IPA Keepalive FSM. */ void ipa_keepalive_fsm_start(struct osmo_fsm_inst *fi) { + struct ipa_fsm_priv *ifp = fi->priv; OSMO_ASSERT(fi->fsm == &ipa_keepalive_fsm); + LOGPFSML(fi, LOGL_INFO, "Starting IPA keep-alive FSM (interval=%us wait=%us)\n", + ifp->params.interval, ifp->params.wait_for_resp); osmo_fsm_inst_dispatch(fi, OSMO_IPA_KA_E_START, NULL); } @@ -328,5 +332,6 @@ void ipa_keepalive_fsm_start(struct osmo_fsm_inst *fi) void ipa_keepalive_fsm_stop(struct osmo_fsm_inst *fi) { OSMO_ASSERT(fi->fsm == &ipa_keepalive_fsm); + LOGPFSML(fi, LOGL_INFO, "Stopping IPA keep-alive FSM\n"); osmo_fsm_inst_dispatch(fi, OSMO_IPA_KA_E_STOP, NULL); }