laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32048 )
Change subject: rate_ctr: Add rate_ctr_add2() similar to rate_ctr_inc2()
......................................................................
rate_ctr: Add rate_ctr_add2() similar to rate_ctr_inc2()
The convenience wrapper relieves the caller from manually resolving
the individual counter, and instead specify just the counter group
and the index.
Change-Id: If93e8b4fb0b86a87358f32d2b45438ca1887e9f3
---
M include/osmocom/core/rate_ctr.h
1 file changed, 22 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
diff --git a/include/osmocom/core/rate_ctr.h b/include/osmocom/core/rate_ctr.h
index d944cc0..0a3eb2c 100644
--- a/include/osmocom/core/rate_ctr.h
+++ b/include/osmocom/core/rate_ctr.h
@@ -86,6 +86,15 @@
* \param inc quantity to increment \a ctr by */
void rate_ctr_add(struct rate_ctr *ctr, int inc);
+/*! Increment the counter by \a inc
+ * \param ctrg \ref rate_ctr_group of counter
+ * \param idx index into \a ctrg counter group
+ * \param inc quantity to increment \a ctr by */
+static inline void rate_ctr_add2(struct rate_ctr_group *ctrg, unsigned int idx, int inc)
+{
+ rate_ctr_add(rate_ctr_group_get_ctr(ctrg, idx), inc);
+}
+
/*! Increment the counter by 1
* \param ctr \ref rate_ctr to increment */
static inline void rate_ctr_inc(struct rate_ctr *ctr)
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32048
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If93e8b4fb0b86a87358f32d2b45438ca1887e9f3
Gerrit-Change-Number: 32048
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/32049 )
Change subject: doc: Add details regarding BSC co-location
......................................................................
doc: Add details regarding BSC co-location
As of now the manual only focusses on the BTS co-located scenario. Since
we recently introduced support for Ericsson RBS 2000/6000 base stations,
we also had to add support for the BSC co-located scenario. Let's update
the manual accordingly.
Related: OS#5198
Change-Id: Ib2a3b60849fd312b21073a3511b8ca36b4536343
---
M doc/manuals/chapters/configuration.adoc
M doc/manuals/chapters/overview.adoc
2 files changed, 103 insertions(+), 15 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/doc/manuals/chapters/configuration.adoc b/doc/manuals/chapters/configuration.adoc
index ca3963d..d1336e6 100644
--- a/doc/manuals/chapters/configuration.adoc
+++ b/doc/manuals/chapters/configuration.adoc
@@ -328,6 +328,25 @@
<1> Time out if the SGSN doesn't answer our RIM RAN-INFO request request after 500 ms
<2> Keep resolved remote neighbor System Information cached for 60 seconds
+[[cfg_e1_line]]
+=== Configuring E1 line for CCU access
+
+Depending on the configuration the PCU may require direct access to a BTS CCU
+(channel coding unit) via an E1 line. This is in particular the case when
+OsmoPCU runs in co-location with OsmoBSC.
+
+The exact timeslot configuration is passed to the PCU via the pcu_sock
+interface. Only basic E1 line settings are required. However, it is important
+that the E1 line number is the same as the E1 line number that is used in the
+timeslot configuration of OsmoBSC.
+
+.Example: Configure an E1 line
+----
+e1_input
+ e1_line 0 driver dahdi
+ e1_line 0 port 2
+ no e1_line 0 keepalive
+----
=== GPRS vs EGPRS considerations
diff --git a/doc/manuals/chapters/overview.adoc b/doc/manuals/chapters/overview.adoc
index 5b831d3..69d0672 100644
--- a/doc/manuals/chapters/overview.adoc
+++ b/doc/manuals/chapters/overview.adoc
@@ -2,14 +2,17 @@
=== About OsmoPCU
-OsmoPCU is the Osmocom implementation of the GPRS PCU (Packet Control
-Unit) element inside the GPRS network.
+OsmoPCU is the Osmocom implementation of the GPRS PCU (Packet Control Unit)
+element inside the GPRS network. Depending on the BTS type the PCU will be
+co-located within the BTS or run in co-location with the BSC.
-The OsmoPCU is co-located within the BTS and connects to OsmoBTS via its
-PCU socket interface.
+[[pcu_co_located_with_bts]]
+==== OsmoPCU in co-location with OsmoBTS
-On the other side, OsmoPCU is connected via the Gb interface to the
-SGSN.
+In most OsmoPCU-supported base stations, the PCU is co-located with the BTS.
+In this scenario OsmoPCU and OsmoBTS run on the same host system. Both are
+interconnected using a unix domain socket based interface.
+(see also: <<pcu_sock_iface>>)
[[fig-gprs-pcubts]]
.GPRS network architecture with PCU in BTS
@@ -31,12 +34,62 @@
}
----
+NOTE: Depending on the hardware architecture, OsmoPCU may also have direct
+access on the PHY interface to exchange PDCH traffic efficiently. The socket
+interface is then only used for signalling.
+
+==== OsmoPCU in co-location with OsmoBSC
+
+Classic E1 based BTSs usually do not include a PCU. Instead those base stations
+typically rely on an external PCU that is co-located with the BSC. The
+signalling traffic (paging, channel assignments ect.) is then exchanged with the
+BTS via RSL, while the PDCH traffic is handled by the PCU through a dedicated
+TRAU frame based E1 connection.
+
+OsmoPCU supports this scenario as well. Due to the dedicated E1 connection, the
+implementation is complex and strongly hardware specific. As of now (March 2023)
+OsmoPCU supports Ericsson RBS2000/RBS6000 only. This implementation has been
+made possible through funding by the NLnet Foundation.
+
+[[fig-gprs-pcubts]]
+.GPRS network architecture with PCU in BTS
+[graphviz]
+----
+digraph G {
+ rankdir=LR;
+ MS0 [label="MS"]
+ MS1 [label="MS"]
+ MS0->BTS [label="Um"]
+ MS1->BTS [label="Um"]
+ BTS->BSC [label="Abis"]
+ BSC->MSC [label="A"]
+ BTS->PCU [label="pcu_sock"]
+ PCU->SGSN [label="Gb"]
+ SGSN->GGSN [label="GTP"]
+ PCU [color=red]
+ { rank=same BTS PCU }
+}
+----
+
+When OsmoPCU runs in co-location to OsmoBSC, both are connected through the
+same unix domain socket interface as mentioned above.
+(see also: <<pcu_co_located_with_bts>>) The socket is used to pass signalling
+traffic between PCU and BSC while the PCU controls the PDCH by directly talking
+to the BTS CCU (channel coding unit) through a dedicated E1 connection. The
+E1 line interface uses TRAU frames and is vastly comparable to the interface that
+is used when speech is transferred.
+
+Since the PCU is mainly set up by OsmoBSC (or OsmoBTS) via the PCU socket, the
+configuration in the BSC co-located scenario is no different from the BTS
+co-located scenario. However, since the PCU requires a direct E1 connection to
+the BTS an E1 line must be set up. (See also: <<cfg_e1_line>>)
+
=== Software Components
OsmoPCU consists of a variety of components, including
* Gb interface (NS/BSSGP protocol)
-* `pcu_sock` interface towards OsmoBTS
+* `pcu_sock` interface towards OsmoBTS (or OsmoBSC)
* TBF management for uplink and downlink TBF
* RLC/MAC protocol implementation
* per-MS context for each MS currently served
@@ -53,17 +106,18 @@
Gb implementation to be used from OsmoPCU, OsmoGbProxy as well as
OsmoSGSN.
-==== `pcu_sock` Interface to OsmoBTS
+[[pcu_sock_iface]]
+==== `pcu_sock` Interface to OsmoBTS/OsmoBSC
-The interface towards OsmoBTS is called 'pcu_sock' and implemented as a
-set of non-standardized primitives over a unix domain socket. The
+The interface towards OsmoBTS/OsmoBSC is called 'pcu_sock' and implemented
+as a set of non-standardized primitives over a unix domain socket. The
default file system path for this socket is `/tmp/pcu_bts`.
-The PCU socket can be changed on both OsmoBTS and OsmoPCU to a different
-file/path name, primarily to permit running multiple independent BTS+PCU
-pairs on a single Linux machine without having to use filesystem
-namespaces or other complex configurations.
+The PCU socket path can be freely configured to a different file/path name,
+primarily to permit running multiple independent BTS+PCU (or BSC+PCU) pairs
+on a single Linux machine without having to use filesystem namespaces or other
+complex configurations.
-NOTE: If you change the PCU socket path on OsmoBTS by means of the
+NOTE: If you change the PCU socket path on OsmoBTS/OsmoBSC by means of the
`pcu-socket` VTY configuration command, you must ensure to make the
identical change on the OsmoPCU side.
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/32049
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Ib2a3b60849fd312b21073a3511b8ca36b4536343
Gerrit-Change-Number: 32049
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: laforge, pespin.
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/32049 )
Change subject: doc: Add details regarding BSC co-location
......................................................................
Patch Set 3:
(1 comment)
File doc/manuals/chapters/overview.adoc:
https://gerrit.osmocom.org/c/osmo-pcu/+/32049/comment/c4f15cd2_6353b3e6
PS2, Line 12: In small base stations, the PCU is usually co-located inside the BTS. In this
> Size has nothing to do with it. It's an architectural decision. […]
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/32049
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Ib2a3b60849fd312b21073a3511b8ca36b4536343
Gerrit-Change-Number: 32049
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 24 Mar 2023 19:03:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: pespin, dexter.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-pcu/+/32049
to look at the new patch set (#4).
Change subject: doc: Add details regarding BSC co-location
......................................................................
doc: Add details regarding BSC co-location
As of now the manual only focusses on the BTS co-located scenario. Since
we recently introduced support for Ericsson RBS 2000/6000 base stations,
we also had to add support for the BSC co-located scenario. Let's update
the manual accordingly.
Related: OS#5198
Change-Id: Ib2a3b60849fd312b21073a3511b8ca36b4536343
---
M doc/manuals/chapters/configuration.adoc
M doc/manuals/chapters/overview.adoc
2 files changed, 103 insertions(+), 15 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/49/32049/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/32049
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Ib2a3b60849fd312b21073a3511b8ca36b4536343
Gerrit-Change-Number: 32049
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newpatchset
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/31991 )
Change subject: osmo-bts-{sysmo,lc15,oc2g}: fix segfault in ph_tch_req()
......................................................................
osmo-bts-{sysmo,lc15,oc2g}: fix segfault in ph_tch_req()
ph_tch_req() is a recursive function and conditionally calls itself at
the very bottom. The recursive call happens iff all of the following
conditions are met:
* DTXd is enabled,
* AMR codec is in use,
* DTX DL AMR FSM state is recursive.
The problem is that ph_tch_req() may pull sizeof(*lsap) from the given
msgb twice: during the initial and the recursive calls. The second
attempt to pull sizeof(*lsap) causes the process to abort, because
the remaining room is less than it's attempting to pull.
AFAICT, doing msgb_pull() is not really necessary, given that
l1sap_tch_rts_ind() thankfully does set msg->l2h before pushing
the lsap header in front of the actual frame.
Update osmo-bts-sysmo and its copy-pasted siblings, which are likely
affected too, except osmo-bts-octphy which does not do the recursion.
Change-Id: Ib349b74a9e4bd48c902286f872d3b0e9a068256c
Related: OS#5925
---
M src/osmo-bts-lc15/l1_if.c
M src/osmo-bts-oc2g/l1_if.c
M src/osmo-bts-octphy/l1_if.c
M src/osmo-bts-sysmo/l1_if.c
4 files changed, 34 insertions(+), 8 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
keith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/osmo-bts-lc15/l1_if.c b/src/osmo-bts-lc15/l1_if.c
index ac165b8..987b6e3 100644
--- a/src/osmo-bts-lc15/l1_if.c
+++ b/src/osmo-bts-lc15/l1_if.c
@@ -508,7 +508,6 @@
/* create new message and fill data */
if (msg) {
- msgb_pull(msg, sizeof(*l1sap));
/* create new message */
nmsg = l1p_msgb_alloc();
if (!nmsg)
@@ -517,7 +516,7 @@
rc = l1if_tch_encode(lchan,
l1p->u.phDataReq.msgUnitParam.u8Buffer,
&l1p->u.phDataReq.msgUnitParam.u8Size,
- msg->data, msg->len, u32Fn, use_cache,
+ msgb_l2(msg), msgb_l2len(msg), u32Fn, use_cache,
l1sap->u.tch.marker);
if (rc < 0) {
/* no data encoded for L1: smth will be generated below */
diff --git a/src/osmo-bts-oc2g/l1_if.c b/src/osmo-bts-oc2g/l1_if.c
index 194f82a..3308a46 100644
--- a/src/osmo-bts-oc2g/l1_if.c
+++ b/src/osmo-bts-oc2g/l1_if.c
@@ -561,7 +561,6 @@
/* create new message and fill data */
if (msg) {
- msgb_pull(msg, sizeof(*l1sap));
/* create new message */
nmsg = l1p_msgb_alloc();
if (!nmsg)
@@ -570,7 +569,7 @@
rc = l1if_tch_encode(lchan,
l1p->u.phDataReq.msgUnitParam.u8Buffer,
&l1p->u.phDataReq.msgUnitParam.u8Size,
- msg->data, msg->len, u32Fn, use_cache,
+ msgb_l2(msg), msgb_l2len(msg), u32Fn, use_cache,
l1sap->u.tch.marker);
if (rc < 0) {
/* no data encoded for L1: smth will be generated below */
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index 110f8a3..4898eb6 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -593,7 +593,6 @@
return -ENOMEM;
}
- msgb_pull(msg, sizeof(*l1sap));
tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD *data_req =
(tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD *)
msgb_put(nmsg, sizeof(*data_req));
@@ -615,7 +614,7 @@
&data_req->Data.ulPayloadType,
data_req->Data.abyDataContent,
&data_req->Data.ulDataLength,
- msg->data, msg->len);
+ msgb_l2(msg), msgb_l2len(msg));
mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD_SWAP(data_req);
} else {
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 5c99824..646cf01 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -505,7 +505,6 @@
/* create new message and fill data */
if (msg) {
- msgb_pull(msg, sizeof(*l1sap));
/* create new message */
nmsg = l1p_msgb_alloc();
if (!nmsg)
@@ -514,7 +513,7 @@
rc = l1if_tch_encode(lchan,
l1p->u.phDataReq.msgUnitParam.u8Buffer,
&l1p->u.phDataReq.msgUnitParam.u8Size,
- msg->data, msg->len, u32Fn, use_cache,
+ msgb_l2(msg), msgb_l2len(msg), u32Fn, use_cache,
l1sap->u.tch.marker);
if (rc < 0) {
/* no data encoded for L1: smth will be generated below */
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/31991
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib349b74a9e4bd48c902286f872d3b0e9a068256c
Gerrit-Change-Number: 31991
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: keith <keith(a)rhizomatica.org>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged