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 -----
  • 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

December 2025

  • 1 participants
  • 1175 discussions
[L] Change in osmo-bts[master]: bts-trx: Convert TRXC and TRXD sockets to iofd
by fixeria 11 Dec '25

11 Dec '25
Attention is currently required from: pespin. fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-bts/+/41650?usp=email ) Change subject: bts-trx: Convert TRXC and TRXD sockets to iofd ...................................................................... Patch Set 2: Code-Review-1 (8 comments) File src/osmo-bts-trx/trx_if.c: https://gerrit.osmocom.org/c/osmo-bts/+/41650/comment/06b43c48_e9f8dddc?usp… : PS2, Line 1298: trx_udp_open I still think having a helper function is better to avoid code duplication and copy-paste errors. https://gerrit.osmocom.org/c/osmo-bts/+/41650/comment/0835df08_e45de9b5?usp… : PS2, Line 147: msg->data_len `msgb_length(msg)` here and below https://gerrit.osmocom.org/c/osmo-bts/+/41650/comment/668e373a_bf35449b?usp… : PS2, Line 1006: LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR, : ```suggestion LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR, "recv() failed on TRXD with rc=%d (%s)\n", res, errbuf); ``` https://gerrit.osmocom.org/c/osmo-bts/+/41650/comment/882f6715_116ca7c5?usp… : PS2, Line 1110: trx_if_send_burst BTW, we may further improve this API to avoid `static` variables. My idea is to have the following API (draft): ``` struct msgb *trx_if_data_msgb_alloc(void); struct msgb *trx_if_data_msgb_push_br(struct msgb *msg, const struct trx_dl_burst_req *br); struct msgb *trx_if_data_msgb_send(struct trx_l1h *l1h, struct msgb *msg); ``` https://gerrit.osmocom.org/c/osmo-bts/+/41650/comment/98753226_f4931c4c?usp… : PS2, Line 1128: buf = msgb_data(trx_data_last_msg); setting `buf` here is probably not needed? https://gerrit.osmocom.org/c/osmo-bts/+/41650/comment/78304e94_3a9e81d8?usp… : PS2, Line 1164: ```suggestion msgb_put_u32(trx_data_last_msg, br->fn); ``` https://gerrit.osmocom.org/c/osmo-bts/+/41650/comment/bfef0671_718b4418?usp… : PS2, Line 1195: LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR, : "send() failed on TRXD with rc=%d (%s)\n", : We're no longer calling `send()` here, right? ```suggestion LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR, "osmo_iofd_write_msgb() failed on TRXD with rc=%d (%s)\n", rc, errbuf); ``` https://gerrit.osmocom.org/c/osmo-bts/+/41650/comment/61735b68_bb54b0e5?usp… : PS2, Line 1319: i Copy-paste! ```suggestion if (!l1h->trx_data_iofd) { ``` -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/41650?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I239f91efad43eabd280caf9f852c3aefbc729eaf Gerrit-Change-Number: 41650 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 11 Dec 2025 18:44:23 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmo-bts[master]: bts-trx: Convert trx clk socket to iofd
by fixeria 11 Dec '25

11 Dec '25
Attention is currently required from: pespin. fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-bts/+/41649?usp=email ) Change subject: bts-trx: Convert trx clk socket to iofd ...................................................................... Patch Set 1: Code-Review+1 (3 comments) Commit Message: https://gerrit.osmocom.org/c/osmo-bts/+/41649/comment/e313e6d3_bb8b85fe?usp… : PS1, Line 9: use nitpick: use twice File src/osmo-bts-trx/trx_if.c: https://gerrit.osmocom.org/c/osmo-bts/+/41649/comment/3c5a0702_d8036183?usp… : PS1, Line 1355: int rc; rename to `fd` or `sfd`? https://gerrit.osmocom.org/c/osmo-bts/+/41649/comment/18a08a3e_06c8e033?usp… : PS1, Line 1371: osmo_iofd_setup cosmetic: line too long, please wrap -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/41649?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Ia33028a657e7d5dee1a4994b8d6ba33ddea892ec Gerrit-Change-Number: 41649 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 11 Dec 2025 18:04:01 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in osmo-bts[master]: bts-trx: Set max TRXD buf size to UINT16_MAX
by fixeria 11 Dec '25

11 Dec '25
Attention is currently required from: jolly, laforge, osmith, pespin. fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-bts/+/41648?usp=email ) Change subject: bts-trx: Set max TRXD buf size to UINT16_MAX ...................................................................... Patch Set 1: (1 comment) File src/osmo-bts-trx/trx_if.h: https://gerrit.osmocom.org/c/osmo-bts/+/41648/comment/e930c127_5ab58a0b?usp… : PS1, Line 5: max. lo MTU Please update this comment, since it's now `max. lo MTU - 1`. Specifically, I would put something like "65535 is the limit of msgb". -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/41648?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I980faea05dee405c974636f41ee723659d9c5229 Gerrit-Change-Number: 41648 Gerrit-PatchSet: 1 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: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 11 Dec 2025 17:41:21 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[XS] Change in libosmo-netif[master]: cosmetic: stream_cli: Fix typos in API documentation
by pespin 11 Dec '25

