Commit Graph

8684 Commits

Author SHA1 Message Date
Vadim Yanitskiy f80361d167 tests: $(BUILT_SOURCES) is not defined, depend on osmo-bsc
Change-Id: I640dd2cd599707ad6bc661e7bea08372d85b47df
2023-03-31 10:46:04 +00:00
Pau Espin 27195c50a0 bts-rbs2k: Simplify osmo_fsm_inst_alloc_child_id()
Change-Id: I5344161e5a65ae9959684f0fda7f8b06cbb447f3
2023-03-31 12:13:43 +02:00
Pau Espin d38ccedad7 Move paging queue specific handling to signal callback outside RSL code
The signal is already there but not being used.
Let's further split generic paging code from RSL specificites.

Change-Id: Iabc1c29908a5136501d6dc6e60f8777dab511b86
2023-03-31 12:12:21 +02:00
Pau Espin 4de0769720 abis_rsl: Document spec ref of CCCH Load Ind
Change-Id: Iada13bb29688249eecbd492388a6d4b0cc95575d
2023-03-30 15:51:02 +02:00
arehbein 097925b626 main: Give specific error message
vty_read_config() returns an errno number or zero; add the appropriate error string in case of error

Change-Id: I0015824a29ebf8aaeaa996ab4d2cb2769ea48864
2023-03-25 08:04:25 +00:00
Pau Espin ad253850d8 Use new GSM0408 defines for half-octet tags
The old ones have been deprecated and shall not be used anymore·

Depends: libosmocore.git Change-Id I799e35dc8d4d153fa63bf50563a5482cdf4de2d7
Change-Id: Id3be8e38ec87ae39c4e1b4fab163563b24fb2cee
2023-03-25 01:12:25 +00:00
Philipp Maier 2365db4856 doc: bts-examples: discuss Ericsson RBS EGPRS configuration
Add a configuration file example to illustrate how exactly EGPRS is
configured on ericsson RBS BTSs.

Related: OS#5198
Change-Id: I2fb5b4d9300b16b0fac48f33b5db81442ab25031
2023-03-24 14:20:42 +01:00
Philipp Maier f99952c2b0 examples: update erissson GPRS config files
The example config files that illustrate how to set up GPRS/EGPRS using
a BSC co-located PCU do not have any of the general GPRS parameters set.
Lets add a gprs prameter block to both of them.

Related: OS#5198
Change-Id: Ifc538940fadca08d03a36bf6a28392f22640493d
2023-03-24 14:20:42 +01:00
Philipp Maier ccd69e9b2f doc: running: Describe how to configure a co-located PCU
The manual does not yet mention the possibility to configure a BSC
co-located PCU. Lets add a short description to the chapter
Running OsmoBSC, Configure primary Links that enables users to get an
idea where exactly the BSC co-located PCU has its place in the RAN
infrastructure and which links it is connected with. Also give a short
example how to setup the unix domain socket path.

A more detailed description, especially about the timeslot configuration
will be added with a follow up patch for bts.adoc

Related: OS#5198
Change-Id: I3af3cd8ef7099bb94f4cb25513e9dfdc5fcc1b5a
2023-03-24 14:20:42 +01:00
Philipp Maier 4743ea578c bts: bts: Explain Ericsson's interface switch (IS)
The built in interface switch in ericsson RBS base stations no where
explained. From the example configuration files alone it is not possible
to understand how the IS configuration works. Let's add a chapter that
explains how the IS configuration works.

Related: OS#5198
Change-Id: Ib6ebd7fdfe9063c0d8cacf53ffd27f6099d9038a
2023-03-24 14:20:42 +01:00
Neels Hofmeyr 25bbe8895c add location_services_fsm_bsc.dot
Change-Id: I3bdcc90c59459473a5f2e06d9018a2a98147a6b9
2023-03-22 09:58:47 +00:00
Neels Hofmeyr 7a0bef1ae4 segfault: verify lchan presence on Assignment Complete
User reports a SEGV:

 Program terminated with signal SIGSEGV, Segmentation fault.
 #0  send_assignment_complete (conn=conn@entry=0x557dbabb75a0) at assignment_fsm.c:188
 #1  0x0000557db66aa6b0 in assignment_success (conn=0x557dbabb75a0) at assignment_fsm.c:277
 #2  0x00007f6007afee82 in _osmo_fsm_inst_dispatch (fi=0x557db9615b80, event=4, data=0x0, file=0x7f6007a7dc21 "mgcp_client_endpoint_fsm.c", line=513) at fsm.c:875
 #3  0x00007f6007a78c12 in ?? () from /lib/x86_64-linux-gnu/libosmo-mgcp-client.so.9

 version: osmo-bsc 1.9.0.111.fc339.202212220009

