tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/36175?usp=email )
Change subject: icE1usb fw: Workaround some apparent GCC aliasing bug ...
......................................................................
icE1usb fw: Workaround some apparent GCC aliasing bug ...
If the code is built either :
* without -flto
* with -fno-strict-aliasing
* with that struct as 'static' (so it's not on the stack)
Then all works fine. But in the current situation (without the
patch), GCC seems to think there is some aliasing and just plain
removed the `notif.bits = 1` bit of code in that functions
(no warnings printed ...).
Putting the struct as 'static' is the least awful workaround.
I didn't bother reporting bug upstream, because I can't reproduce
on a small test case and I'm sure I'd just get yelled at and that
the compiler is right for some reason ...
Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com>
Change-Id: Ie0a2ce337ce4a9c08c3d27acc4d922a3e5892840
---
M firmware/ice40-riscv/icE1usb/usb_gps.c
1 file changed, 28 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/75/36175/1
diff --git a/firmware/ice40-riscv/icE1usb/usb_gps.c b/firmware/ice40-riscv/icE1usb/usb_gps.c
index f2b09b4..e219cf8 100644
--- a/firmware/ice40-riscv/icE1usb/usb_gps.c
+++ b/firmware/ice40-riscv/icE1usb/usb_gps.c
@@ -143,7 +143,8 @@
if ((ep_regs->bd[0].csr & USB_BD_STATE_MSK) != USB_BD_STATE_RDY_DATA)
{
/* Default request */
- struct usb_cdc_notif_serial_state notif = {
+ /* Put as static to work around gcc aliasing bug ... */
+ static struct usb_cdc_notif_serial_state notif = {
.hdr = {
.bmRequestType = USB_REQ_READ | USB_REQ_TYPE_CLASS | USB_REQ_RCPT_INTF,
.bRequest = USB_NOTIF_CDC_SERIAL_STATE,
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/36175?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: Ie0a2ce337ce4a9c08c3d27acc4d922a3e5892840
Gerrit-Change-Number: 36175
Gerrit-PatchSet: 1
Gerrit-Owner: tnt <tnt(a)246tNt.com>
Gerrit-MessageType: newchange
Attention is currently required from: laforge, pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36150?usp=email )
Change subject: stp: add testcases for M3UA-over-TCP
......................................................................
Patch Set 4:
(1 comment)
File stp/STP_Tests_M3UA.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36150/comment/c0b97bda_6934…
PS4, Line 1229: f_sleep(1.0);
> can you explain this?
In the case when `ASP[idx_b]` is configured as the client (i.e. osmo-stp connects to the testsuite; `idx_b >= NR_M3UA`), in `f_M3UA_CLNT_asp_up_act()` we're expecting to receive `ASPACT` and then sending `ASPACT_ACK` to it. Right after that, we're sending some random data via `ASP[idx_a]`, which we then expect to receive via `ASP[idx_b]` (see `f_test_traffic()`).
There is a chance that the random data sent via `ASP[idx_a]` would reach osmo-stp earlier than the `ASPUP_ACK` we sent for `ASP[idx_b]` -- this is what I was seeing when running `TC_m3ua_tcp_cli_srv`. In this test scenario only `ASP[idx_b]` is using TCP, and there is some delay likely caused by Nagle's algorithm.
It's not my invention (you can find `f_sleep(1.0)` in the code above), but it does help to avoid the race condition.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36150?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I1e2a887aa22f317783b3207494fd707d7b426439
Gerrit-Change-Number: 36150
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 06 Mar 2024 09:09:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: laforge, pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36148?usp=email )
Change subject: stp: add and use f_m3ua_{cli,srv}_config() helpers
......................................................................
Patch Set 2: Code-Review+2
(1 comment)
File stp/STP_Tests_M3UA.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36148/comment/97b5e5fb_99aa…
PS1, Line 110: mtc.stop;
> You are clearly not seeing the benefit because you are still using 2 lines to do something which can be done in one: [...]
I never liked doing it this way. The benefit of writing one long line doing several things in one go is questionable, especially when you need to log some values and thus have to use `log2str()`. We are not limited by the number of code lines, so I prefer using `setverdict()` explicitly, rather than hiding it behind the scenes of overloaded functions like `f_shutdown()`.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I9788f52c20574f4f9d015d2de11b5e42bb03d15f
Gerrit-Change-Number: 36148
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
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-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 06 Mar 2024 08:50:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: fixeria, laforge.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36148?usp=email )
Change subject: stp: add and use f_m3ua_{cli,srv}_config() helpers
......................................................................
Patch Set 2: Code-Review+1
(1 comment)
File stp/STP_Tests_M3UA.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36148/comment/60b16018_0828…
PS1, Line 110: mtc.stop;
> Done
You are clearly not seeing the benefit because you are still using 2 lines to do something which can be done in one:
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "f_m3ua_cli_config(): unexpected idx");
Anyway, +1 even if you don't seem eager to shrink it.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I9788f52c20574f4f9d015d2de11b5e42bb03d15f
Gerrit-Change-Number: 36148
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 05 Mar 2024 21:39:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: laforge, pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36150?usp=email )
Change subject: stp: add testcases for M3UA-over-TCP
......................................................................
Patch Set 4:
(1 comment)
File stp/STP_Tests_M3UA.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36150/comment/d422cb20_fd30…
PS1, Line 1279: execute( TC_m3ua_tcp_cli() );
> I intentionally want to execute these testcases here unconditionally, so that we will see that these […]
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36150?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I1e2a887aa22f317783b3207494fd707d7b426439
Gerrit-Change-Number: 36150
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 05 Mar 2024 20:50:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment