lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

December 2023

  • 1 participants
  • 1601 discussions
[S] Change in osmo-msc[master]: sdp: allow more space for fmtp
by laforge 10 Dec '23

10 Dec '23
Attention is currently required from: neels. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/35306?usp=email ) Change subject: sdp: allow more space for fmtp ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/35306?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: Ib9b9608d8d8f7ce34596a950dbc480e8a72ebf97 Gerrit-Change-Number: 35306 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Comment-Date: Sun, 10 Dec 2023 11:21:07 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: soft_uart: cosmetic: use consistent naming for the Rx buffer msgb
by laforge 10 Dec '23

10 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35295?usp=email ) Change subject: soft_uart: cosmetic: use consistent naming for the Rx buffer msgb ...................................................................... soft_uart: cosmetic: use consistent naming for the Rx buffer msgb In osmo_soft_uart_flush_rx() we use "soft_uart_rx", so be consistent. Change-Id: Id637a39bab8ecd04bca5580bb48f965b501f5b2e --- M src/core/soft_uart.c 1 file changed, 12 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/src/core/soft_uart.c b/src/core/soft_uart.c index 6cc8ab4..c6a6dbd 100644 --- a/src/core/soft_uart.c +++ b/src/core/soft_uart.c @@ -492,7 +492,7 @@ suart->rx.flow_state = SUART_FLOW_ST_IDLE; } else if (enable && !suart->rx.running) { if (!suart->rx.msg) - suart->rx.msg = msgb_alloc_c(suart, suart->cfg.rx_buf_size, "soft_uart rx"); + suart->rx.msg = msgb_alloc_c(suart, suart->cfg.rx_buf_size, "soft_uart_rx"); suart->rx.running = true; suart->rx.flow_state = SUART_FLOW_ST_IDLE; } -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35295?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Id637a39bab8ecd04bca5580bb48f965b501f5b2e Gerrit-Change-Number: 35295 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmocore[master]: tests/soft_uart: assert that osmo_soft_uart_rx_ubits() returns 0
by laforge 10 Dec '23

10 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35292?usp=email ) Change subject: tests/soft_uart: assert that osmo_soft_uart_rx_ubits() returns 0 ...................................................................... tests/soft_uart: assert that osmo_soft_uart_rx_ubits() returns 0 According to Coverity, we check return value of this function in all other cases except this one (9 out of 10 times), so let's add the missing assert(), just to be sure. Change-Id: I675f4089cc990be5fcda792276b6808742f6f0d7 Fixes: CID#336557 --- M tests/soft_uart/soft_uart_test.c 1 file changed, 17 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/tests/soft_uart/soft_uart_test.c b/tests/soft_uart/soft_uart_test.c index 0e84d5a..9ca9bd9 100644 --- a/tests/soft_uart/soft_uart_test.c +++ b/tests/soft_uart/soft_uart_test.c @@ -68,12 +68,14 @@ { for (unsigned int i = 0; input[i] != '\0'; i++) { ubit_t ubit; + int rc; switch (input[i]) { case '0': case '1': ubit = input[i] - '0'; - osmo_soft_uart_rx_ubits(suart, &ubit, 1); + rc = osmo_soft_uart_rx_ubits(suart, &ubit, 1); + OSMO_ASSERT(rc == 0); /* 0 on success */ break; case 'F': printf("%s() @ %u: flush the Rx buffer\n", __func__, i); -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35292?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I675f4089cc990be5fcda792276b6808742f6f0d7 Gerrit-Change-Number: 35292 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[M] Change in libosmocore[master]: tests/soft_uart: cosmetic: improve readability of the test output
by laforge 10 Dec '23

10 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35296?usp=email ) Change subject: tests/soft_uart: cosmetic: improve readability of the test output ...................................................................... tests/soft_uart: cosmetic: improve readability of the test output Change-Id: Icf5410f0b292d41532e0cbd17e6ca0509c76cbd5 --- M tests/soft_uart/soft_uart_test.c M tests/soft_uart/soft_uart_test.ok 2 files changed, 102 insertions(+), 61 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/soft_uart/soft_uart_test.c b/tests/soft_uart/soft_uart_test.c index 9ca9bd9..8c12dcd 100644 --- a/tests/soft_uart/soft_uart_test.c +++ b/tests/soft_uart/soft_uart_test.c @@ -24,6 +24,11 @@ #include <osmocom/core/utils.h> #include <osmocom/core/soft_uart.h> +#define SUART_TEST_BEGIN \ + do { \ + printf("\nExecuting %s\n", __func__); \ + } while (0) + static struct { size_t data_len; const uint8_t *data; @@ -96,15 +101,17 @@ struct osmo_soft_uart_cfg cfg; struct osmo_soft_uart *suart; + SUART_TEST_BEGIN; + suart = osmo_soft_uart_alloc(NULL, __func__, &suart_test_default_cfg); OSMO_ASSERT(suart != NULL); osmo_soft_uart_set_rx(suart, true); - printf("======== %s(): testing 8-N-1 (no data)\n", __func__); + printf("======== testing 8-N-1 (no data)\n"); test_rx_exec(suart, "F11111F11111F"); - printf("======== %s(): testing 8-N-1 (fill up flush)\n", __func__); + printf("======== testing 8-N-1 (fill up flush)\n"); cfg = suart_test_default_cfg; cfg.rx_buf_size = 4; osmo_soft_uart_configure(suart, &cfg); @@ -120,7 +127,7 @@ "F" /* flush! (for sanity) */ ); - printf("======== %s(): testing 8-N-1 (HELLO)\n", __func__); + printf("======== testing 8-N-1 (HELLO)\n"); cfg = suart_test_default_cfg; cfg.num_stop_bits = 1; osmo_soft_uart_configure(suart, &cfg); @@ -134,7 +141,7 @@ "0 11110010 1F" /* 'O', flush! */ ); - printf("======== %s(): testing 8-N-1 (framing errors)\n", __func__); + printf("======== testing 8-N-1 (framing errors)\n"); test_rx_exec(suart, "11111" /* no data */ "0 00000000 0" /* stop bit != 1, expect flush */ "0 01010101 0" /* stop bit != 1, expect flush */ @@ -142,7 +149,7 @@ "F" /* flush! */ ); - printf("======== %s(): testing 8-N-2 (HELLO)\n", __func__); + printf("======== testing 8-N-2 (HELLO)\n"); cfg = suart_test_default_cfg; cfg.num_stop_bits = 2; osmo_soft_uart_configure(suart, &cfg); @@ -156,7 +163,7 @@ "0 11110010 1F1F" /* 'O', flush! */ ); - printf("======== %s(): testing 8-N-2 (framing errors)\n", __func__); + printf("======== testing 8-N-2 (framing errors)\n"); test_rx_exec(suart, "11111" /* no data */ "0 00000000 00" /* stop bit != 1, expect flush */ "0 01010101 01" /* stop bit != 1, expect flush */ @@ -166,7 +173,7 @@ ); - printf("======== %s(): testing 8-E-1 (invalid parity)\n", __func__); + printf("======== testing 8-E-1 (invalid parity)\n"); cfg = suart_test_default_cfg; cfg.parity_mode = OSMO_SUART_PARITY_EVEN; osmo_soft_uart_configure(suart, &cfg); @@ -176,7 +183,7 @@ "0 11111111 1 1" /* odd parity, expect flush */ "F" /* flush! (for sanity) */ ); - printf("======== %s(): testing 8-E-1 (valid parity)\n", __func__); + printf("======== testing 8-E-1 (valid parity)\n"); test_rx_exec(suart, "1111111" /* no data */ "0 00000000 0 1" "0 11111111 0 1" @@ -190,7 +197,7 @@ "F" /* flush! */ ); - printf("======== %s(): testing 8-O-1 (invalid parity)\n", __func__); + printf("======== testing 8-O-1 (invalid parity)\n"); cfg = suart_test_default_cfg; cfg.parity_mode = OSMO_SUART_PARITY_ODD; osmo_soft_uart_configure(suart, &cfg); @@ -200,7 +207,7 @@ "0 11111111 0 1" /* even parity, expect flush */ "F" /* flush! (for sanity) */ ); - printf("======== %s(): testing 8-O-1 (valid parity)\n", __func__); + printf("======== testing 8-O-1 (valid parity)\n"); test_rx_exec(suart, "1111111" /* no data */ "0 00000000 1 1" "0 11111111 1 1" @@ -267,6 +274,8 @@ struct osmo_soft_uart *suart; int rc; + SUART_TEST_BEGIN; + suart = osmo_soft_uart_alloc(NULL, __func__, &suart_test_default_cfg); OSMO_ASSERT(suart != NULL); @@ -280,40 +289,40 @@ osmo_soft_uart_set_tx(suart, true); osmo_soft_uart_set_rx(suart, true); - printf("======== %s(): testing 8-N-1\n", __func__); + printf("======== testing 8-N-1\n"); test_tx_rx_exec(suart, (1 + 8 + 1)); - printf("======== %s(): testing 8-N-2\n", __func__); + printf("======== testing 8-N-2\n"); cfg = suart_test_default_cfg; cfg.num_stop_bits = 2; osmo_soft_uart_configure(suart, &cfg); test_tx_rx_exec(suart, (1 + 8 + 2)); - printf("======== %s(): testing 8-E-1\n", __func__); + printf("======== testing 8-E-1\n"); cfg = suart_test_default_cfg; cfg.parity_mode = OSMO_SUART_PARITY_EVEN; osmo_soft_uart_configure(suart, &cfg); test_tx_rx_exec(suart, (1 + 8 + 1 + 1)); - printf("======== %s(): testing 8-O-1\n", __func__); + printf("======== testing 8-O-1\n"); cfg = suart_test_default_cfg; cfg.parity_mode = OSMO_SUART_PARITY_ODD; osmo_soft_uart_configure(suart, &cfg); test_tx_rx_exec(suart, (1 + 8 + 1 + 1)); - printf("======== %s(): testing 8-M-1\n", __func__); + printf("======== testing 8-M-1\n"); cfg = suart_test_default_cfg; cfg.parity_mode = OSMO_SUART_PARITY_MARK; osmo_soft_uart_configure(suart, &cfg); test_tx_rx_exec(suart, (1 + 8 + 1 + 1)); - printf("======== %s(): testing 8-S-1\n", __func__); + printf("======== testing 8-S-1\n"); cfg = suart_test_default_cfg; cfg.parity_mode = OSMO_SUART_PARITY_SPACE; osmo_soft_uart_configure(suart, &cfg); test_tx_rx_exec(suart, (1 + 8 + 1 + 1)); - printf("======== %s(): testing 6-N-1\n", __func__); + printf("======== testing 6-N-1\n"); cfg = suart_test_default_cfg; cfg.num_data_bits = 6; osmo_soft_uart_configure(suart, &cfg); @@ -328,6 +337,8 @@ ubit_t tx_buf[32]; int rc; + SUART_TEST_BEGIN; + suart = osmo_soft_uart_alloc(NULL, __func__, &suart_test_default_cfg); OSMO_ASSERT(suart != NULL); @@ -337,14 +348,14 @@ g_tx_cb_cfg.data = (void *)"\x55"; g_tx_cb_cfg.data_len = 1; - printf("======== %s(): pulling %lu bits (%u at a time)\n", __func__, sizeof(tx_buf), n); + printf("======== pulling %lu bits (%u at a time)\n", sizeof(tx_buf), n); for (unsigned int i = 0; i < sizeof(tx_buf); i += n) { rc = osmo_soft_uart_tx_ubits(suart, &tx_buf[i], n); OSMO_ASSERT(rc == n); } printf("%s\n", osmo_ubit_dump(&tx_buf[0], sizeof(tx_buf))); - printf("======== %s(): feeding %lu bits into the receiver\n", __func__, sizeof(tx_buf)); + printf("======== feeding %lu bits into the receiver\n", sizeof(tx_buf)); rc = osmo_soft_uart_rx_ubits(suart, &tx_buf[0], sizeof(tx_buf)); OSMO_ASSERT(rc == 0); osmo_soft_uart_flush_rx(suart); @@ -357,11 +368,12 @@ struct osmo_soft_uart *suart; unsigned int status; + SUART_TEST_BEGIN; + suart = osmo_soft_uart_alloc(NULL, __func__, &suart_test_default_cfg); OSMO_ASSERT(suart != NULL); - printf("======== %s(): initial status=0x%08x\n", - __func__, osmo_soft_uart_get_status(suart)); + printf("initial status=0x%08x\n", osmo_soft_uart_get_status(suart)); printf("de-asserting DCD, which was not asserted\n"); osmo_soft_uart_set_status_line(suart, OSMO_SUART_STATUS_F_DCD, false); @@ -392,6 +404,8 @@ ubit_t tx_buf[40]; int rc; + SUART_TEST_BEGIN; + g_tx_cb_cfg.data = (void *)"\x42\x42\x42\x42"; g_tx_cb_cfg.data_len = 4; @@ -405,8 +419,7 @@ osmo_soft_uart_set_rx(suart, true); /* expect the initial status to be 0 (all lines de-asserted) */ - printf("======== %s(): initial status=0x%08x\n", - __func__, osmo_soft_uart_get_status(suart)); + printf("initial status=0x%08x\n", osmo_soft_uart_get_status(suart)); memset(&tx_buf[0], 1, sizeof(tx_buf)); /* pre-initialize */ @@ -420,7 +433,7 @@ osmo_soft_uart_flush_rx(suart); /* both DTR and DSR are asserted, expect both Rx and Tx to work */ - printf("======== %s(): asserting both DTR and DSR\n", __func__); + printf("======== asserting both DTR and DSR\n"); osmo_soft_uart_set_status_line(suart, OSMO_SUART_STATUS_F_DTR, true); osmo_soft_uart_set_status_line(suart, OSMO_SUART_STATUS_F_DSR, true); @@ -449,7 +462,7 @@ OSMO_ASSERT(rc == 2); /* CTS gets de-asserted, the transmitter is shutting down */ - printf("======== %s(): de-asserting DSR\n", __func__); + printf("======== de-asserting DSR\n"); osmo_soft_uart_set_status_line(suart, OSMO_SUART_STATUS_F_DSR, false); /* expect only the remaining 8 bits to be pulled out */ @@ -474,6 +487,8 @@ ubit_t tx_buf[40]; int rc; + SUART_TEST_BEGIN; + g_tx_cb_cfg.data = (void *)"\x42\x42\x42\x42"; g_tx_cb_cfg.data_len = 4; @@ -487,8 +502,7 @@ osmo_soft_uart_set_rx(suart, true); /* expect the initial status to be 0 (all lines de-asserted) */ - printf("======== %s(): initial status=0x%08x\n", - __func__, osmo_soft_uart_get_status(suart)); + printf("initial status=0x%08x\n", osmo_soft_uart_get_status(suart)); memset(&tx_buf[0], 1, sizeof(tx_buf)); /* pre-initialize */ @@ -502,7 +516,7 @@ osmo_soft_uart_flush_rx(suart); /* both RTS/RTR and CTS are asserted, expect both Rx and Tx to work */ - printf("======== %s(): asserting both CTS and RTS/RTR\n", __func__); + printf("======== asserting both CTS and RTS/RTR\n"); osmo_soft_uart_set_status_line(suart, OSMO_SUART_STATUS_F_CTS, true); osmo_soft_uart_set_status_line(suart, OSMO_SUART_STATUS_F_RTS_RTR, true); @@ -531,7 +545,7 @@ OSMO_ASSERT(rc == 2); /* CTS gets de-asserted, the transmitter is shutting down */ - printf("======== %s(): de-asserting CTS\n", __func__); + printf("======== de-asserting CTS\n"); osmo_soft_uart_set_status_line(suart, OSMO_SUART_STATUS_F_CTS, false); /* expect only the remaining 8 bits to be pulled out */ diff --git a/tests/soft_uart/soft_uart_test.ok b/tests/soft_uart/soft_uart_test.ok index 7922074..6edac16 100644 --- a/tests/soft_uart/soft_uart_test.ok +++ b/tests/soft_uart/soft_uart_test.ok @@ -1,12 +1,14 @@ -======== test_rx(): testing 8-N-1 (no data) + +Executing test_rx +======== testing 8-N-1 (no data) test_rx_exec() @ 0: flush the Rx buffer test_rx_exec() @ 6: flush the Rx buffer test_rx_exec() @ 12: flush the Rx buffer -======== test_rx(): testing 8-N-1 (fill up flush) +======== testing 8-N-1 (fill up flush) suart_rx_cb(flags=00): de ad be ef suart_rx_cb(flags=00): 00 aa 55 ff test_rx_exec() @ 101: flush the Rx buffer -======== test_rx(): testing 8-N-1 (HELLO) +======== testing 8-N-1 (HELLO) test_rx_exec() @ 18: flush the Rx buffer suart_rx_cb(flags=00): 48 test_rx_exec() @ 31: flush the Rx buffer @@ -17,12 +19,12 @@ suart_rx_cb(flags=00): 4c test_rx_exec() @ 96: flush the Rx buffer suart_rx_cb(flags=00): 4f -======== test_rx(): testing 8-N-1 (framing errors) +======== testing 8-N-1 (framing errors) suart_rx_cb(flags=01): 00 suart_rx_cb(flags=01): aa test_rx_exec() @ 41: flush the Rx buffer suart_rx_cb(flags=00): ff -======== test_rx(): testing 8-N-2 (HELLO) +======== testing 8-N-2 (HELLO) test_rx_exec() @ 20: flush the Rx buffer test_rx_exec() @ 22: flush the Rx buffer suart_rx_cb(flags=00): 48 @@ -38,35 +40,37 @@ test_rx_exec() @ 110: flush the Rx buffer test_rx_exec() @ 112: flush the Rx buffer suart_rx_cb(flags=00): 4f -======== test_rx(): testing 8-N-2 (framing errors) +======== testing 8-N-2 (framing errors) suart_rx_cb(flags=01): 00 suart_rx_cb(flags=01): aa suart_rx_cb(flags=01): 55 test_rx_exec() @ 57: flush the Rx buffer suart_rx_cb(flags=00): ff -======== test_rx(): testing 8-E-1 (invalid parity) +======== testing 8-E-1 (invalid parity) suart_rx_cb(flags=02): 00 suart_rx_cb(flags=02): 01 suart_rx_cb(flags=02): ff test_rx_exec() @ 49: flush the Rx buffer suart_rx_cb(flags=02): -======== test_rx(): testing 8-E-1 (valid parity) +======== testing 8-E-1 (valid parity) test_rx_exec() @ 63: flush the Rx buffer suart_rx_cb(flags=00): 00 ff aa 55 test_rx_exec() @ 120: flush the Rx buffer suart_rx_cb(flags=00): 80 e0 f8 fe -======== test_rx(): testing 8-O-1 (invalid parity) +======== testing 8-O-1 (invalid parity) suart_rx_cb(flags=02): 00 suart_rx_cb(flags=02): 01 suart_rx_cb(flags=02): ff test_rx_exec() @ 42: flush the Rx buffer suart_rx_cb(flags=02): -======== test_rx(): testing 8-O-1 (valid parity) +======== testing 8-O-1 (valid parity) test_rx_exec() @ 63: flush the Rx buffer suart_rx_cb(flags=00): 00 ff aa 55 test_rx_exec() @ 120: flush the Rx buffer suart_rx_cb(flags=00): 80 e0 f8 fe -======== test_tx_rx(): testing 8-N-1 + +Executing test_tx_rx +======== testing 8-N-1 suart_tx_cb(len=4/4): de ad be ef suart_rx_cb(flags=00): de ad be ef test_tx_rx_exec_one(n_bits_total=40): 0011110111 0101101011 0011111011 0111101111 @@ -81,7 +85,7 @@ test_tx_rx_exec_one(n_bits_total=40): 0000010001 0000001001 0000000101 0000000011 suart_tx_cb(len=0/4): test_tx_rx_exec_one(n_bits_total=40): 1111111111 1111111111 1111111111 1111111111 -======== test_tx_rx(): testing 8-N-2 +======== testing 8-N-2 suart_tx_cb(len=4/4): de ad be ef suart_rx_cb(flags=00): de ad be ef test_tx_rx_exec_one(n_bits_total=44): 00111101111 01011010111 00111110111 01111011111 @@ -96,7 +100,7 @@ test_tx_rx_exec_one(n_bits_total=44): 00000100011 00000010011 00000001011 00000000111 suart_tx_cb(len=0/4): test_tx_rx_exec_one(n_bits_total=44): 11111111111 11111111111 11111111111 11111111111 -======== test_tx_rx(): testing 8-E-1 +======== testing 8-E-1 suart_tx_cb(len=4/4): de ad be ef suart_rx_cb(flags=00): de ad be ef test_tx_rx_exec_one(n_bits_total=44): 00111101101 01011010111 00111110101 01111011111 @@ -111,7 +115,7 @@ test_tx_rx_exec_one(n_bits_total=44): 00000100011 00000010011 00000001011 00000000111 suart_tx_cb(len=0/4): test_tx_rx_exec_one(n_bits_total=44): 11111111111 11111111111 11111111111 11111111111 -======== test_tx_rx(): testing 8-O-1 +======== testing 8-O-1 suart_tx_cb(len=4/4): de ad be ef suart_rx_cb(flags=00): de ad be ef test_tx_rx_exec_one(n_bits_total=44): 00111101111 01011010101 00111110111 01111011101 @@ -126,7 +130,7 @@ test_tx_rx_exec_one(n_bits_total=44): 00000100001 00000010001 00000001001 00000000101 suart_tx_cb(len=0/4): test_tx_rx_exec_one(n_bits_total=44): 11111111111 11111111111 11111111111 11111111111 -======== test_tx_rx(): testing 8-M-1 +======== testing 8-M-1 suart_tx_cb(len=4/4): de ad be ef suart_rx_cb(flags=00): de ad be ef test_tx_rx_exec_one(n_bits_total=44): 00111101111 01011010111 00111110111 01111011111 @@ -141,7 +145,7 @@ test_tx_rx_exec_one(n_bits_total=44): 00000100011 00000010011 00000001011 00000000111 suart_tx_cb(len=0/4): test_tx_rx_exec_one(n_bits_total=44): 11111111111 11111111111 11111111111 11111111111 -======== test_tx_rx(): testing 8-S-1 +======== testing 8-S-1 suart_tx_cb(len=4/4): de ad be ef suart_rx_cb(flags=00): de ad be ef test_tx_rx_exec_one(n_bits_total=44): 00111101101 01011010101 00111110101 01111011101 @@ -156,7 +160,7 @@ test_tx_rx_exec_one(n_bits_total=44): 00000100001 00000010001 00000001001 00000000101 suart_tx_cb(len=0/4): test_tx_rx_exec_one(n_bits_total=44): 11111111111 11111111111 11111111111 11111111111 -======== test_tx_rx(): testing 6-N-1 +======== testing 6-N-1 suart_tx_cb(len=4/4): de ad be ef suart_rx_cb(flags=00): 1e 2d 3e 2f test_tx_rx_exec_one(n_bits_total=32): 00111101 01011011 00111111 01111011 @@ -171,36 +175,46 @@ test_tx_rx_exec_one(n_bits_total=32): 00000101 00000011 00000001 00000001 suart_tx_cb(len=0/4): test_tx_rx_exec_one(n_bits_total=32): 11111111 11111111 11111111 11111111 -======== test_tx_rx_pull_n(): pulling 32 bits (1 at a time) + +Executing test_tx_rx_pull_n +======== pulling 32 bits (1 at a time) suart_tx_cb(len=1/1): 55 suart_tx_cb(len=1/1): 55 suart_tx_cb(len=1/1): 55 suart_tx_cb(len=1/1): 55 01010101010101010101010101010101 -======== test_tx_rx_pull_n(): feeding 32 bits into the receiver +======== feeding 32 bits into the receiver suart_rx_cb(flags=00): 55 55 55 -======== test_tx_rx_pull_n(): pulling 32 bits (2 at a time) + +Executing test_tx_rx_pull_n +======== pulling 32 bits (2 at a time) suart_tx_cb(len=1/1): 55 suart_tx_cb(len=1/1): 55 suart_tx_cb(len=1/1): 55 suart_tx_cb(len=1/1): 55 01010101010101010101010101010101 -======== test_tx_rx_pull_n(): feeding 32 bits into the receiver +======== feeding 32 bits into the receiver suart_rx_cb(flags=00): 55 55 55 -======== test_tx_rx_pull_n(): pulling 32 bits (4 at a time) + +Executing test_tx_rx_pull_n +======== pulling 32 bits (4 at a time) suart_tx_cb(len=1/1): 55 suart_tx_cb(len=1/1): 55 suart_tx_cb(len=1/1): 55 01010101011101010101011101010101 -======== test_tx_rx_pull_n(): feeding 32 bits into the receiver +======== feeding 32 bits into the receiver suart_rx_cb(flags=00): 55 55 -======== test_tx_rx_pull_n(): pulling 32 bits (8 at a time) + +Executing test_tx_rx_pull_n +======== pulling 32 bits (8 at a time) suart_tx_cb(len=1/1): 55 suart_tx_cb(len=1/1): 55 01010101011111110101010101111111 -======== test_tx_rx_pull_n(): feeding 32 bits into the receiver +======== feeding 32 bits into the receiver suart_rx_cb(flags=00): 55 55 -======== test_modem_status(): initial status=0x00000000 + +Executing test_modem_status +initial status=0x00000000 de-asserting DCD, which was not asserted asserting both RI and DCD, expecting the callback to be called twice suart_status_change_cb(status=0x00000008) @@ -209,10 +223,12 @@ suart_status_change_cb(status=0x00000002) resetting to 0x00, expecting the callback to be called suart_status_change_cb(status=0x00000000) -======== test_flow_control_dtr_dsr(): initial status=0x00000000 + +Executing test_flow_control_dtr_dsr +initial status=0x00000000 expecting osmo_soft_uart_tx_ubits() to yield nothing expecting osmo_soft_uart_rx_ubits() to yield nothing -======== test_flow_control_dtr_dsr(): asserting both DTR and DSR +======== asserting both DTR and DSR suart_status_change_cb(status=0x00000001) suart_status_change_cb(status=0x00000005) expecting osmo_soft_uart_tx_ubits() to yield 40 bits (requesting 40 bits) @@ -222,15 +238,17 @@ suart_rx_cb(flags=00): 42 42 42 42 expecting osmo_soft_uart_tx_ubits() to yield 2 bits (requesting 2 bits) suart_tx_cb(len=1/1): 42 -======== test_flow_control_dtr_dsr(): de-asserting DSR +======== de-asserting DSR suart_status_change_cb(status=0x00000001) expecting osmo_soft_uart_tx_ubits() to yield 8 bits (requesting 40 bits) expecting osmo_soft_uart_rx_ubits() to consume 40 bits and yield a pending char suart_rx_cb(flags=00): 42 -======== test_flow_control_rts_cts(): initial status=0x00000000 + +Executing test_flow_control_rts_cts +initial status=0x00000000 expecting osmo_soft_uart_tx_ubits() to yield nothing expecting osmo_soft_uart_rx_ubits() to yield nothing -======== test_flow_control_rts_cts(): asserting both CTS and RTS/RTR +======== asserting both CTS and RTS/RTR suart_status_change_cb(status=0x00000020) suart_status_change_cb(status=0x00000030) expecting osmo_soft_uart_tx_ubits() to yield 40 bits (requesting 40 bits) @@ -240,7 +258,7 @@ suart_rx_cb(flags=00): 42 42 42 42 expecting osmo_soft_uart_tx_ubits() to yield 2 bits (requesting 2 bits) suart_tx_cb(len=1/1): 42 -======== test_flow_control_rts_cts(): de-asserting CTS +======== de-asserting CTS suart_status_change_cb(status=0x00000010) expecting osmo_soft_uart_tx_ubits() to yield 8 bits (requesting 40 bits) expecting osmo_soft_uart_rx_ubits() to consume 40 bits and yield a pending char -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35296?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Icf5410f0b292d41532e0cbd17e6ca0509c76cbd5 Gerrit-Change-Number: 35296 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[M] Change in libosmocore[master]: tests/soft_uart: cosmetic: improve readability of the test output
by laforge 10 Dec '23

10 Dec '23
Attention is currently required from: fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35296?usp=email ) Change subject: tests/soft_uart: cosmetic: improve readability of the test output ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35296?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Icf5410f0b292d41532e0cbd17e6ca0509c76cbd5 Gerrit-Change-Number: 35296 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Sun, 10 Dec 2023 11:20:31 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: tests/soft_uart: assert that osmo_soft_uart_rx_ubits() returns 0
by laforge 10 Dec '23

10 Dec '23
Attention is currently required from: fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35292?usp=email ) Change subject: tests/soft_uart: assert that osmo_soft_uart_rx_ubits() returns 0 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35292?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I675f4089cc990be5fcda792276b6808742f6f0d7 Gerrit-Change-Number: 35292 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Sun, 10 Dec 2023 11:20:14 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: soft_uart: cosmetic: use consistent naming for the Rx buffer msgb
by laforge 10 Dec '23

10 Dec '23
Attention is currently required from: fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35295?usp=email ) Change subject: soft_uart: cosmetic: use consistent naming for the Rx buffer msgb ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35295?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Id637a39bab8ecd04bca5580bb48f965b501f5b2e Gerrit-Change-Number: 35295 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Sun, 10 Dec 2023 11:19:42 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: core: fix wrong logic in _osmo_it_q_dequeue()
by laforge 10 Dec '23

