pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/29846 )
Change subject: Rework tbf::update_ms()
......................................................................
Rework tbf::update_ms()
That function was pretty confusing since it used a "enum
gprs_rlcmac_tbf_direction dir" param (whose type is expected to describe
the data direction of a TBF) to describe the direction of the the packet
which triggered its call.
The parameter was actually always called with "GPRS_RLCMAC_UL_TBF" which
in this case meant "uplink direction" which meant "TLLI was updated from
the MS, not the SGSN".
The DL direction was only used in unit tests, which can hence be simply
replaced by ms_confirm_tlli(), which this commit does.
So this update_ms() function was actually used in practive in osmo-pcu
to trigger update of TLLI and find duplicates only when an RLCMAC block
(control or data) was received from the MS. Therefore, this function is
renamed in this patch and moved to the gprs_ms class, since it really
does nothing with the TBF.
Related: OS#5700
Change-Id: I1b7c0fde15b9bb8a973068994dbe972285ad0aff
---
M src/gprs_ms.c
M src/gprs_ms.h
M src/gprs_ms_storage.cpp
M src/gprs_ms_storage.h
M src/pdch.cpp
M src/tbf.cpp
M src/tbf.h
M src/tbf_ul.cpp
M tests/alloc/AllocTest.cpp
M tests/tbf/TbfTest.cpp
10 files changed, 64 insertions(+), 43 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/46/29846/1
diff --git a/src/gprs_ms.c b/src/gprs_ms.c
index be5b867..afdd249 100644
--- a/src/gprs_ms.c
+++ b/src/gprs_ms.c
@@ -23,6 +23,7 @@
#include "gprs_codel.h"
#include "pcu_utils.h"
#include "nacc_fsm.h"
+#include "gprs_ms_storage.h"
#include <time.h>
@@ -383,6 +384,32 @@
ms->imsi[0] = '\0';
}
+/* This function should be called on the MS object of a TBF each time an RLCMAC
+ * block is received for it with TLLI information.
+ * Besides updating the TLLI field on the MS object, it also seeks for other MS
+ * objects in the store and merges them into the current MS object. The MS
+ * duplication happened because we don't learn the TLLI of the created TBF until
+ * a later point. */
+void ms_update_announced_tlli(struct GprsMs *ms, uint32_t tlli)
+{
+ struct GprsMs *old_ms = NULL;
+
+ if (tlli == GSM_RESERVED_TMSI)
+ return;
+
+ /* When the TLLI does not match the ms, check if there is another
+ * MS object that belongs to that TLLI and if yes make sure one of them
+ * gets deleted. */
+ if (!ms_check_tlli(ms, tlli))
+ old_ms = ms_store_get_ms(bts_ms_store(ms->bts), tlli, GSM_RESERVED_TMSI, NULL);
+
+ ms_set_tlli(ms, tlli);
+
+ if (old_ms)
+ ms_merge_and_clear_ms(ms, old_ms);
+ /* old_ms may no longer be available here */
+}
+
/* Merge 'old_ms' object into 'ms' object.
* 'old_ms' may be freed during the call to this function, don't use the pointer to it afterwards */
void ms_merge_and_clear_ms(struct GprsMs *ms, struct GprsMs *old_ms)
diff --git a/src/gprs_ms.h b/src/gprs_ms.h
index cc92e2a..0726832 100644
--- a/src/gprs_ms.h
+++ b/src/gprs_ms.h
@@ -118,6 +118,7 @@
void ms_update_error_rate(struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, int error_rate);
uint8_t ms_current_pacch_slots(const struct GprsMs *ms);
+void ms_update_announced_tlli(struct GprsMs *ms, uint32_t tlli);
void ms_merge_and_clear_ms(struct GprsMs *ms, struct GprsMs *old_ms);
void ms_attach_tbf(struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf);
diff --git a/src/gprs_ms_storage.cpp b/src/gprs_ms_storage.cpp
index c9a41c9..58a4c53 100644
--- a/src/gprs_ms_storage.cpp
+++ b/src/gprs_ms_storage.cpp
@@ -109,3 +109,9 @@
return ms;
}
+
+
+struct GprsMs *ms_store_get_ms(struct GprsMsStorage *ms_store, uint32_t tlli, uint32_t old_tlli, const char *imsi)
+{
+ return ms_store->get_ms(tlli, old_tlli, imsi);
+}
\ No newline at end of file
diff --git a/src/gprs_ms_storage.h b/src/gprs_ms_storage.h
index ef808d0..c0176d3 100644
--- a/src/gprs_ms_storage.h
+++ b/src/gprs_ms_storage.h
@@ -23,6 +23,17 @@
struct gprs_rlcmac_bts;
+#ifdef __cplusplus
+extern "C" {
+#endif
+struct GprsMsStorage;
+struct GprsMs *ms_store_get_ms(struct GprsMsStorage *ms_store, uint32_t tlli, uint32_t old_tlli, const char *imsi);
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef __cplusplus
+
struct GprsMsStorage {
public:
GprsMsStorage(struct gprs_rlcmac_bts *bts);
@@ -38,3 +49,5 @@
struct gprs_rlcmac_bts *m_bts;
struct llist_head m_list; /* list of struct GprsMs */
};
+
+#endif
\ No newline at end of file
diff --git a/src/pdch.cpp b/src/pdch.cpp
index a5eb080..1a2f222 100644
--- a/src/pdch.cpp
+++ b/src/pdch.cpp
@@ -367,8 +367,8 @@
/* Reset N3101 counter: */
tbf->n_reset(N3101);
- tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF);
- /* Gather MS from TBF, since it may be NULL or may have been merged during update_ms */
+ ms_update_announced_tlli(tbf->ms(), tlli);
+ /* Gather MS from TBF again, since it may be NULL or may have been merged during ms_update_announced_tlli */
ms = tbf->ms();
LOGPTBF(tbf, LOGL_DEBUG, "FN=%" PRIu32 " Rx Packet Control Ack (reason=%s)\n",
diff --git a/src/tbf.cpp b/src/tbf.cpp
index cd273af..5d57687 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -213,29 +213,6 @@
ms_attach_tbf(m_ms, this);
}
-void gprs_rlcmac_tbf::update_ms(uint32_t tlli, enum gprs_rlcmac_tbf_direction dir)
-{
- GprsMs *old_ms = NULL;
-
- if (tlli == GSM_RESERVED_TMSI)
- return;
-
- /* When the TLLI does not match the ms, check if there is another
- * MS object that belongs to that TLLI and if yes make sure one of them
- * gets deleted. */
- if (!ms_check_tlli(ms(), tlli))
- old_ms = bts_ms_store(bts)->get_ms(tlli, GSM_RESERVED_TMSI, NULL);
-
- if (dir == GPRS_RLCMAC_UL_TBF)
- ms_set_tlli(ms(), tlli);
- else
- ms_confirm_tlli(ms(), tlli);
-
- if (old_ms)
- ms_merge_and_clear_ms(ms(), old_ms);
- /* old_ms may no longer be available here */
-}
-
static void tbf_unlink_pdch(struct gprs_rlcmac_tbf *tbf)
{
int ts;
diff --git a/src/tbf.h b/src/tbf.h
index 31bbe5f..ccc34ca 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -198,9 +198,6 @@
uint32_t tlli() const;
bool is_tlli_valid() const;
- /** MS updating */
- void update_ms(uint32_t tlli, enum gprs_rlcmac_tbf_direction);
-
uint8_t tfi() const;
bool is_tfi_assigned() const;
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index 21a7a76..66569f5 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -438,7 +438,7 @@
LOGPTBFUL(this, LOGL_INFO,
"Decoded premier TLLI=0x%08x of UL DATA TFI=%d.\n",
new_tlli, rlc->tfi);
- update_ms(new_tlli, GPRS_RLCMAC_UL_TBF);
+ ms_update_announced_tlli(ms(), new_tlli);
bts_pch_timer_stop(bts, ms());
} else if (new_tlli != GSM_RESERVED_TMSI && new_tlli != tlli()) {
LOGPTBFUL(this, LOGL_NOTICE,
diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp
index b5d4b95..0ecc5bd 100644
--- a/tests/alloc/AllocTest.cpp
+++ b/tests/alloc/AllocTest.cpp
@@ -269,7 +269,7 @@
if (!dl_tbf)
return false;
- dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF);
+ ms_confirm_tlli(ms, 0x23);
OSMO_ASSERT(dl_tbf->ms() == ms);
OSMO_ASSERT(ms_current_trx(dl_tbf->ms()));
@@ -279,7 +279,7 @@
if (!ul_tbf)
return false;
- ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF);
+ ms_update_announced_tlli(ms, 0x23);
ul_tbf->m_contention_resolution_done = 1;
dump_assignment(ul_tbf, "UL", verbose);
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index ff56e6f..f929fb7 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -126,7 +126,7 @@
gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(bts,
ms, 0, false);
OSMO_ASSERT(dl_tbf != NULL);
- dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF);
+ ms_confirm_tlli(ms, 0x2342);
dl_tbf->set_ta(4);
OSMO_ASSERT(ms_dl_tbf(ms) == dl_tbf);
OSMO_ASSERT(dl_tbf->ms() == ms);
@@ -134,7 +134,7 @@
gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(bts,
ms, 0, false);
OSMO_ASSERT(ul_tbf != NULL);
- ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF);
+ ms_update_announced_tlli(ms, 0x2342);
OSMO_ASSERT(ms_ul_tbf(ms) == ul_tbf);
OSMO_ASSERT(ul_tbf->ms() == ms);
@@ -144,7 +144,7 @@
* Now check.. that DL changes and that the timing advance
* has changed.
*/
- dl_tbf->update_ms(0x4232, GPRS_RLCMAC_DL_TBF);
+ ms_confirm_tlli(dl_tbf->ms(), 0x4232);
/* It is still there, since the new TLLI has not been used for UL yet */
ms_new = bts_ms_by_tlli(bts, 0x2342, GSM_RESERVED_TMSI);
@@ -156,7 +156,7 @@
OSMO_ASSERT(ms_ul_tbf(ms) == ul_tbf);
/* Now use the new TLLI for UL */
- ul_tbf->update_ms(0x4232, GPRS_RLCMAC_UL_TBF);
+ ms_update_announced_tlli(ms, 0x4232);
ms_new = bts_ms_by_tlli(bts, 0x2342, GSM_RESERVED_TMSI);
OSMO_ASSERT(ms_new == NULL);
@@ -305,7 +305,7 @@
setup_bts(bts, ts_no);
dl_tbf = create_dl_tbf(bts, ms_class, 0, &trx_no);
- dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF);
+ ms_confirm_tlli(dl_tbf->ms(), tlli);
ms = dl_tbf->ms();
for (i = 0; i < sizeof(llc_data); i++)
@@ -381,7 +381,7 @@
OSMO_ASSERT(osmo_tdef_set(the_pcu->T_defs, -2031, 200, OSMO_TDEF_MS) == 0);
dl_tbf = create_dl_tbf(bts, ms_class, 0, &trx_no);
- dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF);
+ ms_confirm_tlli(dl_tbf->ms(), tlli);
for (i = 0; i < sizeof(llc_data); i++)
llc_data[i] = i%256;
@@ -446,8 +446,8 @@
dl_tbf[0] = create_dl_tbf(bts, ms_class, 0, &trx_no);
dl_tbf[1] = create_dl_tbf(bts, ms_class, 0, &trx_no);
- dl_tbf[0]->update_ms(0xf1000001, GPRS_RLCMAC_DL_TBF);
- dl_tbf[1]->update_ms(0xf1000002, GPRS_RLCMAC_DL_TBF);
+ ms_confirm_tlli(dl_tbf[0]->ms(), 0xf1000001);
+ ms_confirm_tlli(dl_tbf[1]->ms(), 0xf1000002);
ms_set_imsi(dl_tbf[0]->ms(), "001001000000001");
ms1 = bts_ms_store(bts)->get_ms(GSM_RESERVED_TMSI, GSM_RESERVED_TMSI, "001001000000001");
@@ -2604,7 +2604,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
dl_tbf = create_dl_tbf(bts, ms_class, egprs_ms_class, &trx_no);
- dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF);
+ ms_confirm_tlli(dl_tbf->ms(), tlli);
prlcdlwindow = static_cast<gprs_rlc_dl_window *>(dl_tbf->window());
prlcmvb = &prlcdlwindow->m_v_b;
prlcdlwindow->m_v_s = 1288;
@@ -2737,7 +2737,7 @@
bts->initial_mcs_dl = mcs;
dl_tbf = create_dl_tbf(bts, ms_class, egprs_ms_class, &trx_no);
- dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF);
+ ms_confirm_tlli(dl_tbf->ms(), tlli);
for (i = 0; i < sizeof(llc_data); i++)
llc_data[i] = i%256;
@@ -2794,7 +2794,7 @@
bts->initial_mcs_dl = mcs;
dl_tbf = create_dl_tbf(bts, ms_class, egprs_ms_class, &trx_no);
- dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF);
+ ms_confirm_tlli(dl_tbf->ms(), tlli);
for (i = 0; i < sizeof(test_data); i++)
test_data[i] = i%256;
@@ -3314,7 +3314,7 @@
setup_bts(bts, 4);
static gprs_rlcmac_dl_tbf *dl_tbf = tbf_init(bts, 1);
- dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF);
+ ms_confirm_tlli(dl_tbf->ms(), tlli);
osmo_fsm_inst_dispatch(dl_tbf->ul_ass_fsm.fi, TBF_UL_ASS_EV_SCHED_ASS_REJ, NULL);
struct msgb *msg = tbf_ul_ass_create_rlcmac_msg((const struct gprs_rlcmac_tbf*)dl_tbf, 0, 0);
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/29846
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I1b7c0fde15b9bb8a973068994dbe972285ad0aff
Gerrit-Change-Number: 29846
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: osmith.
msuraev has posted comments on this change. ( https://gerrit.osmocom.org/c/docker-playground/+/29840 )
Change subject: osmo-ggsn-master: split RUN command
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
> While it looks better, this takes much longer to execute. […]
I think it's a wrong place for optimisations. If we're time-constrained the first thing we should try is enabling BuildKit https://github.com/moby/buildkit - see https://docs.docker.com/develop/develop-images/build_enhancements/#to-enabl… for docker-specific config.
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/29840
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I014cb5499820a26b46714fee1a55381e9013cdad
Gerrit-Change-Number: 29840
Gerrit-PatchSet: 1
Gerrit-Owner: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 21 Oct 2022 16:13:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: osmith, neels.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29837 )
Change subject: BSC: add TC_ho_meas_rep_multi_band
......................................................................
Patch Set 3:
(1 comment)
File bsc/BSC_Tests.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29837/comment/09a11553_aefe…
PS2, Line 11987: * correctly, the third entry has LAC 97. Before this was fixed, the
> Done
waiting for this to be resolved then before +1.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29837
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I4fe6bb9e4b5a69ea6204585ebdf1f157a68a8286
Gerrit-Change-Number: 29837
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 21 Oct 2022 15:07:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: osmith.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/29842 )
Change subject: contrib/jenkins.sh: set PYTHONUNBUFFERED=1
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
why is this needed?
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/29842
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I5d334bbc34e4df39ac54472642299c567894f449
Gerrit-Change-Number: 29842
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 21 Oct 2022 15:04:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: neels, pespin.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29837 )
Change subject: BSC: add TC_ho_meas_rep_multi_band
......................................................................
Patch Set 3:
(2 comments)
File bsc/BSC_Tests.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29837/comment/c42279df_b49e…
PS2, Line 11987: * correctly, the third entry has LAC 97. Before this was fixed, the
> Better drop the "before" references completely, that's mostly adding information about wrong behavio […]
Done
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29837/comment/a7f141c5_a08d…
PS2, Line 12013: f_bts_0_cfg(BSCVTY,
> don't you need to reset this at some point?
Good question. I've copied most of this test from TC_ho_out_of_this_bsc and adjusted it, so if that cleans up properly, this test should too. But I don't see where it resets the bts 0 cfg, maybe it is missing there as well. Maybe Neels can comment on this?
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29837
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I4fe6bb9e4b5a69ea6204585ebdf1f157a68a8286
Gerrit-Change-Number: 29837
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 21 Oct 2022 14:52:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment