lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

August 2023

  • 1 participants
  • 1514 discussions
[M] Change in ...osmo_dia2gsup[master]: README.md: update
by osmith 24 Aug '23

24 Aug '23
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/34196 to look at the new patch set (#2). Change subject: README.md: update ...................................................................... README.md: update Fix the broken formatting (wrong headlines, missing line breaks in blocks of commands) and move the configuration and escript sections below the running section. Add the command that fixeria suggested for running it with one shell command. Old: https://gitea.osmocom.org/erlang/osmo_dia2gsup/src/branch/master/README.md New: https://gitea.osmocom.org/osmith/osmo_dia2gsup/src/branch/master/README.md Change-Id: Ib96f42ca0066ba2f6d0d783f6bf1764cbfee544f --- M README.md 1 file changed, 39 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo_dia2gsup refs/changes/96/34196/2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/34196 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo_dia2gsup Gerrit-Branch: master Gerrit-Change-Id: Ib96f42ca0066ba2f6d0d783f6bf1764cbfee544f Gerrit-Change-Number: 34196 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in ...osmo_dia2gsup[master]: README.md: fix markdown formatting
by osmith 24 Aug '23

24 Aug '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/34196 ) Change subject: README.md: fix markdown formatting ...................................................................... README.md: fix markdown formatting Fix the broken formatting (wrong headlines, missing line breaks in blocks of commands) and move the configuration and escript sections below the running section. Old: https://gitea.osmocom.org/erlang/osmo_dia2gsup/src/branch/master/README.md New: https://gitea.osmocom.org/osmith/osmo_dia2gsup/src/branch/master/README.md Change-Id: Ib96f42ca0066ba2f6d0d783f6bf1764cbfee544f --- M README.md 1 file changed, 30 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo_dia2gsup refs/changes/96/34196/1 diff --git a/README.md b/README.md index 3177caf..bd8af46 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,45 @@ -= Osmocom DIAMETER -> GSUP translator = +# Osmocom DIAMETER -> GSUP translator This project implements a proxy translating Diameter into GSUP, hence allowing Diameter clients connecting to GSUP server. This allows, for instance, using OsmoHLR as an HSS used by 4G/5G nodes. -== Building == +## Building Install erlang and rebar3 packages (not "rebar", that's version 2! You may need to compile it from source in some distros). +``` $ rebar3 compile $ rebar3 escriptize +``` -== Testing == +## Testing Unit tests can be run this way: +``` $ rebar3 eunit +``` -== Running == +## Running Once osmo\_dia2gsup is built, you can start it this way: +``` $ rebar3 shell - -In the erlang shell: -``` 1> osmo_dia2gsup:start(). ``` -== Configuration == +Passing a config file: +``` $ rebar3 shell --config ./examples/sys.config -``` 1> osmo_dia2gsup:start(). ``` -== Run as an escript == +Running it as an escript in one shell command: +``` $ rebar3 escriptize $ ERL_FLAGS='-config ./examples/sys.config' _build/default/bin/osmo-dia2gsup - +``` -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/34196 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo_dia2gsup Gerrit-Branch: master Gerrit-Change-Id: Ib96f42ca0066ba2f6d0d783f6bf1764cbfee544f Gerrit-Change-Number: 34196 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in ...osmo_dia2gsup[master]: README.md: Document how to run escript with config file
by pespin 24 Aug '23

24 Aug '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/34195 ) Change subject: README.md: Document how to run escript with config file ...................................................................... README.md: Document how to run escript with config file Change-Id: Icc78f4bd22608ad0c8a2c5f6095cd77543ab2048 --- M README.md 1 file changed, 14 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, approved diff --git a/README.md b/README.md index 4b52070..3177caf 100644 --- a/README.md +++ b/README.md @@ -35,3 +35,8 @@ 1> osmo_dia2gsup:start(). ``` +== Run as an escript == + +$ rebar3 escriptize +$ ERL_FLAGS='-config ./examples/sys.config' _build/default/bin/osmo-dia2gsup + -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/34195 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo_dia2gsup Gerrit-Branch: master Gerrit-Change-Id: Icc78f4bd22608ad0c8a2c5f6095cd77543ab2048 Gerrit-Change-Number: 34195 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in ...osmo_dia2gsup[master]: README.md: Document how to run escript with config file
by osmith 24 Aug '23

