dexter has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30864 )
Change subject: bts: use GSM_TDMA_FN_ macros and uint32_t in bts_rfn_to_fn
......................................................................
bts: use GSM_TDMA_FN_ macros and uint32_t in bts_rfn_to_fn
The function bts_rfn_to_fn() uses int32_t for its internal variables and
the input parameter rfn while the callers and everything outside uses
uint32_t to store frame numbers. Lets convert this to uint32_t and use
GSM_TDMA_FN_ macros wherever possible.
Change-Id: Iedd493bb30dd1c342dec031883060c545432e740
Related: OS#5198
---
M src/bts.cpp
M src/bts.h
2 files changed, 11 insertions(+), 14 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
diff --git a/src/bts.cpp b/src/bts.cpp
index 650d4a3..d5d814d 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -716,15 +716,14 @@
}
/* Determine the full frame number from a relative frame number */
-uint32_t bts_rfn_to_fn(const struct gprs_rlcmac_bts *bts, int32_t rfn)
+uint32_t bts_rfn_to_fn(const struct gprs_rlcmac_bts *bts, uint32_t rfn)
{
- int32_t m_cur_rfn;
- int32_t fn;
- int32_t fn_rounded;
+ uint32_t m_cur_rfn;
+ uint32_t fn_rounded;
- /* double-check that relative FN is not negative and fits into int32_t */
+ /* make sure RFN does not exceed the maximum possible value of a valid
+ * GSM frame number. */
OSMO_ASSERT(rfn < GSM_MAX_FN);
- OSMO_ASSERT(rfn >= 0);
/* Note: If a BTS is sending in a rach request it will be fully aware
* of the frame number. If the PCU is used in a BSC-co-located setup.
@@ -744,13 +743,13 @@
/* Compute a "rounded" version of the internal frame number, which
* exactly fits in the RFN_MODULUS raster */
- fn_rounded = bts->cur_fn - m_cur_rfn;
+ fn_rounded = GSM_TDMA_FN_SUB(bts->cur_fn, m_cur_rfn);
/* If the delta between the internal and the external relative frame
* number exceeds a certain limit, we need to assume that the incoming
* rach request belongs to a the previous rfn period. To correct this,
* we roll back the rounded frame number by one RFN_MODULUS */
- if (abs(rfn - m_cur_rfn) > RFN_THRESHOLD) {
+ if (GSM_TDMA_FN_DIFF(rfn, m_cur_rfn) > RFN_THRESHOLD) {
LOGP(DRLCMAC, LOGL_DEBUG,
"Race condition between rfn (%u) and m_cur_fn (%u) detected: rfn belongs to the previous modulus %u cycle, wrapping...\n",
rfn, bts->cur_fn, RFN_MODULUS);
@@ -758,17 +757,15 @@
LOGP(DRLCMAC, LOGL_DEBUG,
"Cornercase detected: wrapping crosses %u border\n",
GSM_MAX_FN);
- fn_rounded = GSM_MAX_FN - (RFN_MODULUS - fn_rounded);
+ fn_rounded = GSM_TDMA_FN_SUB(GSM_MAX_FN, (GSM_TDMA_FN_SUB(RFN_MODULUS, fn_rounded)));
}
else
- fn_rounded -= RFN_MODULUS;
+ fn_rounded = GSM_TDMA_FN_SUB(fn_rounded, RFN_MODULUS);
}
/* The real frame number is the sum of the rounded frame number and the
* relative framenumber computed via RACH */
- fn = fn_rounded + rfn;
-
- return fn;
+ return GSM_TDMA_FN_SUM(fn_rounded, rfn);
}
/* 3GPP TS 44.060:
diff --git a/src/bts.h b/src/bts.h
index 085b448..61c5e43 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -296,7 +296,7 @@
struct GprsMs *bts_alloc_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class, uint8_t egprs_ms_class);
int bts_add_paging(struct gprs_rlcmac_bts *bts, const struct paging_req_cs *req, struct GprsMs *ms);
-uint32_t bts_rfn_to_fn(const struct gprs_rlcmac_bts *bts, int32_t rfn);
+uint32_t bts_rfn_to_fn(const struct gprs_rlcmac_bts *bts, uint32_t rfn);
struct gprs_rlcmac_dl_tbf *bts_dl_tbf_by_tfi(struct gprs_rlcmac_bts *bts, uint8_t tfi, uint8_t trx, uint8_t ts);
struct gprs_rlcmac_ul_tbf *bts_ul_tbf_by_tfi(struct gprs_rlcmac_bts *bts, uint8_t tfi, uint8_t trx, uint8_t ts);
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30864
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Iedd493bb30dd1c342dec031883060c545432e740
Gerrit-Change-Number: 30864
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: pespin.
Hello Jenkins Builder, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-upf/+/30831
to look at the new patch set (#3).
Change subject: tunend: choose local GTP addr by Network Instance IEs
......................................................................
tunend: choose local GTP addr by Network Instance IEs
Implement handling of the Network Instance IEs from PFCP for tunend,
like already done for tunmap.
In 'tunend' cfg, allow indicating a local GTP address for both 'dev
create' and 'dev use'. Select a GTP device by the local address the
Network Instance IE in PFCP PDR indicates.
Related: SYS#6192
Change-Id: I376c09bfc1844df1e61d2efac17561fac614858b
---
M include/osmocom/upf/upf_gtp.h
M src/osmo-upf/up_gtp_action.c
M src/osmo-upf/upf_gtp.c
M src/osmo-upf/upf_vty.c
M tests/upf.vty
5 files changed, 64 insertions(+), 27 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/31/30831/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/30831
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I376c09bfc1844df1e61d2efac17561fac614858b
Gerrit-Change-Number: 30831
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/30831 )
Change subject: tunend: choose local GTP addr by Network Instance IEs
......................................................................
Patch Set 2:
(2 comments)
File src/osmo-upf/upf_vty.c:
https://gerrit.osmocom.org/c/osmo-upf/+/30831/comment/3e6fe394_20aa0221
PS2, Line 156: " and GTPv0 port " OSMO_STRINGIFY_VAL(PORT_GTP0_U) " on the specified LISTEN_ADDR\n"
> Ah I see you mention GTPv1 on top. […]
I assume for osmo-upf GTPv0 is not interesting or required or intended. But gtp_dev_create() to make a GTP kernel device wants an fd0 argument
https://gitea.osmocom.org/cellular-infrastructure/libgtpnl/src/branch/maste…
so GTPv0 crept into osmo-upf, halfheartedly
https://gerrit.osmocom.org/c/osmo-upf/+/30831/comment/c1da57fd_289dc5d0
PS2, Line 159: " "
drop (note to self)
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/30831
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I376c09bfc1844df1e61d2efac17561fac614858b
Gerrit-Change-Number: 30831
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 05 Jan 2023 23:18:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30891 )
Change subject: Move sgsn_pdp_ctx to its own file pdpctx.{c,h}
......................................................................
Move sgsn_pdp_ctx to its own file pdpctx.{c,h}
This further shrinks the mess in gprs_sgsn.h, and allows to easily see
layer violations (like pdpctx.c requiring llc.h)
Change-Id: Iad4da06efee7d8514ff48423bdaebc0f26413cc1
---
M include/osmocom/sgsn/Makefile.am
M include/osmocom/sgsn/gprs_sgsn.h
A include/osmocom/sgsn/pdpctx.h
M include/osmocom/sgsn/sgsn.h
M src/sgsn/Makefile.am
M src/sgsn/gprs_gmm.c
M src/sgsn/gprs_mm_state_iu_fsm.c
M src/sgsn/gprs_ranap.c
M src/sgsn/gprs_sgsn.c
M src/sgsn/gprs_sm.c
M src/sgsn/gtp_ggsn.c
A src/sgsn/pdpctx.c
M src/sgsn/sgsn_cdr.c
M src/sgsn/sgsn_ctrl.c
M src/sgsn/sgsn_libgtp.c
M src/sgsn/sgsn_vty.c
M tests/sgsn/Makefile.am
17 files changed, 272 insertions(+), 193 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/91/30891/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30891
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Iad4da06efee7d8514ff48423bdaebc0f26413cc1
Gerrit-Change-Number: 30891
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newpatchset