The situation apparently is conn->lchan == NULL (primary lchan is gone),
but Assignment has just concluded. Apparently an unexpected / orthogonal
event has interrupted operations.

During assignment_success(), do not assume that conn->lchan is still
present. This should normally be true, but if not, fail the assignment
procedure instead of crashing osmo-bsc.

Related: SYS#6382
Change-Id: I4db25d0458f620954a1ca345282f5d8316341919
2023-03-22 09:22:58 +00:00
arehbein d7b277ff01 gsm_bts_check_ny1: Prevent possible division by zero
Do this by setting the minimal value for T3105 to 1 in its timer definition.

Fixes: Coverity scan CID#307389
Change-Id: I1fd0b92ab507a58fed6e9649eaa4770f1ad1cbad
2023-03-21 20:16:15 +00:00
Philipp Maier 64c0e6e11c doc: overview: replace section TRAU mapper / E1 sub-channel muxer
The manual contains a section about a TRAU mapper / E1 sub-channel
muxer. This section seems to be copied from the OsmoNITB manual. In
OsmoNITB everything was integrated in one binary, now dealing with TRAU
frames is the task of the MGW. Let's remove the section but still leave
a word about how Speech traffic is handled/relayed by OsmoBSC.

Change-Id: If33589feb80e1b29b4f841b678fe5329b8c06a76
2023-03-21 15:09:38 +01:00
Philipp Maier 563652890c doc: add sample configuration for GPRS with ericsson RBS
This patch contains a sample configuration for the 64K and the 16K CCU
mode.

Change-Id: I923608d4edc28b02e882c5f04851a29fc11bad4e
Related: OS#5198
2023-03-20 10:44:22 +01:00
Philipp Maier a288c9f420 pcuif_proto: increment version number
The co-located PCU support for Ericsson RBS E1 CCU made it necessary to
add new features to the PCU socket interface, so let's increase the
version number.

Change-Id: I8315bd67c7f3eb0d7ee71b64cd4dff889a84fcf1
Depends: osmo-pcu.git I2a78651593323e8b9627c39918d949a33497b70f
Related: OS#5198
2023-03-20 10:44:22 +01:00
Philipp Maier 0625172265 pcu_sock: handle multiple BTSs with one BSC co-located PCU (in theory)
The current PCU implementation has never been tested with multiple BTS
attached to it. This is due to the fact that it has been used
exclusively in an BTS co-located setup where naturally only one BTS is
present. The PCU sock protocol supports multiple BTSs in theory and we
should handle this correctly.

Related: OS#5198
Change-Id: I0b42c2c130106f6ffca2dd08d079e1a7bda41f0b
2023-03-20 10:44:22 +01:00
Philipp Maier 10ae64a777 pcu_sock.c: Call osmo_fd_unregister() before closing and changing listen_bfd->fd
Change-Id: I48e0411c4cba9897bc04865d22d8f68ed4fe87a2
2023-03-20 10:44:22 +01:00
Philipp Maier 2af29ae92d pcu_sock: drop usage of PCUIF flag PCU_IF_FLAG_DT
The flag PCU_IF_FLAG_DT is no longer needed. The PCU implementation will
distinguish by the version number instead.

Change-Id: I0dc20e351deb14906b2edffc39499bad9659cc35
Related: OS#5198
2023-03-20 10:44:22 +01:00
Philipp Maier ec7842f816 pcu_sock: check BTS type properly in pcu_info_update()
When updating the BTS information in the bsc co-located PCU, first check
if the BTS has a BSC co-located PCU at all. Also check if the BTS is E1
based since those type of BTS require extra information about the E1
connection.

Related: OS#5198
Change-Id: I8da26debc0e27f24fae4ee88f22f8875de13bc84
2023-03-20 09:42:05 +00:00
Philipp Maier c4ab940544 pcu_sock: use is_ericsson_bts() to check for ericsson BTS
Do not access bts->type directly, we have is_ericsson_bts() to do that

