fixeria has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31494 )
Change subject: msgb: use OSMO_ASSERT in msgb_alloc_headroom[_c]()
......................................................................
msgb: use OSMO_ASSERT in msgb_alloc_headroom[_c]()
This patch is a preparation for the upcoming change making use of
the built-in static_assert(), which is available since C11.
When using built-in static_assert(), gcc v12.2.1 fails:
include/osmocom/core/msgb.h: In function 'msgb_alloc_headroom_c':
include/osmocom/core/msgb.h:532:33: error: expression in static assertion is not constant
532 | osmo_static_assert(size >= headroom, headroom_bigger);
include/osmocom/core/utils.h:86:24: note: in definition of macro 'osmo_static_assert'
86 | static_assert((exp), "(" #exp ") failed")
| ^~~
include/osmocom/core/msgb.h: In function 'msgb_alloc_headroom':
include/osmocom/core/msgb.h:554:33: error: expression in static assertion is not constant
554 | osmo_static_assert(size >= headroom, headroom_bigger);
include/osmocom/core/utils.h:86:24: note: in definition of macro 'osmo_static_assert'
86 | static_assert((exp), "(" #exp ") failed")
| ^~~
These are not really *static* assert()s, because they operate on the
user supplied arguments 'size' and 'headroom', which are not guaranteed
to be integer literals. Neither they trigger compilation failures
as expected, nor do they abort at run-time. They simply do nothing.
Change-Id: I17ef4f3283ce20a5b452b7874c826acfb02a0123
---
M include/osmocom/core/msgb.h
1 file changed, 34 insertions(+), 2 deletions(-)
Approvals:
pespin: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h
index 3fdb189..2529c0e 100644
--- a/include/osmocom/core/msgb.h
+++ b/include/osmocom/core/msgb.h
@@ -529,7 +529,7 @@
static inline struct msgb *msgb_alloc_headroom_c(const void *ctx, uint16_t size, uint16_t headroom,
const char *name)
{
- osmo_static_assert(size >= headroom, headroom_bigger);
+ OSMO_ASSERT(size >= headroom);
struct msgb *msg = msgb_alloc_c(ctx, size, name);
if (OSMO_LIKELY(msg))
@@ -551,7 +551,7 @@
static inline struct msgb *msgb_alloc_headroom(uint16_t size, uint16_t headroom,
const char *name)
{
- osmo_static_assert(size >= headroom, headroom_bigger);
+ OSMO_ASSERT(size >= headroom);
struct msgb *msg = msgb_alloc(size, name);
if (OSMO_LIKELY(msg))
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31494
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I17ef4f3283ce20a5b452b7874c826acfb02a0123
Gerrit-Change-Number: 31494
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31495 )
Change subject: gsm: use OSMO_ASSERT() in osmo_iuup_msgb_alloc_c()
......................................................................
gsm: use OSMO_ASSERT() in osmo_iuup_msgb_alloc_c()
This patch is a preparation for the upcoming change making use of
the built-in static_assert(), which is available since C11.
When using built-in static_assert(), gcc v12.2.1 fails:
iuup.c: In function 'osmo_iuup_msgb_alloc_c':
iuup.c:194:33: error: expression in static assertion is not constant
194 | osmo_static_assert(size > IUUP_MSGB_HEADROOM_MIN_REQUIRED, iuup_msgb_alloc_headroom_bigger);
../../include/osmocom/core/utils.h:86:24: note: in definition of macro 'osmo_static_assert'
86 | static_assert((exp), "(" #exp ") failed")
| ^~~
This one is not really a *static* assert(), because it operates on the
user supplied argument 'size', which is not guaranteed to be an integer
literal. Neither it triggers a compilation failure as expected, nor
does it abort at run-time. It simply does nothing.
Change-Id: I53db679728250e0c60ed277efb18142073ffe9c4
---
M src/gsm/iuup.c
1 file changed, 27 insertions(+), 1 deletion(-)
Approvals:
pespin: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/gsm/iuup.c b/src/gsm/iuup.c
index c6a575e..16a6f5e 100644
--- a/src/gsm/iuup.c
+++ b/src/gsm/iuup.c
@@ -191,7 +191,7 @@
#define IUUP_MSGB_HEADROOM_MIN_REQUIRED (OSMO_MAX(sizeof(struct osmo_iuup_tnl_prim), sizeof(struct osmo_iuup_rnl_prim)) + (PTR_ALIGNMENT_BYTES - 1))
static inline struct msgb *osmo_iuup_msgb_alloc_c(void *ctx, size_t size)
{
- osmo_static_assert(size > IUUP_MSGB_HEADROOM_MIN_REQUIRED, iuup_msgb_alloc_headroom_bigger);
+ OSMO_ASSERT(size > IUUP_MSGB_HEADROOM_MIN_REQUIRED);
return msgb_alloc_headroom_c(ctx, size, IUUP_MSGB_HEADROOM_MIN_REQUIRED, "iuup-msgb");
}
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31495
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I53db679728250e0c60ed277efb18142073ffe9c4
Gerrit-Change-Number: 31495
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: neels.
Hello Jenkins Builder, laforge, fixeria,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-abis/+/31475
to look at the new patch set (#3).
Change subject: trau_pcu_ericsson: add comment about uplink blocks
......................................................................
trau_pcu_ericsson: add comment about uplink blocks
While testing each uplink block (CS1-C4, MCS1-MCS9) indvidually some
specific behaviour was observed.
Change-Id: I35b9a35c9b583378559daa400e105537338ee68a
Related: OS#5198
---
M include/osmocom/trau/trau_pcu_ericsson.h
1 file changed, 37 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/75/31475/3
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/31475
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I35b9a35c9b583378559daa400e105537338ee68a
Gerrit-Change-Number: 31475
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: neels, fixeria, msuraev.
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/31454 )
Change subject: trau_pcu_ericsson: add testvectors for MCS1-MCS8
......................................................................
Patch Set 3:
(2 comments)
Patchset:
PS2:
> would be nice maybe to say in the commit log how the new test vectors were obtained... […]
Yes, manually. Unfortunately I could not make the PCU to use MCS9 so that is still missing. MCS9 would have been important since it uses its own TRAU frame format.
File tests/trau_pcu_ericsson/trau_pcu_ericsson_test.c:
https://gerrit.osmocom.org/c/libosmo-abis/+/31454/comment/01eba544_0a5b898c
PS2, Line 2087: printf(" ccu_data_ind.tav=%02x\n", frame.u.ccu_data_ind.tav);
> that is true, and i wondered the same: why does this unit test not simply have an array with all tes […]
Since I receive a lot of criticism regarding the code duplication I will clean this up in a follow up patch. However, In general I think it is not worth the effort to optimize unit tests to the absolute maximum possible. But I see the point in this case. So lets merge this as it is to prevent merge conflicts in the follow up patch.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/31454
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I7e7e35930a373c9db74faef24f6c404eb5516278
Gerrit-Change-Number: 31454
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: msuraev <msuraev(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: msuraev <msuraev(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 27 Feb 2023 09:57:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: msuraev <msuraev(a)sysmocom.de>
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: neels, fixeria, msuraev.
Hello Jenkins Builder, neels, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-abis/+/31454
to look at the new patch set (#3).
Change subject: trau_pcu_ericsson: add testvectors for MCS1-MCS8
......................................................................
trau_pcu_ericsson: add testvectors for MCS1-MCS8
The testvectors were obtained manually from the uplink of an
Ericsson RBS RUS 02 B3. The TRAU frames were selected so that they
contain valid MAC blocks from live GPRS traffic.
Change-Id: I7e7e35930a373c9db74faef24f6c404eb5516278
Related: OS#5198
---
M tests/trau_pcu_ericsson/trau_pcu_ericsson_test.c
M tests/trau_pcu_ericsson/trau_pcu_ericsson_test.ok
2 files changed, 1,006 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/54/31454/3
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/31454
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I7e7e35930a373c9db74faef24f6c404eb5516278
Gerrit-Change-Number: 31454
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: msuraev <msuraev(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: msuraev <msuraev(a)sysmocom.de>
Gerrit-MessageType: newpatchset