kirr has posted comments on this change by kirr. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39537?usp=email )
Change subject: trx_toolkit/*: Try to avoid copying burst data where possible
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
Thanks.
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39537?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I147da2f110dedc863361059c931f609c28a69e9c
Gerrit-Change-Number: 39537
Gerrit-PatchSet: 2
Gerrit-Owner: kirr <kirr(a)nexedi.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 25 Feb 2025 12:57:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
kirr has posted comments on this change by kirr. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39536?usp=email )
Change subject: trx_toolkit/*: Represent bursts as arrays instead of lists
......................................................................
Patch Set 2:
(2 comments)
Patchset:
PS2:
Thanks for review and merging.
File src/target/trx_toolkit/data_msg.py:
https://gerrit.osmocom.org/c/osmocom-bb/+/39536/comment/559e8473_188bb5d9?u… :
PS2, Line 31: struct.unpack('b', struct.pack('B', x))[0]
> Alternatively, we could use `int.to_bytes()` / `int.from_bytes()` API here: […]
Performance does not matter here at all as _bu2s is used only at import time to construct `_tab_sbit2usbit` and `_tab_sbit2ubit` tables.
But anyway here is performance comparision of this two approaches:
```
In [2]: def _bu2s(x):
...: return struct.unpack('b', struct.pack('B', x))[0]
...:
In [3]: def V_bu2s(x): return int.from_bytes(x.to_bytes(1), signed=True)
In [6]: _bu2s(0x81)
Out[6]: -127
In [7]: V_bu2s(0x81)
Out[7]: -127
In [8]: %timeit _bu2s(0x81)
137 ns ± 1.21 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)
In [9]: %timeit V_bu2s(0x81)
162 ns ± 1.42 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)
```
so struct-based variant works a bit faster.
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39536?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I7314e9e79752e06fa86b9e346a9beacc5e59579e
Gerrit-Change-Number: 39536
Gerrit-PatchSet: 2
Gerrit-Owner: kirr <kirr(a)nexedi.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 25 Feb 2025 12:54:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
jolly has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/38513?usp=email )
Change subject: Release BSS connection when CC transaction fails
......................................................................
Release BSS connection when CC transaction fails
When the creation of the transaction structure fails, the MSC will
send a RELEASE COMPLETE message.
This patch ensures that the MSC_A use counter is decremented, so
that the BSS connection is released, if it is not used by any other
transaction.
Without this patch, the msc_a_fsm would wait 5 seconds for an initial
transaction before releasing the BSS connection.
Related: OS#6427
Change-Id: Icb893d5c1ce4c77a29259ce66189576dcaa5a44a
---
M src/libmsc/gsm_04_08_cc.c
1 file changed, 6 insertions(+), 0 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index e144b47..467305d 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -2649,6 +2649,9 @@
if (!vsub) {
LOG_TRANS(trans, LOGL_ERROR, "Invalid conn: no subscriber\n");
+ /* Decrement use counter that has been incremented by CM Service Request (CC).
+ * If there is no other service request, the BSS connection will be released. */
+ msc_a_put(msc_a, MSC_A_USE_CM_SERVICE_CC);
return -EINVAL;
}
@@ -2666,6 +2669,9 @@
rc = gsm48_tx_simple(msc_a,
GSM48_PDISC_CC | (transaction_id << 4),
GSM48_MT_CC_RELEASE_COMPL);
+ /* Decrement use counter that has been incremented by CM Service Request (CC).
+ * If there is no other service request, the BSS connection will be released. */
+ msc_a_put(msc_a, MSC_A_USE_CM_SERVICE_CC);
return -ENOMEM;
}
if (osmo_fsm_inst_dispatch(msc_a->c.fi, MSC_A_EV_TRANSACTION_ACCEPTED, trans)) {
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/38513?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Icb893d5c1ce4c77a29259ce66189576dcaa5a44a
Gerrit-Change-Number: 38513
Gerrit-PatchSet: 4
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
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: pespin <pespin(a)sysmocom.de>
jolly has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/38514?usp=email )
Change subject: Indicate error and release BSS connection when SMS transaction fails
......................................................................
Indicate error and release BSS connection when SMS transaction fails
When the creation of the transaction structure fails, the MSC will
send a CP-ERROR message.
This patch ensures that the MSC_A use counter is decremented, so
that the BSS connection is released, if it is not used by any other
transaction.
Without this patch, the msc_a_fsm would wait 5 seconds for an initial
transaction before releasing the BSS connection.
Related: OS#6427
Change-Id: I82da9c283205c69b19ceb4ba40ac5aa7f37d159b
---
M src/libmsc/gsm_04_11.c
1 file changed, 29 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index b6d5f4a..209ca28 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -231,6 +231,20 @@
return gsm411_sendmsg(trans, msg);
}
+int gsm411_send_cp_error(struct msc_a *msc_a, uint8_t pdisc, uint8_t cause)
+{
+ struct msgb *msg = gsm411_msgb_alloc();
+ struct gsm48_hdr *gh;
+
+ msgb_put_u8(msg, cause);
+
+ gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh));
+ gh->proto_discr = pdisc;
+ gh->msg_type = GSM411_MT_CP_ERROR;
+
+ return msc_a_tx_dtap_to_i(msc_a, msg);
+}
+
/* mm_send: receive MMCCSMS sap message from SMC */
static int gsm411_mm_send(struct gsm411_smc_inst *inst, int msg_type,
struct msgb *msg, int cp_msg_type)
@@ -1339,6 +1353,12 @@
"to us anymore. We are ignoring it, maybe a CP-ERROR "
"from a MS?\n",
transaction_id);
+ /* Decrement use counter that has been incremented by CM Service Request (SMS).
+ * If there is no other service request, the BSS connection will be released. */
+ if (!osmo_use_count_by(&msc_a->use_count, MSC_A_USE_CM_SERVICE_SMS))
+ LOG_TRANS(trans, LOGL_ERROR, "MO SMS without prior CM Service Request\n");
+ else
+ msc_a_put(msc_a, MSC_A_USE_CM_SERVICE_SMS);
return -EINVAL;
}
@@ -1346,7 +1366,15 @@
new_trans = 1;
trans = gsm411_trans_init(net, vsub, msc_a, transaction_id, true);
if (!trans) {
- /* FIXME: send some error message */
+ /* Send error message. */
+ gsm411_send_cp_error(msc_a, GSM48_PDISC_SMS | (transaction_id << 4),
+ GSM411_CP_CAUSE_NET_FAIL);
+ /* Decrement use counter that has been incremented by CM Service Request (SMS).
+ * If there is no other service request, the BSS connection will be released. */
+ if (!osmo_use_count_by(&msc_a->use_count, MSC_A_USE_CM_SERVICE_SMS))
+ LOG_TRANS(trans, LOGL_ERROR, "MO SMS without prior CM Service Request\n");
+ else
+ msc_a_put(msc_a, MSC_A_USE_CM_SERVICE_SMS);
return -ENOMEM;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/38514?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I82da9c283205c69b19ceb4ba40ac5aa7f37d159b
Gerrit-Change-Number: 38514
Gerrit-PatchSet: 6
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
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: pespin <pespin(a)sysmocom.de>
Attention is currently required from: laforge, lynxis lazus.
pespin has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/libosmocore/+/39557?usp=email )
Change subject: gprs: define OSMO_RESERVED_RAC 0xff
......................................................................
Patch Set 1:
(1 comment)
File include/osmocom/gsm/protocol/gsm_04_08_gprs.h:
https://gerrit.osmocom.org/c/libosmocore/+/39557/comment/29623828_391ca609?… :
PS1, Line 14: #define OSMO_RESERVED_RAC 0xff
> so basically pespins point would be to mark it GSM*_RESERVED_RAC instead of OSMO_RESERVED_RAC. […]
I'm actually more concerned about the comment in line 11 stating "osmocom specific". Having whatever defined prefixed as OSMO_ is fine (regardless of it being osmocom specific or not, simply for C namespacing..)
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39557?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I17a2adedc2c2ab158f40d58280f5df5c6967b8ec
Gerrit-Change-Number: 39557
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Tue, 25 Feb 2025 12:44:24 +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: lynxis lazus <lynxis(a)fe80.eu>