neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-upf/+/31486 )
Change subject: cosmetic: clarify session active / partially active semantics ......................................................................
cosmetic: clarify session active / partially active semantics
Change-Id: I2db85b3ffd61cbf8fb404b17ee3b6593d1d189c4 --- M src/osmo-upf/up_session.c M src/osmo-upf/upf_vty.c 2 files changed, 15 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/86/31486/1
diff --git a/src/osmo-upf/up_session.c b/src/osmo-upf/up_session.c index 4700675..7505858 100644 --- a/src/osmo-upf/up_session.c +++ b/src/osmo-upf/up_session.c @@ -1526,11 +1526,16 @@ return cause; }
+/* Return true when the session is in Established state and has active GTP actions. */ bool up_session_is_active(struct up_session *session) { return session && (session->fi->state == UP_SESSION_ST_ESTABLISHED) && !llist_empty(&session->active_gtp_actions); }
+/* Return true when up_session_is_active() == true *and* it has only active PDR/FAR pairs. + * A PDR/FAR is inactive when it is not part of an active GTP action. Reasons may be that it has no PDR-to-FAR relation, + * there is no matching reverse PDR/FAR, that a FAR is not set to FORW, an ignored Source/Destination Interface, ... + */ bool up_session_is_fully_active(struct up_session *session, int *active_p, int *inactive_p) { struct pdr *pdr; diff --git a/src/osmo-upf/upf_vty.c b/src/osmo-upf/upf_vty.c index 4a76439..44d14db 100644 --- a/src/osmo-upf/upf_vty.c +++ b/src/osmo-upf/upf_vty.c @@ -481,7 +481,7 @@ } } } - vty_out(vty, "(%d fully-active + %d partially active + %d inactive)%s", + vty_out(vty, "(%d fully-active + %d active with some PDR/FAR ignored + %d inactive)%s", fully_active_count, active_count, inactive_count, VTY_NEWLINE); return CMD_SUCCESS; }