24 Aug '23
Attention is currently required from: pespin, fixeria, daniel. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/34195 ) Change subject: README.md: Document how to run escript with config file ...................................................................... Patch Set 1: Code-Review+2 (1 comment) Patchset: PS1: Thanks for documenting this! The formatting of the whole file is weird, I'll prepare a follow-up patch to fix it: https://gitea.osmocom.org/erlang/osmo_dia2gsup/src/branch/master/README.md -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/34195 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo_dia2gsup Gerrit-Branch: master Gerrit-Change-Id: Icc78f4bd22608ad0c8a2c5f6095cd77543ab2048 Gerrit-Change-Number: 34195 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Thu, 24 Aug 2023 14:52:28 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in ...osmo_dia2gsup[master]: README.md: Document how to run escript with config file
by pespin 24 Aug '23

24 Aug '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/34195 ) Change subject: README.md: Document how to run escript with config file ...................................................................... README.md: Document how to run escript with config file Change-Id: Icc78f4bd22608ad0c8a2c5f6095cd77543ab2048 --- M README.md 1 file changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo_dia2gsup refs/changes/95/34195/1 diff --git a/README.md b/README.md index 4b52070..3177caf 100644 --- a/README.md +++ b/README.md @@ -35,3 +35,8 @@ 1> osmo_dia2gsup:start(). ``` +== Run as an escript == + +$ rebar3 escriptize +$ ERL_FLAGS='-config ./examples/sys.config' _build/default/bin/osmo-dia2gsup + -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/34195 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo_dia2gsup Gerrit-Branch: master Gerrit-Change-Id: Icc78f4bd22608ad0c8a2c5f6095cd77543ab2048 Gerrit-Change-Number: 34195 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: osmo_io: Add iofd_handle_recv()
by daniel 24 Aug '23

24 Aug '23
daniel has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/34184 ) Change subject: osmo_io: Add iofd_handle_recv() ...................................................................... osmo_io: Add iofd_handle_recv() Handle msg reception in a common function that can be called from the different backends. Change-Id: Ifc407d446805f885d37767f421ff710cb276a01f --- M src/core/osmo_io.c M src/core/osmo_io_internal.h M src/core/osmo_io_poll.c 3 files changed, 30 insertions(+), 12 deletions(-) Approvals: daniel: Looks good to me, approved fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index db1b5ad..5fed19e 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -302,6 +302,22 @@ iofd->pending = pending; } +void iofd_handle_recv(struct osmo_io_fd *iofd, struct msgb *msg, int rc, struct iofd_msghdr *hdr) +{ + switch (iofd->mode) { + case OSMO_IO_FD_MODE_READ_WRITE: + iofd_handle_segmented_read(iofd, msg, rc); + break; + case OSMO_IO_FD_MODE_RECVFROM_SENDTO: + iofd->io_ops.recvfrom_cb(iofd, rc, msg, &hdr->osa); + break; + case OSMO_IO_FD_MODE_SCTP_RECVMSG_SENDMSG: + /* TODO Implement */ + OSMO_ASSERT(false); + break; + } +} + /* Public functions */ /*! Send a message through a connected socket. diff --git a/src/core/osmo_io_internal.h b/src/core/osmo_io_internal.h index d45b161..0f0465d 100644 --- a/src/core/osmo_io_internal.h +++ b/src/core/osmo_io_internal.h @@ -133,6 +133,7 @@ struct msgb *iofd_msgb_pending(struct osmo_io_fd *iofd); struct msgb *iofd_msgb_pending_or_alloc(struct osmo_io_fd *iofd); +void iofd_handle_recv(struct osmo_io_fd *iofd, struct msgb *msg, int rc, struct iofd_msghdr *msghdr); void iofd_handle_segmented_read(struct osmo_io_fd *iofd, struct msgb *msg, int rc); int iofd_txqueue_enqueue(struct osmo_io_fd *iofd, struct iofd_msghdr *msghdr); diff --git a/src/core/osmo_io_poll.c b/src/core/osmo_io_poll.c index 77a741a..c230188 100644 --- a/src/core/osmo_io_poll.c +++ b/src/core/osmo_io_poll.c @@ -67,18 +67,7 @@ if (rc > 0) msgb_put(msg, rc); - switch (iofd->mode) { - case OSMO_IO_FD_MODE_READ_WRITE: - iofd_handle_segmented_read(iofd, msg, rc); - break; - case OSMO_IO_FD_MODE_RECVFROM_SENDTO: - iofd->io_ops.recvfrom_cb(iofd, rc, msg, &hdr.osa); - break; - case OSMO_IO_FD_MODE_SCTP_RECVMSG_SENDMSG: - /* TODO Implement */ - OSMO_ASSERT(false); - break; - } + iofd_handle_recv(iofd, msg, rc, &hdr); } if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED)) -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34184 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ifc407d446805f885d37767f421ff710cb276a01f Gerrit-Change-Number: 34184 Gerrit-PatchSet: 2 Gerrit-Owner: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmocore[master]: osmo_io: Add iofd_handle_recv()
by daniel 24 Aug '23

24 Aug '23
daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/34184 ) Change subject: osmo_io: Add iofd_handle_recv() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34184 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ifc407d446805f885d37767f421ff710cb276a01f Gerrit-Change-Number: 34184 Gerrit-PatchSet: 1 Gerrit-Owner: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 24 Aug 2023 14:46:49 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmocom-bb[master]: l1gprs: Improve logging fn and tn in BLOCK.req
by pespin 24 Aug '23

24 Aug '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/34141 ) ( 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: l1gprs: Improve logging fn and tn in BLOCK.req ...................................................................... l1gprs: Improve logging fn and tn in BLOCK.req Change-Id: Iba29d88770e79fee0e4ac3c8f4e833907afa5b52 --- M src/shared/l1gprs.c 1 file changed, 17 insertions(+), 5 deletions(-) Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/shared/l1gprs.c b/src/shared/l1gprs.c index a9a6228..e4c1fc7 100644 --- a/src/shared/l1gprs.c +++ b/src/shared/l1gprs.c @@ -625,6 +625,7 @@ const struct l1ctl_gprs_ul_block_req *l1br = (void *)msg->l1h; const struct l1gprs_pdch *pdch = NULL; size_t data_len; + uint32_t fn; OSMO_ASSERT(l1br != NULL); @@ -634,10 +635,11 @@ msgb_l1len(msg), sizeof(*l1br)); return -EINVAL; } + fn = ntohl(l1br->hdr.fn); if (OSMO_UNLIKELY(l1br->hdr.tn >= ARRAY_SIZE(gprs->pdch))) { LOGP_GPRS(gprs, LOGL_ERROR, - "Rx malformed UL BLOCK.req (tn=%u)\n", - l1br->hdr.tn); + "Rx malformed UL BLOCK.req (fn=%u, tn=%u)\n", + fn, l1br->hdr.tn); return -EINVAL; } @@ -646,17 +648,18 @@ LOGP_PDCH(pdch, LOGL_DEBUG, "Rx UL BLOCK.req (fn=%u, len=%zu): %s\n", - ntohl(l1br->hdr.fn), data_len, osmo_hexdump(l1br->data, data_len)); + fn, data_len, osmo_hexdump(l1br->data, data_len)); if ((pdch->ul_tbf_count == 0) && (pdch->dl_tbf_count == 0)) { LOGP_PDCH(pdch, LOGL_ERROR, - "Rx UL BLOCK.req, but this PDCH has no configured TBFs\n"); + "Rx UL BLOCK.req (fn=%u, len=%zu), but this PDCH has no configured TBFs\n", + fn, data_len); return -EINVAL; } *req = (struct l1gprs_prim_ul_block_req) { .hdr = { - .fn = ntohl(l1br->hdr.fn), + .fn = fn, .tn = l1br->hdr.tn, }, .data = &l1br->data[0], -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34141 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iba29d88770e79fee0e4ac3c8f4e833907afa5b52 Gerrit-Change-Number: 34141 Gerrit-PatchSet: 8 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmocom-bb[master]: layer23: modem: Pass fn from lapdm to L1CTL-CCCH_DATA.ind
by pespin 24 Aug '23

24 Aug '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/34133 ) Change subject: layer23: modem: Pass fn from lapdm to L1CTL-CCCH_DATA.ind ...................................................................... layer23: modem: Pass fn from lapdm to L1CTL-CCCH_DATA.ind Change-Id: I7a9f31ae363fe7de019ff1a906f3978ff3074036 --- M src/host/layer23/src/modem/grr.c 1 file changed, 17 insertions(+), 3 deletions(-) Approvals: osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified fixeria: Looks good to me, approved diff --git a/src/host/layer23/src/modem/grr.c b/src/host/layer23/src/modem/grr.c index e4fd23c..c6f2a32 100644 --- a/src/host/layer23/src/modem/grr.c +++ b/src/host/layer23/src/modem/grr.c @@ -95,9 +95,10 @@ static int forward_to_rlcmac(struct osmocom_ms *ms, struct msgb *msg) { struct osmo_gprs_rlcmac_prim *rlcmac_prim; + const uint32_t fn = *(uint32_t *)(&msg->cb[0]); /* Forward SI13 to RLC/MAC layer */ - rlcmac_prim = osmo_gprs_rlcmac_prim_alloc_l1ctl_ccch_data_ind(0 /* TODO: fn */, msgb_l3(msg)); + rlcmac_prim = osmo_gprs_rlcmac_prim_alloc_l1ctl_ccch_data_ind(fn, msgb_l3(msg)); return osmo_gprs_rlcmac_prim_lower_up(rlcmac_prim); } @@ -204,9 +205,10 @@ { const struct gsm48_system_information_type_header *si_hdr = msgb_l3(msg); const uint8_t si_type = si_hdr->system_information; + const uint32_t fn = *(uint32_t *)(&msg->cb[0]); - LOGP(DRR, LOGL_INFO, "BCCH message (type=0x%02x): %s\n", - si_type, gsm48_rr_msg_name(si_type)); + LOGP(DRR, LOGL_INFO, "BCCH message (type=0x%02x, fn=%u): %s\n", + si_type, fn, gsm48_rr_msg_name(si_type)); switch (si_type) { case GSM48_MT_RR_SYSINFO_1: @@ -420,6 +422,9 @@ const struct abis_rsl_common_hdr *rslh = msgb_l2(msg); int rc; + /* Obtain FN from message context: */ + *(uint32_t *)(&msg->cb[0]) = le->datalink[DL_SAPI0].mctx.fn; + switch (rslh->msg_discr & 0xfe) { case ABIS_RSL_MDISC_RLL: rc = grr_rx_rslms_rll((struct osmocom_ms *)ctx, msg); -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34133 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I7a9f31ae363fe7de019ff1a906f3978ff3074036 Gerrit-Change-Number: 34133 Gerrit-PatchSet: 9 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[L] Change in osmocom-bb[master]: l1gprs: implement TBF starting time support
by pespin 24 Aug '23

