From 5bd84491b80278a6e46e00b1c50ef02194232bd6 Mon Sep 17 00:00:00 2001 From: Neels Janosch Hofmeyr Date: Sat, 11 Feb 2023 01:08:07 +0100 Subject: [PATCH] cosmetic: clarify session active / partially active semantics Change-Id: I2db85b3ffd61cbf8fb404b17ee3b6593d1d189c4 --- src/osmo-upf/up_session.c | 5 +++++ src/osmo-upf/upf_vty.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/osmo-upf/up_session.c b/src/osmo-upf/up_session.c index 593f131..1438cce 100644 --- a/src/osmo-upf/up_session.c +++ b/src/osmo-upf/up_session.c @@ -1529,11 +1529,16 @@ static enum osmo_pfcp_cause up_session_setup_gtp(struct up_session *session) 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 @@ DEFUN(show_session, show_session_cmd, } } } - 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; }