Related: OS#5198
Change-Id: I274a9f0f1208dc17713ba2e1c7a1110eeb133cca
2023-03-20 09:41:00 +00:00
Philipp Maier 4af073c109 bts: add function to check if a BTS has a BSC co located PCU
At the momemnt we use is_ericsson_bts() to check if the BTS uses a BSC
co-located PCU, this is a bit ambiguous, lets have a function that
explicitly checks for a BSC co-located PCU and nothing else.

Change-Id: I23ed4219e5ebd188867c17f387ca877efa9bc3b0
Related: OS#5198
2023-03-20 10:30:47 +01:00
Philipp Maier a10a34cf6a bts: is_xyz_bts check functions should return bool
The check functions that we use to distinguish between the various types
of BTSs return an integer that can be 0 or 1. Let's change the return
type to bool

Change-Id: I3de957f228452c9d3aa4fed342f73bfb17363b40
2023-03-20 09:29:31 +00:00
Neels Hofmeyr f2768d39c1 fix coverity (false) warning in codec-list vty
Since there were complaints about this old parsing code during recent
code review in Ifdc9e04bf1d623da65bfb8a2fddea765601f6d9b, and now also
coverity finds something odd in it, just rewrite this.

Related: CID#310912
Change-Id: I96cd5d88ec6808a2915c6bccd0c0140216f328f2
2023-03-18 02:08:03 +00:00
Neels Hofmeyr 2fda8dba70 vty: codec-list: fix error message
Change-Id: I89460229f894bfa67c6939dc3825f1865378d918
2023-03-18 02:08:03 +00:00
Pau Espin 9f7611a32f Fix Lb/A SCCP conn lookup after recent regression in optimization patch
In osmo-bsc, there's currently 0..1 Lb links and 0..N A links, where N
is the number of MSC, but links can be shared in the underlaying stack
(struct osmo_sccp_instance), hence range 0..N of different
osmo_sccp_instance (identified by PC).
Even more, the Lb and A link can share the same underlaying stack, so
osmo-bsc can end up with only 1 struct osmo_sccp_instance shared by all
the above mentioned links in case all are configured under the same PC.
Total range A+Lb is 0..(1+N).

A struct gsm_subscriber_conn stores 2 struct sccp_instance*, one for
Lb (conn->lcs.lb.*)and one for A (conn->sccp.*).
They can actually point to the same sccp_instance or to different ones,
as explained above, depending on the configured setup. In any case, a
gsm_subscriber_conn needs 2 rb_nodes since it can hold
any of the 2 conn_ids independently (A or Lb).

The previous patch forgot to add that 2nd rb_node as well as some
initialization and release code for the Lb conn. This patch addresses
that.

When the 2nd rb_node, a problem when iterating the rbtree appears: how to
find out the "conn" pointer from the rb_node pointer, since the rb_node pointer
can be any of the 2 rb_nodes inside the struct at a different offsets.

In order to solve that problem, a new struct bscp_sccp_conn_node is
added, which holds all the relevant information used by the rbtree lookup code
in a generic way (rb_node and conn_id), plus a backpointer to the struct
bsc_gsm_subcriber it relates too.

Fixes: 85062ccad3
Change-Id: If42d93adee71d646766929a09bc01ae92b734ef3
2023-03-17 18:08:26 +00:00
Vadim Yanitskiy cbf3e5d850 fix ipacc_rtp_csd_fmt_non_transp(): add missing breaks
Change-Id: I13adcabd26c5f6543681e418b87c70b2822e7dcf
Fixes: CID#310964, CID#310965, CID#310967
2023-03-17 16:42:34 +07:00
Vadim Yanitskiy f18397aac9 fix bs11_read_swl_file(): properly clean up stale file list
Calling talloc_free() on struct llist_head is wrong and will lead
to unexpected behavior.  Call it on the containing struct instead.

Change-Id: Ib5eaa328aaf6881ae9621ca14859e4e255af2b00
2023-03-16 06:17:08 +07:00
Pau Espin a4fd6d9371 bsc_subscriber: Optimize lookup of bsub by TMSI
It was found that on a busy osmo-bsc process (>1000 concurrent calls
spead over different BTSs), a good amount of time is spent iterating the
subscribers list trying to find a subscriber based on a TMSI (1.60% of
total CPU time used by osmo-bsc).

This patch introduces a new rbtree under struct bsc_subscr_store which
allows storing all the busbs ordered by TMSI.
This way, lookup time changes O(N) -> O(log(N)), at the expense of
increased insert/deletion time O(1) -> O(log(N)).