10 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35294?usp=email ) Change subject: core: fix wrong logic in _osmo_it_q_dequeue() ...................................................................... core: fix wrong logic in _osmo_it_q_dequeue() If the given queue is empty, queue->list.next points to &queue->list. Current implementation would call llist_del() on the queue's llist_head, decrement queue->current_length (which will be 0), and return a pointer to &queue->list to the caller. This is completely wrong. - Use the existing item_dequeue(), which does exactly what we need. - Do not decrement the current_length if nothing was dequeued. - Uncomment code in the unit test, we should not crash anymore. Change-Id: I63094df73b166b549616c869ad908e9f4f7d46d1 Fixes: CID#336557 --- M src/core/it_q.c M tests/it_q/it_q_test.c M tests/it_q/it_q_test.ok 3 files changed, 25 insertions(+), 11 deletions(-) Approvals: jolly: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/core/it_q.c b/src/core/it_q.c index a3ff420..810dc90 100644 --- a/src/core/it_q.c +++ b/src/core/it_q.c @@ -245,7 +245,7 @@ /*! Thread-safe de-queue from an inter-thread message queue. * \param[in] queue Inter-thread queue from which to dequeue - * \returns dequeued message buffer; NULL if none available + * \returns llist_head of dequeued message; NULL if none available */ struct llist_head *_osmo_it_q_dequeue(struct osmo_it_q *queue) { @@ -254,12 +254,9 @@ pthread_mutex_lock(&queue->mutex); - if (llist_empty(&queue->list)) - l = NULL; - l = queue->list.next; - OSMO_ASSERT(l); - llist_del(l); - queue->current_length--; + l = item_dequeue(&queue->list); + if (l != NULL) + queue->current_length--; pthread_mutex_unlock(&queue->mutex); diff --git a/tests/it_q/it_q_test.c b/tests/it_q/it_q_test.c index 9545183..6025e39 100644 --- a/tests/it_q/it_q_test.c +++ b/tests/it_q/it_q_test.c @@ -81,11 +81,9 @@ q1 = osmo_it_q_alloc(OTC_GLOBAL, "q1", 12, NULL, NULL); OSMO_ASSERT(q1); -#if 0 printf("try dequeueing from an empty queue\n"); osmo_it_q_dequeue(q1, &item, list); OSMO_ASSERT(item == NULL); -#endif printf("adding queue entries up to the limit\n"); for (unsigned int i = 0; i < qlen; i++) { @@ -101,11 +99,9 @@ talloc_free(item); } -#if 0 printf("try dequeueing from an empty queue\n"); osmo_it_q_dequeue(q1, &item, list); OSMO_ASSERT(item == NULL); -#endif osmo_it_q_destroy(q1); } diff --git a/tests/it_q/it_q_test.ok b/tests/it_q/it_q_test.ok index 91ba0ce..e89b78d 100644 --- a/tests/it_q/it_q_test.ok +++ b/tests/it_q/it_q_test.ok @@ -11,8 +11,10 @@ == Entering test case tc_enqueue_dequeue allocating q1 +try dequeueing from an empty queue adding queue entries up to the limit removing queue entries up to the limit +try dequeueing from an empty queue == Entering test case tc_eventfd allocating q1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35294?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I63094df73b166b549616c869ad908e9f4f7d46d1 Gerrit-Change-Number: 35294 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[M] Change in libosmocore[master]: tests/it_q: add tc_enqueue/dequeue testcase
by laforge 10 Dec '23

