pespin has submitted this change. (
https://gerrit.osmocom.org/c/libosmo-sigtran/+/42533?usp=email )
Change subject: handle_rkey_dereg(): Optimize lookup
......................................................................
handle_rkey_dereg(): Optimize lookup
Instead of looking up on all AS configured in an instance, look up on
the subset associated to the ASP we are looking up for.
Since we are also not looking a 2nd pass to then validate if ASP and
returned AS is related, in worst case this would split lookup complexity
by half.
Change-Id: I56ac5caef9bcded9dd08ca532a413af94070a1bd
---
M src/xua_rkm.c
1 file changed, 1 insertion(+), 7 deletions(-)
Approvals:
pespin: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index e9972b3..f3136e4 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -401,7 +401,7 @@
struct osmo_ss7_as *as;
struct osmo_ss7_route *rt;
- as = osmo_ss7_as_find_by_rctx(inst, rctx);
+ as = ss7_asp_find_as_by_rctx(asp, rctx);
if (!as) {
msgb_append_dereg_res(resp, M3UA_RKM_DEREG_ERR_INVAL_RCTX, 0);
return -1;
@@ -413,12 +413,6 @@
return -1;
}
- /* Reject if ASP is not even part of AS */
- if (!osmo_ss7_as_has_asp(as, asp)) {
- msgb_append_dereg_res(resp, M3UA_RKM_DEREG_ERR_INVAL_RCTX, 0);
- return -1;
- }
-
/* Reject if ASP is still active */
if (asp->fi->state == XUA_ASP_S_ACTIVE) {
msgb_append_dereg_res(resp, M3UA_RKM_DEREG_ERR_ASP_ACTIVE, 0);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42533?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I56ac5caef9bcded9dd08ca532a413af94070a1bd
Gerrit-Change-Number: 42533
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>