11 Dec '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/41651?usp=email ) Change subject: cosmetic: stream_cli: Fix typos in API documentation ...................................................................... cosmetic: stream_cli: Fix typos in API documentation Change-Id: Icb3c567df9fa287667996af34b652f80f12a816e --- M src/stream_cli.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/51/41651/1 diff --git a/src/stream_cli.c b/src/stream_cli.c index c623fff..b96a530 100644 --- a/src/stream_cli.c +++ b/src/stream_cli.c @@ -876,7 +876,7 @@ configure_cli_segmentation_cb(cli); } -/*! Set the socket type for the stream server link. +/*! Set the socket type for the stream client socket. * Any changes to this setting will only become active upon next (re)connect. * \param[in] cli Stream Client to modify * \param[in] type Socket Type (like SOCK_STREAM (default), SOCK_SEQPACKET, ...) @@ -896,7 +896,7 @@ return 0; } -/*! Set the socket domain for the stream client link. +/*! Set the socket domain for the stream client socket. * Any changes to this setting will only become active upon next (re)connect. * \param[in] cli Stream Client to modify * \param[in] domain Socket Domain (like AF_UNSPEC (default for IP), AF_UNIX, AF_INET, ...) -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/41651?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Icb3c567df9fa287667996af34b652f80f12a816e Gerrit-Change-Number: 41651 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[L] Change in osmo-bts[master]: bts-trx: Convert TRXC and TRXD sockets to iofd
by pespin 11 Dec '25

11 Dec '25
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-bts/+/41650?usp=email ) Change subject: bts-trx: Convert TRXC and TRXD sockets to iofd ...................................................................... bts-trx: Convert TRXC and TRXD sockets to iofd Since now the Tx side is driven by the event loop, we can use (and should) use OSMO_SOCK_F_NONBLOCK on the socket, avoiding potential blocking of the entire process. We also gain io_uring support for free, which is a really nice feature to have in TRXD. Related: OS#1579 Change-Id: I239f91efad43eabd280caf9f852c3aefbc729eaf --- M src/osmo-bts-trx/l1_if.h M src/osmo-bts-trx/trx_if.c 2 files changed, 145 insertions(+), 124 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/50/41650/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/41650?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I239f91efad43eabd280caf9f852c3aefbc729eaf Gerrit-Change-Number: 41650 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder
1 0
0 0
[M] Change in osmo-bts[master]: bts-trx: Convert trx clk socket to iofd
by pespin 11 Dec '25

11 Dec '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/41649?usp=email ) Change subject: bts-trx: Convert trx clk socket to iofd ...................................................................... bts-trx: Convert trx clk socket to iofd Since now the Tx side is driven by the event loop, we can use (and should) use OSMO_SOCK_F_NONBLOCK on the socket, avoiding potential blocking of the entire process. Related: OS#1579 Change-Id: Ia33028a657e7d5dee1a4994b8d6ba33ddea892ec --- M include/osmo-bts/phy_link.h M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_vty.c 3 files changed, 49 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/49/41649/1 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 862ed48..719c329 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -3,6 +3,7 @@ #include <stdint.h> #include <stdbool.h> #include <osmocom/core/linuxlist.h> +#include <osmocom/core/osmo_io.h> #include <osmo-bts/scheduler.h> #include <osmo-bts/bts_trx.h> @@ -44,7 +45,7 @@ char *remote_ip; uint16_t base_port_local; uint16_t base_port_remote; - struct osmo_fd trx_ofd_clk; + struct osmo_io_fd *trx_clk_iofd; uint32_t clock_advance; uint32_t rts_advance; bool use_legacy_setbsic; diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index b6b20e9..91961f4 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -105,34 +105,35 @@ */ /* get clock from clock socket */ -static int trx_clk_read_cb(struct osmo_fd *ofd, unsigned int what) +static void trx_clk_read_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg) { - struct phy_link *plink = ofd->data; + struct phy_link *plink = osmo_iofd_get_data(iofd); struct phy_instance *pinst = phy_instance_by_num(plink, 0); - char buf[TRXC_MSG_BUF_SIZE]; - ssize_t len; + char *buf; uint32_t fn; OSMO_ASSERT(pinst); - len = recv(ofd->fd, buf, sizeof(buf) - 1, 0); - if (len <= 0) { - strerror_r(errno, (char *)buf, sizeof(buf)); + if (res <= 0) { + char errbuf[256]; + strerror_r(errno, errbuf, sizeof(errbuf)); LOGPPHI(pinst, DTRX, LOGL_ERROR, - "recv() failed on TRXD with rc=%zd (%s)\n", len, buf); - return len; + "recv() failed on TRXD with rc=%d (%s)\n", res, errbuf); + goto ret_free_msg; } - buf[len] = '\0'; + + msgb_put_u8(msg, (uint8_t)'\0'); + buf = (char *)msgb_data(msg); if (!!strncmp(buf, "IND CLOCK ", 10)) { LOGPPHI(pinst, DTRX, LOGL_NOTICE, "Unknown message on clock port: %s\n", buf); - return 0; + goto ret_free_msg; } if (sscanf(buf, "IND CLOCK %u", &fn) != 1) { LOGPPHI(pinst, DTRX, LOGL_ERROR, "Unable to parse '%s'\n", buf); - return 0; + goto ret_free_msg; } LOGPPHI(pinst, DTRX, LOGL_INFO, "Clock indication: fn=%u\n", fn); @@ -145,14 +146,20 @@ if (!plink->u.osmotrx.powered) { LOGPPHI(pinst, DTRX, LOGL_NOTICE, "Ignoring CLOCK IND %u, TRX not yet powered on\n", fn); - return 0; + goto ret_free_msg; } /* inform core TRX clock handling code that a FN has been received */ trx_sched_clock(pinst->trx->bts, fn); - return 0; +ret_free_msg: + msgb_free(msg); } +static void trx_clk_write_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg) +{ + /* libosmocore before change-id I0c071a29e508884bac331ada5e510bbfcf440bbf requires write call-back + * even if we don't care about it */ +} /* * TRX ctrl socket @@ -1273,6 +1280,11 @@ return plink->u.osmotrx.base_port_local + (pinst->num << 1) + inc; } +static const struct osmo_io_ops trx_clk_ioops = { + .read_cb = trx_clk_read_cb, + .write_cb = trx_clk_write_cb, +}; + /*! open a TRX interface. creates control + data sockets */ static int trx_if_open(struct trx_l1h *l1h) { @@ -1339,21 +1351,28 @@ int bts_model_phy_link_open(struct phy_link *plink) { struct phy_instance *pinst; + char sock_name_buf[OSMO_SOCK_NAME_MAXLEN] = {}; int rc; phy_link_state_set(plink, PHY_LINK_CONNECTING); /* open the shared/common clock socket */ - rc = trx_udp_open(plink, &plink->u.osmotrx.trx_ofd_clk, - plink->u.osmotrx.local_ip, - plink->u.osmotrx.base_port_local, - plink->u.osmotrx.remote_ip, - plink->u.osmotrx.base_port_remote, - trx_clk_read_cb); + rc = osmo_sock_init2(AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, + plink->u.osmotrx.local_ip, + plink->u.osmotrx.base_port_local, + plink->u.osmotrx.remote_ip, + plink->u.osmotrx.base_port_remote, + OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT | OSMO_SOCK_F_NONBLOCK); if (rc < 0) { phy_link_state_set(plink, PHY_LINK_SHUTDOWN); return -1; } + osmo_sock_get_name_buf(sock_name_buf, OSMO_SOCK_NAME_MAXLEN, rc); + plink->u.osmotrx.trx_clk_iofd = osmo_iofd_setup(plink, rc, sock_name_buf, OSMO_IO_FD_MODE_READ_WRITE, &trx_clk_ioops, plink); + if (!plink->u.osmotrx.trx_clk_iofd) + goto cleanup; + osmo_iofd_set_alloc_info(plink->u.osmotrx.trx_clk_iofd, TRXC_MSG_BUF_SIZE, 0); + osmo_iofd_register(plink->u.osmotrx.trx_clk_iofd, -1); /* open the individual instances with their ctrl+data sockets */ llist_for_each_entry(pinst, &plink->instances, list) { @@ -1373,7 +1392,8 @@ pinst->u.osmotrx.hdl = NULL; } } - trx_udp_close(&plink->u.osmotrx.trx_ofd_clk); + osmo_iofd_free(plink->u.osmotrx.trx_clk_iofd); + plink->u.osmotrx.trx_clk_iofd = NULL; return -1; } @@ -1389,7 +1409,8 @@ } trx_phy_inst_close(pinst); } - trx_udp_close(&plink->u.osmotrx.trx_ofd_clk); + osmo_iofd_free(plink->u.osmotrx.trx_clk_iofd); + plink->u.osmotrx.trx_clk_iofd = NULL; phy_link_state_set(plink, PHY_LINK_SHUTDOWN); return 0; } diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 9056f02..b806dc6 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -62,10 +62,11 @@ llist_for_each_entry(trx, &g_bts->trx_list, list) { struct phy_instance *pinst = trx_phy_instance(trx); struct phy_link *plink = pinst->phy_link; - char *sname = osmo_sock_get_name(NULL, plink->u.osmotrx.trx_ofd_clk.fd); + const char *sname = plink->u.osmotrx.trx_clk_iofd ? + osmo_iofd_get_name(plink->u.osmotrx.trx_clk_iofd) : + NULL; l1h = pinst->u.osmotrx.hdl; - vty_out(vty, "TRX %d %s%s", trx->nr, sname, VTY_NEWLINE); - talloc_free(sname); + vty_out(vty, "TRX %d %s%s", trx->nr, sname ? sname : "", VTY_NEWLINE); vty_out(vty, " %s%s", trx_if_powered(l1h) ? "poweron":"poweroff", VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/41649?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Ia33028a657e7d5dee1a4994b8d6ba33ddea892ec Gerrit-Change-Number: 41649 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-bts[master]: bts-trx: Set max TRXD buf size to UINT16_MAX
by pespin 11 Dec '25

11 Dec '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/41648?usp=email ) Change subject: bts-trx: Set max TRXD buf size to UINT16_MAX ...................................................................... bts-trx: Set max TRXD buf size to UINT16_MAX Otherwise trying to allocate a msgb from it fails: In file included from /git/osmo-bts/src/osmo-bts-trx/l1_if.h:9, from /git/osmo-bts/src/osmo-bts-trx/trx_if.c:50: /git/osmo-bts/src/osmo-bts-trx/trx_if.c: In function ‘trx_if_send_burst’: /git/osmo-bts/src/osmo-bts-trx/trx_if.h:6:33: error: unsigned conversion from ‘int’ to ‘uint16_t’ {aka ‘short unsigned int’} changes value from 65536’ to ‘0’ [-Werror=overflow] 6 | #define TRXD_MSG_BUF_SIZE 65536 | ^~~~~ /git/osmo-bts/src/osmo-bts-trx/trx_if.c:1126:48: note: in expansion of macro ‘TRXD_MSG_BUF_SIZE’ 1126 | trx_data_last_msg = msgb_alloc(TRXD_MSG_BUF_SIZE, "tx_trxd"); | ^~~~~~~~~~~~~~~~~ Change-Id: I980faea05dee405c974636f41ee723659d9c5229 --- M src/osmo-bts-trx/trx_if.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/48/41648/1 diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 3a22a1b..e0ef84d 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -3,7 +3,7 @@ /* TRXC read/send buffer size */ #define TRXC_MSG_BUF_SIZE 1500 /* TRXD read/send buffer size (max. lo MTU) */ -#define TRXD_MSG_BUF_SIZE 65536 +#define TRXD_MSG_BUF_SIZE 65535U struct trx_dl_burst_req; struct trx_l1h; -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/41648?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I980faea05dee405c974636f41ee723659d9c5229 Gerrit-Change-Number: 41648 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[L] Change in osmo-bts[master]: bts-trx: Convert TRXC and TRXD sockets to iofd
by pespin 11 Dec '25

11 Dec '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/41650?usp=email ) Change subject: bts-trx: Convert TRXC and TRXD sockets to iofd ...................................................................... bts-trx: Convert TRXC and TRXD sockets to iofd Since now the Tx side is driven by the event loop, we can use (and should) use OSMO_SOCK_F_NONBLOCK on the socket, avoiding potential blocking of the entire process. We also gain io_uring support for free, which is a really nice feature to have in TRXD. Related: OS#1579 Change-Id: I239f91efad43eabd280caf9f852c3aefbc729eaf --- M src/osmo-bts-trx/l1_if.h M src/osmo-bts-trx/trx_if.c 2 files changed, 143 insertions(+), 124 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/50/41650/1 diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h index 84fd4b5..7cc82ad 100644 --- a/src/osmo-bts-trx/l1_if.h +++ b/src/osmo-bts-trx/l1_if.h @@ -2,6 +2,7 @@ #define L1_IF_H_TRX #include <osmocom/core/rate_ctr.h> +#include <osmocom/core/osmo_io.h> #include <osmo-bts/scheduler.h> #include <osmo-bts/phy_link.h> @@ -128,9 +129,9 @@ //struct gsm_bts_trx *trx; struct phy_instance *phy_inst; - struct osmo_fd trx_ofd_ctrl; + struct osmo_io_fd *trx_ctrl_iofd; struct osmo_timer_list trx_ctrl_timer; - struct osmo_fd trx_ofd_data; + struct osmo_io_fd *trx_data_iofd; /* transceiver config */ struct trx_config config; diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 91961f4..bf0ab09 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -65,42 +65,6 @@ #endif /* HAVE_SYSTEMTAP */ /* - * socket helper functions - */ - -/*! convenience wrapper to open socket + fill in osmo_fd */ -static int trx_udp_open(void *priv, struct osmo_fd *ofd, const char *host_local, - uint16_t port_local, const char *host_remote, uint16_t port_remote, - int (*cb)(struct osmo_fd *fd, unsigned int what)) -{ - int rc; - - /* Init */ - ofd->fd = -1; - ofd->cb = cb; - ofd->data = priv; - - /* Listen / Binds + Connect */ - rc = osmo_sock_init2_ofd(ofd, AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, host_local, port_local, - host_remote, port_remote, OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT); - if (rc < 0) - return rc; - - return 0; -} - -/* close socket + unregister osmo_fd */ -static void trx_udp_close(struct osmo_fd *ofd) -{ - if (ofd->fd >= 0) { - osmo_fd_unregister(ofd); - close(ofd->fd); - ofd->fd = -1; - } -} - - -/* * TRX clock socket */ @@ -169,25 +133,30 @@ static void trx_ctrl_send(struct trx_l1h *l1h) { struct trx_ctrl_msg *tcm; - char buf[TRXC_MSG_BUF_SIZE]; - int len; - ssize_t snd_len; + char *buf; + struct msgb *msg; + int len, rc; /* get first command */ if (llist_empty(&l1h->trx_ctrl_list)) return; tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, list); - len = snprintf(buf, sizeof(buf), "CMD %s%s%s", tcm->cmd, tcm->params_len ? " ":"", tcm->params); - OSMO_ASSERT(len < sizeof(buf)); + msg = msgb_alloc(TRXC_MSG_BUF_SIZE, "trxc_cmd"); + buf = (char *)msgb_data(msg); + len = snprintf(buf, msg->data_len, "CMD %s%s%s", tcm->cmd, tcm->params_len ? " ":"", tcm->params); + OSMO_ASSERT(len < msg->data_len); + msgb_put(msg, len); LOGPPHI(l1h->phy_inst, DTRX, LOGL_DEBUG, "Sending control '%s'\n", buf); /* send command */ - snd_len = send(l1h->trx_ofd_ctrl.fd, buf, len+1, 0); - if (snd_len <= 0) { - strerror_r(errno, (char *)buf, sizeof(buf)); + rc = osmo_iofd_write_msgb(l1h->trx_ctrl_iofd, msg); + if (rc < 0) { + char errbuf[256]; + strerror_r(errno, errbuf, sizeof(errbuf)); LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR, - "send() failed on TRXC with rc=%zd (%s)\n", snd_len, buf); + "send() failed on TRXC with rc=%d (%s)\n", rc, errbuf); + msgb_free(msg); } /* start timer */ @@ -217,9 +186,6 @@ /* initialize ctrl queue */ INIT_LLIST_HEAD(&l1h->trx_ctrl_list); - - l1h->trx_ofd_ctrl.fd = -1; - l1h->trx_ofd_data.fd = -1; } /*! Send a new TRX control command. @@ -673,23 +639,24 @@ } /*! Get + parse response from TRX ctrl socket */ -static int trx_ctrl_read_cb(struct osmo_fd *ofd, unsigned int what) +static void trx_ctrl_read_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg) { - struct trx_l1h *l1h = ofd->data; + struct trx_l1h *l1h = osmo_iofd_get_data(iofd); struct phy_instance *pinst = l1h->phy_inst; - char buf[TRXC_MSG_BUF_SIZE]; + const char *buf; struct trx_ctrl_rsp rsp; - int len, rc; + int rc; struct trx_ctrl_msg *tcm; bool flushed; - len = recv(ofd->fd, buf, sizeof(buf) - 1, 0); - if (len <= 0) - return len; - buf[len] = '\0'; + if (res <= 0) + goto ret_free_msg; - if (parse_rsp(buf, len, &rsp) < 0) - return 0; + msgb_put_u8(msg, (uint8_t)'\0'); + buf = (char *)msgb_data(msg); + + if (parse_rsp(buf, res, &rsp) < 0) + goto ret_free_msg; LOGPPHI(l1h->phy_inst, DTRX, LOGL_INFO, "Response message: '%s'\n", buf); @@ -702,13 +669,12 @@ if (l1h->last_acked && cmd_matches_rsp(l1h->last_acked, &rsp)) { LOGPPHI(l1h->phy_inst, DTRX, LOGL_NOTICE, "Discarding duplicated RSP " "from old CMD '%s'\n", buf); - return 0; + goto ret_free_msg; } LOGPPHI(l1h->phy_inst, DTRX, LOGL_NOTICE, "Response message without command\n"); - return -EINVAL; + goto ret_free_msg; } - tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, - list); + tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, list); /* check if response matches command */ if (!cmd_matches_rsp(tcm, &rsp)) { @@ -716,7 +682,7 @@ if (l1h->last_acked && cmd_matches_rsp(l1h->last_acked, &rsp)) { LOGPPHI(l1h->phy_inst, DTRX, LOGL_NOTICE, "Discarding duplicated RSP " "from old CMD '%s'\n", buf); - return 0; + goto ret_free_msg; } LOGPPHI(l1h->phy_inst, DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_NOTICE, "Response message '%s' does not match command " @@ -746,7 +712,7 @@ /* The queue may have been flushed in the trx_ctrl_rx_rsp(): */ if (!llist_empty(&l1h->trx_ctrl_list)) osmo_timer_schedule(&l1h->trx_ctrl_timer, rc, 0); - return 0; + goto ret_free_msg; } if (!flushed) { @@ -760,16 +726,22 @@ /* Send next message waiting in the list: */ trx_ctrl_send(l1h); - - return 0; + msgb_free(msg); + return; rsp_error: bts_shutdown(pinst->trx->bts, "TRX-CTRL-MSG: CRITICAL"); /* keep tcm list, so process is stopped */ - return -EIO; +ret_free_msg: + msgb_free(msg); } +static void trx_ctrl_write_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg) +{ + /* nothing to be done here */ +} + /* * TRX burst data socket */ @@ -1019,26 +991,24 @@ return buf; } -/* TRXD buffer used by Rx/Tx handlers */ -static uint8_t trx_data_buf[TRXD_MSG_BUF_SIZE]; - /* Parse TRXD message from transceiver, compose an UL burst indication. */ -static int trx_data_read_cb(struct osmo_fd *ofd, unsigned int what) +static void trx_data_read_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg) { - const uint8_t *buf = &trx_data_buf[0]; - struct trx_l1h *l1h = ofd->data; + struct trx_l1h *l1h = osmo_iofd_get_data(iofd); + const uint8_t *buf; struct trx_ul_burst_ind bi; ssize_t hdr_len, buf_len; uint8_t pdu_ver; - buf_len = recv(ofd->fd, trx_data_buf, sizeof(trx_data_buf), 0); - if (OSMO_UNLIKELY(buf_len <= 0)) { - strerror_r(errno, (char *) trx_data_buf, sizeof(trx_data_buf)); + if (OSMO_UNLIKELY(res <= 0)) { + char errbuf[256]; + strerror_r(errno, errbuf, sizeof(errbuf)); LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR, - "recv() failed on TRXD with rc=%zd (%s)\n", - buf_len, trx_data_buf); - return buf_len; + "recv() failed on TRXD with rc=%d\n", res); + goto ret_msg_free; } + buf = msgb_data(msg); + buf_len = msgb_length(msg); /* Parse PDU version first */ pdu_ver = buf[0] >> 4; @@ -1048,7 +1018,7 @@ LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR, "Rx TRXD PDU with unexpected version %u (expected %u)\n", pdu_ver, l1h->config.trxd_pdu_ver_use); - return -EIO; + goto ret_msg_free; } /* We're about to parse the first PDU */ @@ -1064,7 +1034,7 @@ LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR, "Rx malformed TRXDv%u PDU: len=%zd < expected %u\n", pdu_ver, buf_len, trx_data_rx_hdr_len[pdu_ver]); - return -EINVAL; + goto ret_msg_free; } /* Parse header depending on the PDU version */ @@ -1085,13 +1055,13 @@ /* Header parsing error */ if (OSMO_UNLIKELY(hdr_len < 0)) - return hdr_len; + goto ret_msg_free; if (OSMO_UNLIKELY(bi.fn >= GSM_TDMA_HYPERFRAME)) { LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR, "Rx malformed TRXDv%u PDU: illegal TDMA fn=%u\n", pdu_ver, bi.fn); - return -EINVAL; + goto ret_msg_free; } /* We're done with the header now */ @@ -1103,7 +1073,7 @@ LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR, "Rx malformed TRXDv%u PDU: odd burst length=%zd\n", pdu_ver, buf_len); - return -EINVAL; + goto ret_msg_free; } /* We're done with the burst bits now */ @@ -1124,7 +1094,13 @@ TRACE(OSMO_BTS_TRX_UL_DATA_DONE(l1h->phy_inst->trx->nr, bi.tn, bi.fn)); } while (bi.flags & TRX_BI_F_BATCH_IND); - return 0; +ret_msg_free: + msgb_free(msg); +} + +static void trx_data_write_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg) +{ + /* nothing to be done here */ } /*! Send burst data for given FN/timeslot to TRX @@ -1134,10 +1110,10 @@ int trx_if_send_burst(struct trx_l1h *l1h, const struct trx_dl_burst_req *br) { uint8_t pdu_ver = l1h->config.trxd_pdu_ver_use; - static uint8_t *buf = &trx_data_buf[0]; - static uint8_t *last_pdu = NULL; + static struct msgb *trx_data_last_msg = NULL; static unsigned int pdu_num = 0; - ssize_t snd_len, buf_len; + uint8_t *buf; + int rc; /* Make sure that the PHY is powered on */ if (OSMO_UNLIKELY(!trx_if_powered(l1h))) { @@ -1146,6 +1122,12 @@ return -ENODEV; } + if (!trx_data_last_msg) { + trx_data_last_msg = msgb_alloc(TRXD_MSG_BUF_SIZE, "tx_trxd"); + OSMO_ASSERT(trx_data_last_msg); + buf = msgb_data(trx_data_last_msg); + } + /* Burst batching breaker */ if (br == NULL) { if (pdu_num > 0) @@ -1153,19 +1135,20 @@ return -ENOMSG; } - /* Pointer to the last encoded PDU */ - last_pdu = &buf[0]; + /* l2h holds Pointer to the last encoded PDU */ + trx_data_last_msg->l2h = trx_data_last_msg->tail; switch (pdu_ver) { /* Both versions have the same PDU format */ case 0: /* TRXDv0 */ case 1: /* TRXDv1 */ + buf = (uint8_t *)msgb_put(trx_data_last_msg, 6); buf[0] = ((pdu_ver & 0x0f) << 4) | br->tn; osmo_store32be(br->fn, buf + 1); buf[5] = br->att; - buf += 6; break; case 2: /* TRXDv2 */ + buf = (uint8_t *)msgb_put(trx_data_last_msg, 8); buf[0] = br->tn; /* BATCH.ind will be unset in the last PDU */ buf[1] = (br->trx_num & 0x3f) | (1 << 7); @@ -1178,10 +1161,8 @@ /* Some fields are not present in batched PDUs */ if (pdu_num == 0) { buf[0] |= (pdu_ver & 0x0f) << 4; - osmo_store32be(br->fn, buf + 8); - buf += 4; + osmo_store32be(br->fn, (uint8_t *)msgb_put(trx_data_last_msg, 4)); } - buf += 8; break; default: /* Shall not happen */ @@ -1189,8 +1170,7 @@ } /* copy ubits {0,1} */ - memcpy(buf, br->burst, br->burst_len); - buf += br->burst_len; + memcpy(msgb_put(trx_data_last_msg, br->burst_len), br->burst, br->burst_len); /* One more PDU in the buffer */ pdu_num++; @@ -1206,20 +1186,19 @@ /* TRXDv2: unset BATCH.ind in the last PDU */ if (pdu_ver >= 2) - last_pdu[1] &= ~(1 << 7); + trx_data_last_msg->l2h[1] &= ~(1 << 7); - buf_len = buf - &trx_data_buf[0]; - buf = &trx_data_buf[0]; - pdu_num = 0; - - snd_len = send(l1h->trx_ofd_data.fd, trx_data_buf, buf_len, 0); - if (OSMO_UNLIKELY(snd_len <= 0)) { - strerror_r(errno, (char *) trx_data_buf, sizeof(trx_data_buf)); + rc = osmo_iofd_write_msgb(l1h->trx_data_iofd, trx_data_last_msg); + if (OSMO_UNLIKELY(rc < 0)) { + char errbuf[256]; + strerror_r(errno, errbuf, sizeof(errbuf)); LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR, - "send() failed on TRXD with rc=%zd (%s)\n", - snd_len, trx_data_buf); - return -2; + "send() failed on TRXD with rc=%d (%s)\n", + rc, errbuf); + msgb_free(trx_data_last_msg); } + trx_data_last_msg = NULL; + pdu_num = 0; return 0; } @@ -1261,8 +1240,10 @@ trx_if_flush(l1h); /* close sockets */ - trx_udp_close(&l1h->trx_ofd_ctrl); - trx_udp_close(&l1h->trx_ofd_data); + osmo_iofd_free(l1h->trx_ctrl_iofd); + l1h->trx_ctrl_iofd = NULL; + osmo_iofd_free(l1h->trx_data_iofd); + l1h->trx_data_iofd = NULL; } /*! compute UDP port number used for TRX protocol */ @@ -1280,6 +1261,16 @@ return plink->u.osmotrx.base_port_local + (pinst->num << 1) + inc; } +static const struct osmo_io_ops trx_ctrl_ioops = { + .read_cb = trx_ctrl_read_cb, + .write_cb = trx_ctrl_write_cb, +}; + +static const struct osmo_io_ops trx_data_ioops = { + .read_cb = trx_data_read_cb, + .write_cb = trx_data_write_cb, +}; + static const struct osmo_io_ops trx_clk_ioops = { .read_cb = trx_clk_read_cb, .write_cb = trx_clk_write_cb, @@ -1292,25 +1283,52 @@ struct phy_link *plink = pinst->phy_link; int rc; + unsigned int flags = OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT | OSMO_SOCK_F_NONBLOCK; + LOGPPHI(pinst, DTRX, LOGL_NOTICE, "Opening TRXC/TRXD connections to %s\n", plink->u.osmotrx.remote_ip); - /* open sockets */ - rc = trx_udp_open(l1h, &l1h->trx_ofd_ctrl, - plink->u.osmotrx.local_ip, - compute_port(pinst, false, false), - plink->u.osmotrx.remote_ip, - compute_port(pinst, true, false), trx_ctrl_read_cb); - if (rc < 0) - return rc; - rc = trx_udp_open(l1h, &l1h->trx_ofd_data, - plink->u.osmotrx.local_ip, - compute_port(pinst, false, true), - plink->u.osmotrx.remote_ip, - compute_port(pinst, true, true), trx_data_read_cb); + /* open TRXC socket */ + rc = osmo_sock_init2(AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, + plink->u.osmotrx.local_ip, + compute_port(pinst, false, false), + plink->u.osmotrx.remote_ip, + compute_port(pinst, true, false), + flags); if (rc < 0) return rc; + l1h->trx_ctrl_iofd = osmo_iofd_setup(l1h, rc, NULL, OSMO_IO_FD_MODE_READ_WRITE, &trx_ctrl_ioops, l1h); + if (!l1h->trx_ctrl_iofd) { + close(rc); + return -ENOMEDIUM; + } + osmo_iofd_set_alloc_info(l1h->trx_ctrl_iofd, TRXC_MSG_BUF_SIZE, 0); + + /* open TRXD socket */ + rc = osmo_sock_init2(AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, + plink->u.osmotrx.local_ip, + compute_port(pinst, false, true), + plink->u.osmotrx.remote_ip, + compute_port(pinst, true, true), + flags); + if (rc < 0) + goto ret_close_trxc; + l1h->trx_data_iofd = osmo_iofd_setup(l1h, rc, NULL, OSMO_IO_FD_MODE_READ_WRITE, &trx_data_ioops, l1h); + if (!l1h->trx_ctrl_iofd) { + close(rc); + goto ret_close_trxc; + } + osmo_iofd_set_alloc_info(l1h->trx_data_iofd, TRXD_MSG_BUF_SIZE, 0); + + /* register sockets */ + osmo_iofd_register(l1h->trx_ctrl_iofd, -1); + osmo_iofd_register(l1h->trx_data_iofd, -1); return 0; + +ret_close_trxc: + osmo_iofd_free(l1h->trx_ctrl_iofd); + l1h->trx_ctrl_iofd = NULL; + return rc; } /*! close the control + burst data sockets for one phy_instance */ -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/41650?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I239f91efad43eabd280caf9f852c3aefbc729eaf Gerrit-Change-Number: 41650 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-bsc[master]: E1: add support for compressed CSD (TW-TS-007)
by pespin 11 Dec '25

11 Dec '25
Attention is currently required from: falconia. pespin has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/osmo-bsc/+/41647?usp=email ) Change subject: E1: add support for compressed CSD (TW-TS-007) ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/41647?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I5d98309cfc5d443278479252846c66a7da8b4ce4 Gerrit-Change-Number: 41647 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-Comment-Date: Thu, 11 Dec 2025 10:47:18 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-bsc[master]: E1: add support for compressed CSD (TW-TS-007)
by falconia 11 Dec '25

11 Dec '25
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/41647?usp=email ) Change subject: E1: add support for compressed CSD (TW-TS-007) ...................................................................... E1: add support for compressed CSD (TW-TS-007) Using TW-TS-007 format for CSD instead of CLEARMODE across AoIP interface drastically reduces IP bandwidth usage, making CSD equal to speech calls. If the CN requests use of this compressed RTP format for CSD and the MGW supports it (currently the case with tw-e1abis-mgw for E1 BTS), then enable it on AoIP side. Depends: I74c9e76ebcce32ad20501134ec5089794acb4f62 (libosmocore.git) Change-Id: I5d98309cfc5d443278479252846c66a7da8b4ce4 --- M TODO-RELEASE M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/lchan_rtp_fsm.c 3 files changed, 20 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/47/41647/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 1d65ba1..fa4fe07 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -8,3 +8,4 @@ # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line libosmo-mgcp-client >1.15.0 new API of fmtp in struct ptmap +libosmogsm >1.12.0 OSMO_AOIP_RTP_PT_TWTS007 in gsm_48_103.h diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index c5363b8..f0a2781 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -568,6 +568,9 @@ if ((requested_ext & OSMO_RTP_EXT_TWTS006) && is_e1_bts(bts)) accepted_ext |= OSMO_RTP_EXT_TWTS006; + if ((requested_ext & OSMO_RTP_EXT_TWTS007) && is_e1_bts(bts)) + accepted_ext |= OSMO_RTP_EXT_TWTS007; + conn->user_plane.rtp_extensions = accepted_ext; } diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c index 7d80a73..4d0217b 100644 --- a/src/osmo-bsc/lchan_rtp_fsm.c +++ b/src/osmo-bsc/lchan_rtp_fsm.c @@ -947,6 +947,7 @@ { enum mgcp_codecs codec = chan_mode_to_mgcp_codec(lchan->activate.ch_mode_rate.chan_mode, lchan->type == GSM_LCHAN_TCH_H? false : true); + uint8_t rtp_ext = lchan->conn->user_plane.rtp_extensions; int pt, amr_oa; if (codec < 0) { @@ -993,7 +994,7 @@ * OsmoBTS in the future, it will strictly require no-alteration * pass-through from the BSC-associated MGW. Therefore, * indicate this format on both sides when it is enabled. */ - if (lchan->conn->user_plane.rtp_extensions & OSMO_RTP_EXT_TWTS006) { + if (rtp_ext & OSMO_RTP_EXT_TWTS006) { OSMO_STRLCPY_ARRAY(verb_info->ptmap[0].fmtp, "octet-align=1;tw-ts-006=1"); break; @@ -1009,13 +1010,25 @@ break; case CODEC_GSM_8000_1: case CODEC_GSMEFR_8000_1: - if (lchan->conn->user_plane.rtp_extensions & OSMO_RTP_EXT_TWTS001) + if (rtp_ext & OSMO_RTP_EXT_TWTS001) OSMO_STRLCPY_ARRAY(verb_info->ptmap[0].fmtp, "tw-ts-001=1"); break; case CODEC_GSMHR_8000_1: - if (lchan->conn->user_plane.rtp_extensions & OSMO_RTP_EXT_TWTS002) + if (rtp_ext & OSMO_RTP_EXT_TWTS002) OSMO_STRLCPY_ARRAY(verb_info->ptmap[0].fmtp, "tw-ts-002=1"); break; + case CODEC_CLEARMODE: + /* There are no fmtp parameters for CSData - however, if + * TW-TS-007 compressed CSD format was requested by the CN, + * then we need to tell our MGW to use this format. But only + * on AoIP side - the representation of CSD toward IP-based BTS + * remains CLEARMODE until and unless we decide to implement + * TW-TS-007 compressed CSD format in OsmoBTS. */ + if ((rtp_ext & OSMO_RTP_EXT_TWTS007) && !bss_side) { + verb_info->ptmap[0].codec = CODEC_COMPR_CSD; + verb_info->ptmap[0].pt = OSMO_AOIP_RTP_PT_TWTS007; + } + break; default: break; } -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/41647?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I5d98309cfc5d443278479252846c66a7da8b4ce4 Gerrit-Change-Number: 41647 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • ...
  • 118
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.