24 Aug '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/33223 ) Change subject: l1gprs: implement TBF starting time support ...................................................................... l1gprs: implement TBF starting time support Change-Id: I174e3c43d2f4c828a528710b284e62c9bb794122 Related: OS#5500 --- M include/l1gprs.h M src/shared/l1gprs.c 2 files changed, 256 insertions(+), 20 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/include/l1gprs.h b/include/l1gprs.h index 060366e..eb15726 100644 --- a/include/l1gprs.h +++ b/include/l1gprs.h @@ -9,6 +9,21 @@ struct l1gprs_state; struct msgb; +struct l1gprs_tbf_pending_req { + /*! Item in l1gprs_state->tbf_list_pending */ + struct llist_head list; + /*! Uplink or Downlink */ + bool uplink; + /*! TBF reference number (not index) */ + uint8_t tbf_ref; + /*! PDCH timeslots used by this TBF */ + uint8_t slotmask; + /*! (Downlink only) DL TFI (Temporary Flow Indentity): 0..31 */ + uint8_t dl_tfi; + /*! TBF starting time (absolute TDMA Fn) */ + uint32_t start_fn; +}; + struct l1gprs_tbf { /*! Item in l1gprs_state->tbf_list */ struct llist_head list; @@ -33,11 +48,16 @@ uint8_t dl_tbf_count; /*! DL TFI mask */ uint32_t dl_tfi_mask; + /*! Pending UL TBF count */ + uint8_t pending_ul_tbf_count; + /*! Pending DL TBF count */ + uint8_t pending_dl_tbf_count; }; static inline size_t l1gprs_pdch_use_count(const struct l1gprs_pdch *pdch) { - return pdch->ul_tbf_count + pdch->dl_tbf_count; + return pdch->ul_tbf_count + pdch->dl_tbf_count + + pdch->pending_ul_tbf_count + pdch->pending_dl_tbf_count; } @@ -46,8 +66,10 @@ struct l1gprs_state { /*! PDCH state for each timeslot */ struct l1gprs_pdch pdch[8]; - /*! Uplink and Downlink TBFs */ + /*! Uplink and Downlink TBFs (active), struct l1gprs_pending_tbf */ struct llist_head tbf_list; + /*! Uplink and Downlink TBFs (pending), struct l1gprs_tbf_pending_req */ + struct llist_head tbf_list_pending; /*! Logging context (used as prefix for messages) */ char *log_prefix; /*! Some private data for API user */ diff --git a/src/shared/l1gprs.c b/src/shared/l1gprs.c index bae13d2..a9a6228 100644 --- a/src/shared/l1gprs.c +++ b/src/shared/l1gprs.c @@ -31,6 +31,7 @@ #include <osmocom/gsm/protocol/gsm_04_08.h> #include <osmocom/gsm/protocol/gsm_44_060.h> +#include <osmocom/gsm/gsm0502.h> #include <osmocom/bb/l1ctl_proto.h> #include <osmocom/bb/l1gprs.h> @@ -43,10 +44,16 @@ LOGP_GPRS((pdch)->gprs, level, "(PDCH-%u) " fmt, \ (pdch)->tn, ## args) +#define LOG_TBF_CFG_REQ_FMT "tbf_ref=%u, slotmask=0x%02x, start_fn=%u" +#define LOG_TBF_CFG_REQ_ARGS(req) \ + (req)->tbf_ref, (req)->slotmask, ntohl((req)->start_fn) + #define LOG_TBF_FMT "%cL-TBF#%03d" #define LOG_TBF_ARGS(tbf) \ (tbf)->uplink ? 'U' : 'D', tbf->tbf_ref +#define TDMA_FN_INVALID 0xffffffff + static int l1gprs_log_cat = DLGLOBAL; enum gprs_rlcmac_block_type { @@ -56,13 +63,39 @@ GPRS_RLCMAC_RESERVED = 0x03, }; -static struct l1gprs_tbf *l1gprs_tbf_alloc(struct l1gprs_state *gprs, +static struct l1gprs_tbf_pending_req *l1gprs_tbf_pending_req_alloc(void *talloc_ctx, + bool uplink, uint8_t tbf_ref, + uint8_t slotmask, uint32_t start_fn) +{ + struct l1gprs_tbf_pending_req *preq; + + preq = talloc(talloc_ctx, struct l1gprs_tbf_pending_req); + OSMO_ASSERT(preq != NULL); + + preq->uplink = uplink; + preq->tbf_ref = tbf_ref; + preq->slotmask = slotmask; + preq->start_fn = start_fn; + + return preq; +} + +static void l1gprs_tbf_pending_req_free(struct l1gprs_tbf_pending_req *preq) +{ + if (preq == NULL) + return; + llist_del(&preq->list); + talloc_free(preq); +} + + +static struct l1gprs_tbf *l1gprs_tbf_alloc(void *talloc_ctx, bool uplink, uint8_t tbf_ref, uint8_t slotmask) { struct l1gprs_tbf *tbf; - tbf = talloc(gprs, struct l1gprs_tbf); + tbf = talloc(talloc_ctx, struct l1gprs_tbf); OSMO_ASSERT(tbf != NULL); tbf->uplink = uplink; @@ -80,12 +113,12 @@ talloc_free(tbf); } -static struct l1gprs_tbf *l1gprs_find_tbf(struct l1gprs_state *gprs, - bool uplink, uint8_t tbf_ref) +static struct l1gprs_tbf *_l1gprs_find_tbf(const struct llist_head *tbf_list, + bool uplink, uint8_t tbf_ref) { struct l1gprs_tbf *tbf; - llist_for_each_entry(tbf, &gprs->tbf_list, list) { + llist_for_each_entry(tbf, tbf_list, list) { if (tbf->uplink != uplink) continue; if (tbf->tbf_ref != tbf_ref) @@ -96,6 +129,16 @@ return NULL; } +static struct l1gprs_tbf *l1gprs_find_tbf(struct l1gprs_state *gprs, + bool uplink, uint8_t tbf_ref) +{ + struct l1gprs_tbf *tbf; + + if ((tbf = _l1gprs_find_tbf(&gprs->tbf_list, uplink, tbf_ref)) != NULL) + return tbf; + return NULL; +} + static void l1gprs_register_tbf(struct l1gprs_state *gprs, struct l1gprs_tbf *tbf) { @@ -129,7 +172,7 @@ llist_add_tail(&tbf->list, &gprs->tbf_list); LOGP_GPRS(gprs, LOGL_INFO, - LOG_TBF_FMT " is registered\n", + LOG_TBF_FMT " is registered as active\n", LOG_TBF_ARGS(tbf)); } @@ -228,6 +271,122 @@ l1gprs_tbf_free(tbf); } +static void l1gprs_add_tbf_pending_req(struct l1gprs_state *gprs, struct l1gprs_tbf_pending_req *preq) +{ + OSMO_ASSERT(preq->slotmask != 0x00); + + /* Update the PDCH states */ + for (unsigned int tn = 0; tn < ARRAY_SIZE(gprs->pdch); tn++) { + struct l1gprs_pdch *pdch = &gprs->pdch[tn]; + + if (~preq->slotmask & (1 << pdch->tn)) + continue; + + if (preq->uplink) { + pdch->pending_ul_tbf_count++; + } else { + pdch->pending_dl_tbf_count++; + /* We don't care about DL_TFI here, we don't want to activate it */ + } + + LOGP_PDCH(pdch, LOGL_DEBUG, + "Linked " LOG_TBF_FMT "\n", + LOG_TBF_ARGS(preq)); + /* If just got first use: */ + if (l1gprs_pdch_use_count(pdch) == 1) { + if (gprs->pdch_changed_cb) + gprs->pdch_changed_cb(pdch, true); + } + } + + llist_add_tail(&preq->list, &gprs->tbf_list_pending); + + LOGP_GPRS(gprs, LOGL_INFO, + LOG_TBF_FMT " is added as pending (fn=%u)\n", + LOG_TBF_ARGS(preq), preq->start_fn); +} + +static void l1gprs_remove_tbf_pending_req(struct l1gprs_state *gprs, struct l1gprs_tbf_pending_req *preq) +{ + + OSMO_ASSERT(preq->slotmask != 0x00); + + /* Update the PDCH states */ + for (unsigned int tn = 0; tn < ARRAY_SIZE(gprs->pdch); tn++) { + struct l1gprs_pdch *pdch = &gprs->pdch[tn]; + + if (~preq->slotmask & (1 << pdch->tn)) + continue; + + if (preq->uplink) { + OSMO_ASSERT(pdch->pending_ul_tbf_count > 0); + pdch->pending_ul_tbf_count--; + } else { + OSMO_ASSERT(pdch->pending_dl_tbf_count > 0); + pdch->pending_dl_tbf_count--; + /* We don't care about DL_TFI here, we didn't activate them in first place */ + } + + LOGP_PDCH(pdch, LOGL_DEBUG, + "Unlinked " LOG_TBF_FMT "\n", + LOG_TBF_ARGS(preq)); + /* Note: not calling gprs->pdch_changed_cb since no real + * activate / deactivate change can occur on lower layers as a + * consequence of moving a PDCH from pending to active, hence + * avoid triggering one active=false event here and immediately + * afterwards the opposite event when adding it as active: */ + } + + llist_del(&preq->list); + + LOGP_GPRS(gprs, LOGL_INFO, + LOG_TBF_FMT " is removed as pending (fn=%u)\n", + LOG_TBF_ARGS(preq), preq->start_fn); +} + +/* Check if the current TDMA Fn is past the start TDMA Fn. + * Based on fn_cmp() implementation from osmo-pcu.git, simplified. */ +static bool l1gprs_check_fn(uint32_t current, uint32_t start) +{ + const uint32_t thresh = GSM_TDMA_HYPERFRAME / 2; + + if ((current < start && (start - current) < thresh) || + (current > start && (current - start) > thresh)) + return false; + + return true; +} + +/* Check the list of pending TBFs and move those with expired Fn to the active list */ +static void l1gprs_check_pending_tbfs(struct l1gprs_state *gprs, uint32_t fn) +{ + struct l1gprs_tbf_pending_req *preq, *tmp; + struct l1gprs_tbf *tbf; + + llist_for_each_entry_safe(preq, tmp, &gprs->tbf_list_pending, list) { + if (!l1gprs_check_fn(fn, preq->start_fn)) + continue; + + LOGP_GPRS(gprs, LOGL_INFO, + LOG_TBF_FMT " becomes active (current_fn=%u, start_fn=%u)\n", + LOG_TBF_ARGS(preq), fn, preq->start_fn); + + l1gprs_remove_tbf_pending_req(gprs, preq); + + /* If this tbf already exists in the main list, simply update its timeslot: */ + tbf = _l1gprs_find_tbf(&gprs->tbf_list, preq->uplink, preq->tbf_ref); + if (tbf) { + l1gprs_update_tbf(gprs, tbf, preq->slotmask); + tbf->dl_tfi = preq->dl_tfi; + } else { + tbf = l1gprs_tbf_alloc(gprs, preq->uplink, preq->tbf_ref, preq->slotmask); + tbf->dl_tfi = preq->dl_tfi; + l1gprs_register_tbf(gprs, tbf); + } + talloc_free(preq); + } +} + #define L1GPRS_L1CTL_MSGB_SIZE 256 #define L1GPRS_L1CTL_MSGB_HEADROOM 32 @@ -302,6 +461,7 @@ } INIT_LLIST_HEAD(&gprs->tbf_list); + INIT_LLIST_HEAD(&gprs->tbf_list_pending); if (log_prefix == NULL) gprs->log_prefix = talloc_asprintf(gprs, "l1gprs[0x%p]: ", gprs); @@ -327,6 +487,16 @@ l1gprs_tbf_free(tbf); } + while (!llist_empty(&gprs->tbf_list_pending)) { + struct l1gprs_tbf_pending_req *preq; + + preq = llist_first_entry(&gprs->tbf_list_pending, struct l1gprs_tbf_pending_req, list); + LOGP_GPRS(gprs, LOGL_DEBUG, + "%s(): " LOG_TBF_FMT " is free()d\n", + __func__, LOG_TBF_ARGS(preq)); + l1gprs_tbf_pending_req_free(preq); + } + talloc_free(gprs->log_prefix); talloc_free(gprs); } @@ -351,12 +521,23 @@ } LOGP_GPRS(gprs, LOGL_INFO, - "Rx Uplink TBF config: tbf_ref=%u, slotmask=0x%02x\n", - req->tbf_ref, req->slotmask); - - tbf = l1gprs_find_tbf(gprs, true, req->tbf_ref); + "Rx UL TBF config: " LOG_TBF_CFG_REQ_FMT "\n", + LOG_TBF_CFG_REQ_ARGS(req)); if (req->slotmask != 0x00) { + uint32_t start_fn = ntohl(req->start_fn); + if (start_fn != TDMA_FN_INVALID) { + /* Create a temporary tbf and keep it in a separate + * list. It will be moved/merged into the main list at + * start_fn time. */ + struct l1gprs_tbf_pending_req *preq; + preq = l1gprs_tbf_pending_req_alloc(gprs, true, req->tbf_ref, + req->slotmask, start_fn); + l1gprs_add_tbf_pending_req(gprs, preq); + return 0; + } + + tbf = l1gprs_find_tbf(gprs, true, req->tbf_ref); if (tbf) { l1gprs_update_tbf(gprs, tbf, req->slotmask); } else { @@ -364,6 +545,7 @@ l1gprs_register_tbf(gprs, tbf); } } else { + tbf = l1gprs_find_tbf(gprs, true, req->tbf_ref); if (tbf == NULL) { LOGP_GPRS(gprs, LOGL_ERROR, "%s(): " LOG_TBF_FMT " not found\n", __func__, 'U', req->tbf_ref); @@ -390,8 +572,8 @@ } LOGP_GPRS(gprs, LOGL_INFO, - "Rx Downlink TBF config: tbf_ref=%u, slotmask=0x%02x, dl_tfi=%u\n", - req->tbf_ref, req->slotmask, req->dl_tfi); + "Rx DL TBF config: " LOG_TBF_CFG_REQ_FMT ", dl_tfi=%u\n", + LOG_TBF_CFG_REQ_ARGS(req), req->dl_tfi); if (req->dl_tfi > 31) { LOGP_GPRS(gprs, LOGL_ERROR, @@ -400,17 +582,31 @@ return -EINVAL; } - tbf = l1gprs_find_tbf(gprs, false, req->tbf_ref); - if (req->slotmask != 0x00) { + uint32_t start_fn = ntohl(req->start_fn); + if (start_fn != TDMA_FN_INVALID) { + /* Create a temporary tbf and keep it in a separate + * list. It will be moved/merged into the main list at + * start_fn time. */ + struct l1gprs_tbf_pending_req *preq; + preq = l1gprs_tbf_pending_req_alloc(gprs, false, req->tbf_ref, + req->slotmask, start_fn); + preq->dl_tfi = req->dl_tfi; + l1gprs_add_tbf_pending_req(gprs, preq); + return 0; + } + + tbf = l1gprs_find_tbf(gprs, false, req->tbf_ref); if (tbf) { l1gprs_update_tbf(gprs, tbf, req->slotmask); } else { - tbf = l1gprs_tbf_alloc(gprs, false, req->tbf_ref, req->slotmask); + tbf = l1gprs_tbf_alloc(gprs, false, req->tbf_ref, + req->slotmask); tbf->dl_tfi = req->dl_tfi; l1gprs_register_tbf(gprs, tbf); } } else { + tbf = l1gprs_find_tbf(gprs, false, req->tbf_ref); if (tbf == NULL) { LOGP_GPRS(gprs, LOGL_ERROR, "%s(): " LOG_TBF_FMT " not found\n", __func__, 'D', req->tbf_ref); @@ -496,9 +692,17 @@ BLOCK_IND_IS_PTCCH(ind) ? "PTCCH" : "PDTCH", ind->hdr.fn, ind->data_len, osmo_hexdump(ind->data, ind->data_len)); - if ((pdch->ul_tbf_count == 0) && (pdch->dl_tbf_count == 0)) { - LOGP_PDCH(pdch, LOGL_ERROR, - "Rx DL BLOCK.ind, but this PDCH has no configured TBFs\n"); + l1gprs_check_pending_tbfs(gprs, ind->hdr.fn); + + if (pdch->ul_tbf_count + pdch->dl_tbf_count == 0) { + if (pdch->pending_ul_tbf_count + pdch->pending_dl_tbf_count > 0) + LOGP_PDCH(pdch, LOGL_DEBUG, + "Rx DL BLOCK.ind (fn=%u), but this PDCH has no active TBFs yet\n", + ind->hdr.fn); + else + LOGP_PDCH(pdch, LOGL_ERROR, + "Rx DL BLOCK.ind (fn=%u), but this PDCH has no configured TBFs\n", + ind->hdr.fn); return NULL; } -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/33223 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I174e3c43d2f4c828a528710b284e62c9bb794122 Gerrit-Change-Number: 33223 Gerrit-PatchSet: 13 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <axilirator(a)gmail.com> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • ...
  • 152
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.