Related: SYS#6200
Change-Id: If27429e715ef4b327177e427249e68321a6e83cc
2023-03-15 10:45:13 +01:00
Pau Espin 08a7db6cd3 bsc_subscriber: Introduce bsc_subscriber_store object
This allows keeping the bsc_subscriber storage internals outside of main
gsm_network code, while easily allowing making the internal
implementation more complex (in order to optimize it in a follow-up
commit).
It is also nice since we get rid of uncommon procedures being used in
this code, like allocating an llist directly as a talloc context, etc.

Change-Id: I616e8872af4ac63a6985f8900909e324ba889192
2023-03-15 09:44:22 +00:00
Pau Espin 0c87d39faf bsc_subscriber: Mark functions used only internally as static
Change-Id: I846af993905aee0be75aa3021460b130362c6d3d
2023-03-15 09:44:22 +00:00
Pau Espin b4bbba72ad bsc_subscriber: Drop unused function bsc_subscr_find_by_mi()
Change-Id: I15a51fa8a5c30fd92b34ebb366d0a805f8902cd0
2023-03-15 09:44:22 +00:00
Pau Espin 1da0fcbbbc Move bsc_conn_by_bsub() and make it static
The function was currently in osmo_bsc_sigtran.c but was never used
there, and it really doesn't have any relation to that file.
Let's move it to the only place where it's used so far, and mark it as
static.

Change-Id: I8a8cef45aa378421e0ac328d3b29b9d194698a55
2023-03-15 09:44:22 +00:00
Pau Espin 85062ccad3 Optimize subscr_conns lookup
It was found that, on a busy osmo-bsc (>1000 concurrent calls spread over
several BTS), the CPU consumption looking up for gsm_subscriber_conn
based on SCCP conn_id can take a considerable amount of time (>5% of
osmo-bsc already taking 70% of the CPU time on the core it is running on).

The huge CPU consumption happens because a linear search is done (llist)
over the entire list of SCCP connections every time an SCCP message is
handled.

In order to optimize this lookup, this patch introduces a new struct
bsc_sccp_inst which becomes associated to the libosmo-sccp
osmo_sccp_instance. Each of this strucs maintains an rbtree of
gsm_subscriber_conn ordered by conn_id.
As a result algorithmic complexity adds O(log(N)) during insert, lookup
and delete of SCCP conns, but gets rid of O(N) previous lookup.
As a plus, finding a new conn_id now takes generally O(log(N)), while
before it used to take O(N).

Related: SYS#6200
Change-Id: I667d3ec1dad0ab7bc0fa4799d9611f3a914d07e5
2023-03-15 09:44:22 +00:00
Pau Espin 9c21dc3d16 pcu_sock.c: Call osmo_fd_unregister() before closing and changing bfd->fd
Change-Id: I4f72f4fa80249ed2caafc87b9fdf9926e0f31976
2023-03-14 12:56:49 +00:00
Pau Espin 646d21f2db Assert conn_id being looked up is inside expected range
Change-Id: Iffe580ad5f974fdbef7061a14306b50bd4875eb1
2023-03-13 11:58:49 +01:00
Pau Espin 53cd4ad5fc bscc_sccp: Small optimiztion in bsc_sccp_inst_next_conn_id()
Refactor the double loop to check a code path matching the sccp_instance
once instead of doing so for every subscr_conn.

If for instance let's say we have 1000 concurrent calls in progress,
which means we have 1000 subscr_conn, which means we at least do the
extra check regarding SMLC vs MSC 1000 times (at least, xN times if N
conn_id already used are already found).
That overhead happens every time a new subscr_conn is created (which in
a BSC with already 1000 concurrent calls can potentially happen quite
frequently).

Change-Id: Ic32b1eeb201fc51110e1ee130110824845f81e82
2023-03-13 11:58:49 +01:00
Pau Espin 8958269ea9 get_bsc_conn_by_conn_id(): Properly match sccp_instance
Function bsc_sccp_inst_next_conn_id() allocating conn_id creates address
spaces based on sccp_instance, aka conn_id values can be reused given
the sccp_instance (MSC) is different.

Hence, when looking up a bsc_conn based on a conn_id, it must also match
the sccp_instance, otherwise a bsc_conn from another MSC could be
returned.

