Attention is currently required from: neels, pespin, daniel.
Hello osmith, Jenkins Builder, neels, laforge, daniel,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bsc/+/31940
to look at the new patch set (#2).
Change subject: Fix Lb/A SCCP conn lookup after recent regression in optimization patch ......................................................................
Fix Lb/A SCCP conn lookup after recent regression in optimization patch
In osmo-bsc, there's currently 0..1 Lb links and 0..N A links, where N is the number of MSC, but links can be shared in the underlaying stack (struct osmo_sccp_instance), hence range 0..N of different osmo_sccp_instance (identified by PC). Even more, the Lb and A link can share the same underlaying stack, so osmo-bsc can end up with only 1 struct osmo_sccp_instance shared by all the above mentioned links in case all are configured under the same PC. Total range A+Lb is 0..(1+N).
A struct gsm_subscriber_conn stores 2 struct sccp_instance*, one for Lb (conn->lcs.lb.*)and one for A (conn->sccp.*). They can actually point to the same sccp_instance or to different ones, as explained above, depending on the configured setup. In any case, a gsm_subscriber_conn needs 2 rb_nodes since it can hold any of the 2 conn_ids independently (A or Lb).
The previous patch forgot to add that 2nd rb_node as well as some initialization and release code for the Lb conn. This patch addresses that.
When the 2nd rb_node, a problem when iterating the rbtree appears: how to find out the "conn" pointer from the rb_node pointer, since the rb_node pointer can be any of the 2 rb_nodes inside the struct at a different offsets.
In order to solve that problem, a new struct bscp_sccp_conn_node is added, which holds all the relevant information used by the rbtree lookup code in a generic way (rb_node and conn_id), plus a backpointer to the struct bsc_gsm_subcriber it relates too.
Fixes: 85062ccad31e9fb73e0256a5ee556c6ae0a16449 Change-Id: If42d93adee71d646766929a09bc01ae92b734ef3 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/bsc_sccp.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lb.c M src/osmo-bsc/lchan_rtp_fsm.c M src/osmo-bsc/osmo_bsc_sigtran.c M tests/bsc/bsc_test.c 9 files changed, 111 insertions(+), 54 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/40/31940/2