10 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35293?usp=email ) Change subject: tests/it_q: add tc_enqueue/dequeue testcase ...................................................................... tests/it_q: add tc_enqueue/dequeue testcase This patch is adding a simple testcase, which does the following: * enqueue up to the limit (12 items), * dequeue up to the limit (12 items). Everything works as expected, unless you attempt to dequeue from an empty queue: the test binary segfaults. The problem is explained and fixed in a subsequent patch. Change-Id: Ie0edbf00e656fbe231952bdbccfd37d143e8b2b1 Related: CID#336557 --- M tests/it_q/it_q_test.c M tests/it_q/it_q_test.ok 2 files changed, 67 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/tests/it_q/it_q_test.c b/tests/it_q/it_q_test.c index 28e32d8..9545183 100644 --- a/tests/it_q/it_q_test.c +++ b/tests/it_q/it_q_test.c @@ -68,6 +68,48 @@ osmo_it_q_destroy(q1); } +static void tc_enqueue_dequeue(void) +{ + const unsigned int qlen = 12; + struct it_q_test1 *item; + struct osmo_it_q *q1; + int rc; + + ENTER_TC; + + printf("allocating q1\n"); + q1 = osmo_it_q_alloc(OTC_GLOBAL, "q1", 12, NULL, NULL); + OSMO_ASSERT(q1); + +#if 0 + printf("try dequeueing from an empty queue\n"); + osmo_it_q_dequeue(q1, &item, list); + OSMO_ASSERT(item == NULL); +#endif + + printf("adding queue entries up to the limit\n"); + for (unsigned int i = 0; i < qlen; i++) { + item = talloc_zero(OTC_GLOBAL, struct it_q_test1); + rc = osmo_it_q_enqueue(q1, item, list); + OSMO_ASSERT(rc == 0); + } + + printf("removing queue entries up to the limit\n"); + for (unsigned int i = 0; i < qlen; i++) { + osmo_it_q_dequeue(q1, &item, list); + OSMO_ASSERT(item != NULL); + talloc_free(item); + } + +#if 0 + printf("try dequeueing from an empty queue\n"); + osmo_it_q_dequeue(q1, &item, list); + OSMO_ASSERT(item == NULL); +#endif + + osmo_it_q_destroy(q1); +} + static int g_read_cb_count; static void q_read_cb(struct osmo_it_q *q, struct llist_head *item) @@ -115,6 +157,7 @@ { tc_alloc(); tc_queue_length(); + tc_enqueue_dequeue(); tc_eventfd(); return 0; } diff --git a/tests/it_q/it_q_test.ok b/tests/it_q/it_q_test.ok index 7f102c6..91ba0ce 100644 --- a/tests/it_q/it_q_test.ok +++ b/tests/it_q/it_q_test.ok @@ -9,6 +9,11 @@ adding queue entries up to the limit attempting to add more than the limit +== Entering test case tc_enqueue_dequeue +allocating q1 +adding queue entries up to the limit +removing queue entries up to the limit + == Entering test case tc_eventfd allocating q1 adding 30 queue entries up to the limit -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35293?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie0edbf00e656fbe231952bdbccfd37d143e8b2b1 Gerrit-Change-Number: 35293 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmocore[master]: core: fix wrong logic in _osmo_it_q_dequeue()
by laforge 10 Dec '23

10 Dec '23
Attention is currently required from: fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35294?usp=email ) Change subject: core: fix wrong logic in _osmo_it_q_dequeue() ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35294?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I63094df73b166b549616c869ad908e9f4f7d46d1 Gerrit-Change-Number: 35294 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Sun, 10 Dec 2023 11:19:22 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • ...
  • 161
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.