Change-Id: I80a54bdec3973917e88483a62bfc2e968b8c0490
2023-03-13 11:58:49 +01:00
Pau Espin 06d1cff11a bscc_sccp: Avoid allocating conn_id 0x00FFFFFF
The 0x00FFFFFF source local reference is reserved in M3UA/SCCP, hence
avoid allocating a conn_id with that value since later on when reused as
a source local reference it would fail to be encoded.

Change-Id: I5c62bbfa89140d754edccb4404503cb70d5fde89
2023-03-13 11:58:49 +01:00
Pau Espin c5b7d94e0f Clarify type and values of sccp.conn_id
Currently, the conn_id is allocated in a range 0..0xffffff by
bsc_sccp_inst_next_conn_id(), and -1 means it is unset.

This means allocation expects "int" to be at least 32 bits integer,
in order to fit 24 bits for 0..0xffffff plus the -1.
Hence, let's define the variable as uint32_t, as already done in
libosmo-sccp. Use last value 0xFFFFFFFF ((uint32_t)-1) and avoid playing
with the value being unsigned sometimes and signed only for "unset"
value.

The value is actually already handled as unsigned (printed with %u) in
most places.

Change-Id: If019bcbc1e28929fe8d981fef9103835fc6ead2e
2023-03-13 11:58:49 +01:00
Vadim Yanitskiy 6b204ebd66 tests: use -no-install libtool flag to avoid ./lt-* scripts
This option should be used for any executables which are used only
for testing, or for generating other files and are consequently never
installed.  By specifying this option, we are telling Libtool that
the executable it links will only ever be executed from where it is
built in the build tree.  Libtool is usually able to considerably
speed up the link process for such executables.

Change-Id: I37f078bdc17e128298b956f493ff5c03ef476f98
2023-03-11 04:26:51 +07:00
Vadim Yanitskiy 2acc7b94d2 Makefile.am: remove unneeded AM_LDFLAGS with LIBS
Change-Id: I10150c00dbe69648b95ea4c414db0ad6c6bdd254
2023-03-11 03:56:01 +07:00
Pau Espin c90c63bec0 constify bsc_conn_by_bsub() ptr param
Change-Id: I44b1397e7771c803efdca6bf59750ca5568df365
2023-03-10 15:25:11 +01:00
Vadim Yanitskiy 30ecd0a767 ipaccess_drop_oml(): invalidate the feature vector
It's possible that a BTS gets disconnected, updated to a more recent
version or downgraded to an older version, and then connects to the
BSC again.  That more recent or older BTS version may have a different
set of supported features, so osmo-bsc must not trust the previously
reported feature vector.

Change-Id: Ie93af849d7771b4fff3cdf647c82510cd8543975
2023-03-10 13:43:43 +00:00
Pau Espin 39d214fab5 cosmetic: gsm_data.h: Fix typo in comment
Change-Id: Id59eb176551b2546ee6ff9c7f0eee4d8dd6ed199
2023-03-10 13:41:51 +00:00
Philipp Maier fcb9890675 timeslot_fsm: fix PDCH activation
All non ericsson BTSs we support use a BTS co-located PCU, so we must
not depend on a PCU connection in those cases.

Related: OS#5943
Fixes: ecf825dc ("pcu_sock: activate/deactivate PDCH on pcu reconnect")
Change-Id: I296dfacb451d7b9b5ef1cec940bc1a577f3c43ad
2023-03-09 12:47:15 +01:00
Oliver Smith 2689ad73a8 abis_rsl: CSD: add RTP_CSD_FMT IE to CRCX/MDCX
Related: OS#4393
Change-Id: I4964b268124d29354e252c2ee509866ae75fab6d
2023-03-08 11:52:12 +00:00
Philipp Maier 6d3da5401f pcu_sock: cosmetic: remove whitespace after type cast
Change-Id: Iddc1bd703b4a200202ffa87d24a167e3fe39da18
2023-03-07 12:54:58 +00:00
Philipp Maier 280ad4d966 pcu_sock: rename rc to fd
The variable rc holds the return code of accept(), which returns a file
descriptor on success. So lets call the variable "fd" to make this
clear.

Change-Id: Ic8d22c2af18477f110a3a9115434314ebca95b25
2023-03-07 12:54:58 +00:00
Philipp Maier 7630b88fb5 pcu_sock: improve logging
In many places we have a pointer to the BTS object, so we can use
LOG_BTS.

Change-Id: I4a3ff23ffccf803b1a97e3f2604d3b422c6d6afd
Related: OS#5198
2023-03-07 12:54:58 +00:00