Projects
osmocom:master
osmo-bts
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 125
View file
osmo-bts.spec
Changed
@@ -14,13 +14,13 @@ Name: osmo-bts Requires: osmocom-master -Version: 1.6.0.150.4c3b4 +Version: 1.6.0.151.c938 Release: 0 Summary: Osmocom BTS-Side code (Abis, scheduling) License: AGPL-3.0-or-later AND GPL-2.0-only Group: Productivity/Telephony/Servers URL: https://osmocom.org/projects/osmobts -Source: osmo-bts_1.6.0.150.4c3b4.tar.xz +Source: osmo-bts_1.6.0.151.c938.tar.xz Source1: rpmlintrc BuildRequires: autoconf BuildRequires: automake
View file
commit_4c3b4e2868dba83f1450b2bf9d0e48b93a0e2d6f.txt
Deleted
View file
commit_c938a95e255262f38aae9d4242cc86a87c46d172.txt
Added
View file
osmo-bts_1.6.0.150.4c3b4.dsc -> osmo-bts_1.6.0.151.c938.dsc
Changed
@@ -2,7 +2,7 @@ Source: osmo-bts Binary: osmo-bts, osmo-bts-trx, osmo-bts-trx-dbg, osmo-bts-virtual, osmo-bts-virtual-dbg, osmo-bts-doc Architecture: any all -Version: 1.6.0.150.4c3b4 +Version: 1.6.0.151.c938 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/osmobts Standards-Version: 3.9.8 @@ -17,8 +17,8 @@ osmo-bts-virtual deb net optional arch=any osmo-bts-virtual-dbg deb debug extra arch=any Checksums-Sha1: - a796cc31f3754016fc1742c9edef8ccca2cd6e13 474744 osmo-bts_1.6.0.150.4c3b4.tar.xz + 683eaf0d2f8dcf9a5513585655982aacf658a057 474660 osmo-bts_1.6.0.151.c938.tar.xz Checksums-Sha256: - df622eecb33a131cd54aa8687a2406fd13f1fe9ee0ff651435b65827ce497cc6 474744 osmo-bts_1.6.0.150.4c3b4.tar.xz + 40c92f565b9216b3a745b87f3bb5b5fcc64d779872d1d8575c4b4e8962895ee4 474660 osmo-bts_1.6.0.151.c938.tar.xz Files: - df816ea22cd31b4a9c15a10d9813cf1c 474744 osmo-bts_1.6.0.150.4c3b4.tar.xz + e1c646c2eb1ebb5174a7b579e3c4add9 474660 osmo-bts_1.6.0.151.c938.tar.xz
View file
osmo-bts_1.6.0.150.4c3b4.tar.xz/.tarball-version -> osmo-bts_1.6.0.151.c938.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.6.0.150-4c3b4 +1.6.0.151-c938
View file
osmo-bts_1.6.0.150.4c3b4.tar.xz/debian/changelog -> osmo-bts_1.6.0.151.c938.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -osmo-bts (1.6.0.150.4c3b4) unstable; urgency=medium +osmo-bts (1.6.0.151.c938) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom master feed - -- Osmocom OBS scripts <info@osmocom.org> Wed, 28 Jun 2023 16:36:12 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Sun, 02 Jul 2023 17:55:34 +0000 osmo-bts (1.6.0) unstable; urgency=medium
View file
osmo-bts_1.6.0.150.4c3b4.tar.xz/include/osmo-bts/bts.h -> osmo-bts_1.6.0.151.c938.tar.xz/include/osmo-bts/bts.h
Changed
@@ -137,6 +137,8 @@ char *addr; }; +#define BTS_PCU_SOCK_WQUEUE_LEN_DEFAULT 10 + /* One BTS */ struct gsm_bts { /* list header in g_bts_sm->bts_list */
View file
osmo-bts_1.6.0.150.4c3b4.tar.xz/src/common/pcu_sock.c -> osmo-bts_1.6.0.151.c938.tar.xz/src/common/pcu_sock.c
Changed
@@ -31,6 +31,7 @@ #include <osmocom/core/utils.h> #include <osmocom/core/select.h> #include <osmocom/core/socket.h> +#include <osmocom/core/write_queue.h> #include <osmocom/gsm/gsm23003.h> #include <osmocom/gsm/abis_nm.h> #include <osmo-bts/logging.h> @@ -962,15 +963,17 @@ struct pcu_sock_state { struct osmo_fd listen_bfd; /* fd for listen socket */ - struct osmo_fd conn_bfd; /* fd for connection to lcr */ - struct llist_head upqueue; /* queue for sending messages */ + struct osmo_wqueue upqueue; /* For sending messages; has fd for conn. to PCU */ }; +static void pcu_sock_close(struct pcu_sock_state *state); + int pcu_sock_send(struct msgb *msg) { struct pcu_sock_state *state = g_bts_sm->gprs.pcu_state; struct osmo_fd *conn_bfd; struct gsm_pcu_if *pcu_prim = (struct gsm_pcu_if *) msg->data; + int rc; if (!state) { if (pcu_prim->msg_type != PCU_IF_MSG_TIME_IND && @@ -980,7 +983,7 @@ msgb_free(msg); return -EINVAL; } - conn_bfd = &state->conn_bfd; + conn_bfd = &state->upqueue.bfd; if (conn_bfd->fd <= 0) { if (pcu_prim->msg_type != PCU_IF_MSG_TIME_IND && pcu_prim->msg_type != PCU_IF_MSG_INTERF_IND) @@ -989,15 +992,22 @@ msgb_free(msg); return -EIO; } - msgb_enqueue(&state->upqueue, msg); - osmo_fd_write_enable(conn_bfd); + rc = osmo_wqueue_enqueue(&state->upqueue, msg); + if (rc < 0) { + if (rc == -ENOSPC) + LOGP(DPCU, LOGL_NOTICE, "PCU not reacting (more than %u messages waiting). Closing connection\n", + state->upqueue.max_length); + pcu_sock_close(state); + msgb_free(msg); + return rc; + } return 0; } static void pcu_sock_close(struct pcu_sock_state *state) { - struct osmo_fd *bfd = &state->conn_bfd; + struct osmo_fd *bfd = &state->upqueue.bfd; struct gsm_bts *bts; struct gsm_bts_trx *trx; unsigned int tn; @@ -1043,11 +1053,7 @@ } } - /* flush the queue */ - while (!llist_empty(&state->upqueue)) { - struct msgb *msg = msgb_dequeue(&state->upqueue); - msgb_free(msg); - } + osmo_wqueue_clear(&state->upqueue); } static int pcu_sock_read(struct osmo_fd *bfd) @@ -1096,59 +1102,34 @@ return -1; } -static int pcu_sock_write(struct osmo_fd *bfd) +static int pcu_sock_write(struct osmo_fd *bfd, struct msgb *msg) { struct pcu_sock_state *state = bfd->data; - struct msgb *msg; int rc; - while ((msg = msgb_dequeue(&state->upqueue))) { - /* bug hunter 8-): maybe someone forgot msgb_put(...) ? */ - OSMO_ASSERT(msgb_length(msg) > 0); - - /* try to send it over the socket */ - rc = write(bfd->fd, msgb_data(msg), msgb_length(msg)); - if (OSMO_UNLIKELY(rc == 0)) - goto close; - if (OSMO_UNLIKELY(rc < 0)) { - if (errno == EAGAIN) { - /* Re-insert at the start of the queue, skip disabling fd WRITE */ - llist_add(&msg->list, &state->upqueue); - return 0; - } - goto close; - } - msgb_free(msg); + /* bug hunter 8-): maybe someone forgot msgb_put(...) ? */ + OSMO_ASSERT(msgb_length(msg) > 0); + /* try to send it over the socket */ + rc = write(bfd->fd, msgb_data(msg), msgb_length(msg)); + if (OSMO_UNLIKELY(rc == 0)) + goto close; + if (OSMO_UNLIKELY(rc < 0)) { + if (errno == EAGAIN) + return -EAGAIN; + return -1; } - osmo_fd_write_disable(bfd); return 0; close: - msgb_free(msg); pcu_sock_close(state); return -1; } -static int pcu_sock_cb(struct osmo_fd *bfd, unsigned int flags) -{ - int rc = 0; - - if (flags & OSMO_FD_READ) - rc = pcu_sock_read(bfd); - if (rc < 0) - return rc; - - if (flags & OSMO_FD_WRITE) - rc = pcu_sock_write(bfd); - - return rc; -} - /* accept connection coming from PCU */ static int pcu_sock_accept(struct osmo_fd *bfd, unsigned int flags) { struct pcu_sock_state *state = (struct pcu_sock_state *)bfd->data; - struct osmo_fd *conn_bfd = &state->conn_bfd; + struct osmo_fd *conn_bfd = &state->upqueue.bfd; struct sockaddr_un un_addr; socklen_t len; int fd; @@ -1168,7 +1149,7 @@ return 0; } - osmo_fd_setup(conn_bfd, fd, OSMO_FD_READ, pcu_sock_cb, state, 0); + osmo_fd_setup(conn_bfd, fd, OSMO_FD_READ, osmo_wqueue_bfd_cb, state, 0); if (osmo_fd_register(conn_bfd) != 0) { LOGP(DPCU, LOGL_ERROR, "Failed to register new connection fd\n"); @@ -1195,8 +1176,10 @@ if (!state) return -ENOMEM; - INIT_LLIST_HEAD(&state->upqueue); - state->conn_bfd.fd = -1; + osmo_wqueue_init(&state->upqueue, BTS_PCU_SOCK_WQUEUE_LEN_DEFAULT); + state->upqueue.read_cb = pcu_sock_read; + state->upqueue.write_cb = pcu_sock_write; + state->upqueue.bfd.fd = -1; bfd = &state->listen_bfd; @@ -1237,7 +1220,7 @@ return; osmo_signal_unregister_handler(SS_GLOBAL, pcu_if_signal_cb, NULL); - conn_bfd = &state->conn_bfd; + conn_bfd = &state->upqueue.bfd; if (conn_bfd->fd > 0) pcu_sock_close(state); bfd = &state->listen_bfd; @@ -1252,7 +1235,7 @@ if (!state) return false; - if (state->conn_bfd.fd <= 0) + if (state->upqueue.bfd.fd <= 0) return false; return true; }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.