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

November 2022

  • 2 participants
  • 2503 discussions
Change in simtrace2[master]: firmware/sniffer: Add + use 16bit ringbuffer
by Jenkins Builder 16 Nov '22

16 Nov '22
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/simtrace2/+/30192 ) Change subject: firmware/sniffer: Add + use 16bit ringbuffer ...................................................................... Patch Set 1: (2 comments) File firmware/libcommon/include/ringbuffer.h: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-1073): https://gerrit.osmocom.org/c/simtrace2/+/30192/comment/1a973922_030f7d2a PS1, Line 40: typedef struct ringbuf16 { do not add new typedefs File firmware/libcommon/source/ringbuffer.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-1073): https://gerrit.osmocom.org/c/simtrace2/+/30192/comment/2929bf77_9fa9a863 PS1, Line 147: } else { else is not generally useful after a break or return -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30192 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: Ifde054fbfe7f753b61e7d3409c56eca6e0faeb4b Gerrit-Change-Number: 30192 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Wed, 16 Nov 2022 18:05:36 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in simtrace2[master]: firmware/sniffer: Pass PARITY/OVERRUN/FRAMING error via ringbuffer
by laforge 16 Nov '22

16 Nov '22
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/30193 ) Change subject: firmware/sniffer: Pass PARITY/OVERRUN/FRAMING error via ringbuffer ...................................................................... firmware/sniffer: Pass PARITY/OVERRUN/FRAMING error via ringbuffer those kind of errors should be passed to the main loop for further processing, in-order together with the byte stream received from the USART. Change-Id: Iebd9bbc97c2a5a0c402e7a2711520299a1ade568 --- M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/source/sniffer.c 2 files changed, 37 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/93/30193/1 diff --git a/firmware/libcommon/include/simtrace_prot.h b/firmware/libcommon/include/simtrace_prot.h index 5c43b06..d1eb89b 100644 --- a/firmware/libcommon/include/simtrace_prot.h +++ b/firmware/libcommon/include/simtrace_prot.h @@ -313,6 +313,9 @@ #define SNIFF_DATA_FLAG_ERROR_INCOMPLETE (1<<5) #define SNIFF_DATA_FLAG_ERROR_MALFORMED (1<<6) #define SNIFF_DATA_FLAG_ERROR_CHECKSUM (1<<7) +#define SNIFF_DATA_FLAG_ERROR_OVERRUN (1<<8) +#define SNIFF_DATA_FLAG_ERROR_FRAMING (1<<9) +#define SNIFF_DATA_FLAG_ERROR_PARITY (1<<10) /* SIMTRACE_MSGT_SNIFF_CHANGE */ struct sniff_change { diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index bea4d95..e87e9b8 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -111,6 +111,11 @@ TPDU_S_SW2, /*!< second status word */ }; +/*! Error flags we use to report USART errors via the ringbuffer */ +#define RBUF16_F_OVERRUN 0x0100 +#define RBUF16_F_FRAMING 0x0200 +#define RBUF16_F_PARITY 0x0400 + /*------------------------------------------------------------------------------ * Internal variables *------------------------------------------------------------------------------*/ @@ -818,23 +823,32 @@ /* Read channel status register */ uint32_t csr = sniff_usart.base->US_CSR; - /* Verify if there was an error */ - if (csr & US_CSR_OVRE) - TRACE_ERROR("USART overrun error\n\r"); - if (csr & US_CSR_FRAME) - TRACE_ERROR("USART framing error\n\r"); - if (csr & US_CSR_PARE) - TRACE_ERROR("USART parity error\n\r"); - if (csr & (US_CSR_OVRE|US_CSR_FRAME|US_CSR_PARE)) - sniff_usart.base->US_CR |= US_CR_RSTSTA; + + uint16_t byte = 0; + bool byte_received = false; /* Verify if character has been received */ if (csr & US_CSR_RXRDY) { + byte_received = true; /* Read communication data byte between phone and SIM */ - uint8_t byte = sniff_usart.base->US_RHR; + byte = sniff_usart.base->US_RHR; /* Reset WT timer */ wt_remaining = g_wt; - /* Store sniffed data into buffer (also clear interrupt */ + } + + /* Verify if there was an error */ + if (csr & US_CSR_OVRE) + byte |= RBUF16_F_OVERRUN; + if (csr & US_CSR_FRAME) + byte |= RBUF16_F_FRAMING; + if (csr & US_CSR_PARE) + byte |= RBUF16_F_PARITY; + + if (csr & (US_CSR_OVRE|US_CSR_FRAME|US_CSR_PARE)) + sniff_usart.base->US_CR |= US_CR_RSTSTA; + + /* Store sniffed data (or error flags, or both) into buffer */ + if (byte_received || byte) { if (rbuf16_write(&sniff_buffer, byte) != 0) TRACE_ERROR("USART buffer full\n\r"); } @@ -1008,7 +1022,8 @@ */ /* Handle sniffed data */ if (!rbuf16_is_empty(&sniff_buffer)) { /* use if instead of while to let the main loop restart the watchdog */ - uint8_t byte = rbuf16_read(&sniff_buffer); + uint16_t entry = rbuf16_read(&sniff_buffer); + uint8_t byte = entry & 0xff; /* Convert convention if required */ if (convention_convert) { byte = convention_convert_lut[byte]; @@ -1046,6 +1061,13 @@ default: TRACE_ERROR("Data received in unknown state %u\n\r", iso_state); } + + if (entry & RBUF16_F_PARITY) + TRACE_ERROR("USART PARITY Error\r\n"); + if (entry & RBUF16_F_FRAMING) + TRACE_ERROR("USART FRAMING Error\r\n"); + if (entry & RBUF16_F_OVERRUN) + TRACE_ERROR("USART OVERRUN Error\r\n"); } /* Handle flags */ -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30193 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: Iebd9bbc97c2a5a0c402e7a2711520299a1ade568 Gerrit-Change-Number: 30193 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
Change in simtrace2[master]: firmware/sniffer: Add + use 16bit ringbuffer
by laforge 16 Nov '22

16 Nov '22
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/30192 ) Change subject: firmware/sniffer: Add + use 16bit ringbuffer ...................................................................... firmware/sniffer: Add + use 16bit ringbuffer So far, we use a uint8_t ring buffer as "FIFO" between USART Rx interrupt and main context. That's fine for expressing the bytes we receive. However, if we also want to report USART errors synchronously in that stream, we actually need more bits to express those. Reporting USART errors via the ring buffer is the only way how the sniffer code can know in which TPDU the error occurred. Reporting them any other way (global variable, ...) would loose the timing relationship where in the received stream the error occurred. This change just changes the ringbuffer from 1024-entry 8bit to 512-entry 16bit and doesn't add any error reporting. Change-Id: Ifde054fbfe7f753b61e7d3409c56eca6e0faeb4b --- M firmware/libcommon/include/ringbuffer.h M firmware/libcommon/source/ringbuffer.c M firmware/libcommon/source/sniffer.c 3 files changed, 88 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/92/30192/1 diff --git a/firmware/libcommon/include/ringbuffer.h b/firmware/libcommon/include/ringbuffer.h index 51af3b2..99fe96b 100644 --- a/firmware/libcommon/include/ringbuffer.h +++ b/firmware/libcommon/include/ringbuffer.h @@ -32,4 +32,22 @@ bool rbuf_is_empty(volatile ringbuf * rb); bool rbuf_is_full(volatile ringbuf * rb); + +/* same as above but with 16bit values instead of 8bit */ + +#define RING16_BUFLEN 512 + +typedef struct ringbuf16 { + uint16_t buf[RING16_BUFLEN]; + size_t ird; + size_t iwr; +} ringbuf16; + +void rbuf16_reset(volatile ringbuf16 * rb); +uint16_t rbuf16_read(volatile ringbuf16 * rb); +uint16_t rbuf16_peek(volatile ringbuf16 * rb); +int rbuf16_write(volatile ringbuf16 * rb, uint16_t item); +bool rbuf16_is_empty(volatile ringbuf16 * rb); +bool rbuf16_is_full(volatile ringbuf16 * rb); + #endif /* end of include guard: SIMTRACE_RINGBUF_H */ diff --git a/firmware/libcommon/source/ringbuffer.c b/firmware/libcommon/source/ringbuffer.c index 591d31f..d3690be 100644 --- a/firmware/libcommon/source/ringbuffer.c +++ b/firmware/libcommon/source/ringbuffer.c @@ -28,6 +28,16 @@ local_irq_restore(state); } +void rbuf16_reset(volatile ringbuf16 * rb) +{ + unsigned long state; + + local_irq_save(state); + rb->ird = 0; + rb->iwr = 0; + local_irq_restore(state); +} + uint8_t rbuf_read(volatile ringbuf * rb) { unsigned long state; @@ -41,21 +51,49 @@ return val; } +uint16_t rbuf16_read(volatile ringbuf16 * rb) +{ + unsigned long state; + uint16_t val; + + local_irq_save(state); + val = rb->buf[rb->ird]; + rb->ird = (rb->ird + 1) % RING16_BUFLEN; + local_irq_restore(state); + + return val; +} + uint8_t rbuf_peek(volatile ringbuf * rb) { return rb->buf[rb->ird]; } +uint16_t rbuf16_peek(volatile ringbuf16 * rb) +{ + return rb->buf[rb->ird]; +} + bool rbuf_is_empty(volatile ringbuf * rb) { return rb->ird == rb->iwr; } +bool rbuf16_is_empty(volatile ringbuf16 * rb) +{ + return rb->ird == rb->iwr; +} + static bool __rbuf_is_full(volatile ringbuf * rb) { return rb->ird == (rb->iwr + 1) % RING_BUFLEN; } +static bool __rbuf16_is_full(volatile ringbuf16 * rb) +{ + return rb->ird == (rb->iwr + 1) % RING16_BUFLEN; +} + bool rbuf_is_full(volatile ringbuf * rb) { unsigned long state; @@ -68,6 +106,18 @@ return rc; } +bool rbuf16_is_full(volatile ringbuf16 * rb) +{ + unsigned long state; + bool rc; + + local_irq_save(state); + rc = rb->ird == (rb->iwr + 1) % RING16_BUFLEN; + local_irq_restore(state); + + return rc; +} + int rbuf_write(volatile ringbuf * rb, uint8_t item) { unsigned long state; @@ -84,4 +134,18 @@ } } +int rbuf16_write(volatile ringbuf16 * rb, uint16_t item) +{ + unsigned long state; + local_irq_save(state); + if (!__rbuf16_is_full(rb)) { + rb->buf[rb->iwr] = item; + rb->iwr = (rb->iwr + 1) % RING16_BUFLEN; + local_irq_restore(state); + return 0; + } else { + local_irq_restore(state); + return -1; + } +} diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 153c483..bea4d95 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -138,7 +138,7 @@ .state = USART_RCV, }; /*! Ring buffer to store sniffer communication data */ -static struct ringbuf sniff_buffer; +static struct ringbuf16 sniff_buffer; /* Flags to know is the card status changed (see SIMTRACE_MSGT_DT_SNIFF_CHANGE flags) */ static volatile uint32_t change_flags = 0; @@ -291,7 +291,7 @@ update_wt(10, 1, "RESET"); /* reset WT time-out */ break; case ISO7816_S_WAIT_ATR: - rbuf_reset(&sniff_buffer); /* reset buffer for new communication */ + rbuf16_reset(&sniff_buffer); /* reset buffer for new communication */ break; case ISO7816_S_IN_ATR: g_atr.atr_i = 0; @@ -835,7 +835,7 @@ /* Reset WT timer */ wt_remaining = g_wt; /* Store sniffed data into buffer (also clear interrupt */ - if (rbuf_write(&sniff_buffer, byte) != 0) + if (rbuf16_write(&sniff_buffer, byte) != 0) TRACE_ERROR("USART buffer full\n\r"); } @@ -941,7 +941,7 @@ PIO_EnableIt(&pin_rst); /* Clear ring buffer containing the sniffed data */ - rbuf_reset(&sniff_buffer); + rbuf16_reset(&sniff_buffer); /* Configure USART to as ISO-7816 slave communication to sniff communication */ ISO7816_Init(&sniff_usart, CLK_SLAVE); /* Only receive data when sniffing */ @@ -1007,8 +1007,8 @@ * is remaining */ /* Handle sniffed data */ - if (!rbuf_is_empty(&sniff_buffer)) { /* use if instead of while to let the main loop restart the watchdog */ - uint8_t byte = rbuf_read(&sniff_buffer); + if (!rbuf16_is_empty(&sniff_buffer)) { /* use if instead of while to let the main loop restart the watchdog */ + uint8_t byte = rbuf16_read(&sniff_buffer); /* Convert convention if required */ if (convention_convert) { byte = convention_convert_lut[byte]; -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30192 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: Ifde054fbfe7f753b61e7d3409c56eca6e0faeb4b Gerrit-Change-Number: 30192 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: osmux: Obey current batch_size restrictions when creating forged RTP ...
by pespin 16 Nov '22

16 Nov '22
Attention is currently required from: pespin. Hello osmith, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-netif/+/30174 to look at the new patch set (#2). Change subject: osmux: Obey current batch_size restrictions when creating forged RTP packets to fill holes ...................................................................... osmux: Obey current batch_size restrictions when creating forged RTP packets to fill holes osmux_link_add() is renamed to osmux_link_handle_rtp_req(), and the last part of it is split out and kept as osmux_link_add(). hence osmux_link_handle_rtp_req() does proper input checking (like duplicates, holes, etc.) while osmux_link_add() expects all that to be sorted out. Reuse osmux_link_add() in osmux_replay_lost_packets() to properly update the link state of the to-be-transmitted packet, circuit state, etc. Change-Id: I4ea435bfb2490a375ad3e5068ee926e48b53cf5c --- M src/osmux_input.c 1 file changed, 116 insertions(+), 109 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/74/30174/2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30174 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I4ea435bfb2490a375ad3e5068ee926e48b53cf5c Gerrit-Change-Number: 30174 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in libosmo-netif[master]: tests/osmux: Test big seqnum holes (>batch_factor) in incoming RTP st...
by pespin 16 Nov '22

16 Nov '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30191 ) Change subject: tests/osmux: Test big seqnum holes (>batch_factor) in incoming RTP stream ...................................................................... tests/osmux: Test big seqnum holes (>batch_factor) in incoming RTP stream This test shows that there's a bug in the osmux_input code, since it should set the M bit of the generated osmux header after the seqnum jump in order to announce a jump in the stream to the peer receiving osmux. Related: SYS#6161 Change-Id: I521c2e97a739e8a824b16f06ec2a578333388247 --- M tests/osmux/osmux_input_test.c M tests/osmux/osmux_input_test.ok 2 files changed, 238 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/91/30191/1 diff --git a/tests/osmux/osmux_input_test.c b/tests/osmux/osmux_input_test.c index aaab557..eb2fb79 100644 --- a/tests/osmux/osmux_input_test.c +++ b/tests/osmux/osmux_input_test.c @@ -491,7 +491,7 @@ talloc_free(h_input); } -/* Test some scenario where some RTP packets are lost */ +/* Test some scenario where one RTP packet is lost */ static void test_rtp_pkt_gap_osmux_deliver_cb(struct msgb *batch_msg, void *data) { struct osmux_hdr *osmuxh; @@ -574,6 +574,122 @@ talloc_free(h_input); } +/* Test some scenario where some RTP packets (>batch_factor) are lost */ +static void test_rtp_pkt_gap_bigger_than_batch_factor_osmux_deliver_cb(struct msgb *batch_msg, void *data) +{ + struct osmux_hdr *osmuxh; + char buf[2048]; + unsigned *osmux_transmitted = (unsigned *)data; + (*osmux_transmitted)++; + + osmux_snprintf(buf, sizeof(buf), batch_msg); + clock_debug("OSMUX message %u (len=%d): %s\n", *osmux_transmitted, batch_msg->len, buf); + + /* We expect 1 batch: */ + osmuxh = osmux_xfrm_output_pull(batch_msg); + /* Check seqnum is the one configured beforehand: */ + OSMO_ASSERT(osmuxh->seq == (123 + *osmux_transmitted - 1)); + /* Check four AMR payloads appear: */ + OSMO_ASSERT(osmuxh->ctr == 3); + + /* Second osmux frame: is it expected to have the Marker bit set, since + * there was an incoming RTP jump between this resulting osmux frame and + * the previous one. */ + if (*osmux_transmitted == 2) + OSMO_ASSERT(osmuxh->rtp_m == 0); /* FIXME: This should be 1! Fix osmux_input.c code! */ + + osmuxh = osmux_xfrm_output_pull(batch_msg); + OSMO_ASSERT(osmuxh == NULL); + + msgb_free(batch_msg); +} +static void test_rtp_pkt_gap_bigger_than_batch_factor(uint16_t rtp_start_seqnum) +{ + struct msgb *msg; + int rc; + const uint8_t cid = 33; + unsigned osmux_transmitted = 0; + struct osmux_in_handle *h_input; + int i; + + printf("===%s(%" PRIu16 ")===\n", __func__, rtp_start_seqnum); + + clock_override_enable(true); + clock_override_set(0, 0); + rtp_init(rtp_start_seqnum, 18000); + + h_input = osmux_xfrm_input_alloc(tall_ctx); + osmux_xfrm_input_set_initial_seqnum(h_input, 123); + osmux_xfrm_input_set_batch_factor(h_input, 4); + osmux_xfrm_input_set_deliver_cb(h_input, + test_rtp_pkt_gap_bigger_than_batch_factor_osmux_deliver_cb, + &osmux_transmitted); + osmux_xfrm_input_open_circuit(h_input, cid, false); + + /* First RTP frame at t=0 */ + clock_debug("1st RTP packet is received"); + msg = rtp_next(); + rtp_append_amr(msg, AMR_FT_2); + rc = osmux_xfrm_input(h_input, msg, cid); + OSMO_ASSERT(rc == 0); + + clock_debug("10 packets are lost"); + for (i = 0; i < 10; i++) { + clock_override_add(0, TIME_RTP_PKT_MS*1000); + msg = rtp_next(); + msgb_free(msg); + } + + clock_debug("12th RTP packet is received"); + clock_override_add(0, TIME_RTP_PKT_MS*1000); + msg = rtp_next(); + rtp_append_amr(msg, AMR_FT_2); + /* The recreation of lost pkts fills the batch and hence triggers transmission of osmux frame: */ + rc = osmux_xfrm_input(h_input, msg, cid); + OSMO_ASSERT(rc == 1); + /* We call deliver as requested by API: */ + osmux_xfrm_input_deliver(h_input); + OSMO_ASSERT(osmux_transmitted == 1); + /* We try to feed the RTP packet again as per API. This time 0 is + * received, pkt is stored in osmux layer. This is because we don't + * recreate entire batches with fake data. Instead, Osmux should use the + * Marker bit to announce the peer there was a (potentially huge) jump + * in seqnums. */ + rc = osmux_xfrm_input(h_input, msg, cid); + OSMO_ASSERT(rc == 0); + + /* We continue filling the current batch so it gets transmitted: */ + clock_debug("12th+1 RTP packet is received"); + clock_override_add(0, TIME_RTP_PKT_MS*1000); + msg = rtp_next(); + rtp_append_amr(msg, AMR_FT_2); + rc = osmux_xfrm_input(h_input, msg, cid); + OSMO_ASSERT(rc == 0); + + clock_debug("12th+2 RTP packet is received"); + clock_override_add(0, TIME_RTP_PKT_MS*1000); + msg = rtp_next(); + rtp_append_amr(msg, AMR_FT_2); + rc = osmux_xfrm_input(h_input, msg, cid); + OSMO_ASSERT(rc == 0); + + clock_debug("12th+3 RTP packet is received"); + clock_override_add(0, TIME_RTP_PKT_MS*1000); + msg = rtp_next(); + rtp_append_amr(msg, AMR_FT_2); + rc = osmux_xfrm_input(h_input, msg, cid); + OSMO_ASSERT(rc == 0); + + clock_debug("osmux batch transmitted"); + clock_override_add(0, TIME_RTP_PKT_MS*1000); + osmo_select_main(0); + OSMO_ASSERT(osmux_transmitted == 2); + + clock_debug("Closing circuit"); + osmux_xfrm_input_close_circuit(h_input, cid); + talloc_free(h_input); +} + int main(int argc, char **argv) { @@ -600,6 +716,11 @@ test_rtp_pkt_gap(65533); test_rtp_pkt_gap(65534); test_rtp_pkt_gap(65535); + test_rtp_pkt_gap_bigger_than_batch_factor(60); + /* Test several wraparound scenarios: */ + test_rtp_pkt_gap_bigger_than_batch_factor(65533); + test_rtp_pkt_gap_bigger_than_batch_factor(65534); + test_rtp_pkt_gap_bigger_than_batch_factor(65535); fprintf(stdout, "OK: Test passed\n"); return EXIT_SUCCESS; diff --git a/tests/osmux/osmux_input_test.ok b/tests/osmux/osmux_input_test.ok index 652a6c8..f8a5e6f 100644 --- a/tests/osmux/osmux_input_test.ok +++ b/tests/osmux/osmux_input_test.ok @@ -93,4 +93,120 @@ sys={0.080000}, mono={0.080000}: OSMUX message (len=64): OSMUX seq=123 ccid=033 ft=1 rtp_m=0 ctr=3 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=00 [ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] sys={0.080000}, mono={0.080000}: Closing circuit +===test_rtp_pkt_gap_bigger_than_batch_factor(60)=== +sys={0.000000}, mono={0.000000}: clock_override_set +sys={0.000000}, mono={0.000000}: 1st RTP packet is received +sys={0.000000}, mono={0.000000}: 10 packets are lost +sys={0.020000}, mono={0.020000}: clock_override_add +sys={0.040000}, mono={0.040000}: clock_override_add +sys={0.060000}, mono={0.060000}: clock_override_add +sys={0.080000}, mono={0.080000}: clock_override_add +sys={0.100000}, mono={0.100000}: clock_override_add +sys={0.120000}, mono={0.120000}: clock_override_add +sys={0.140000}, mono={0.140000}: clock_override_add +sys={0.160000}, mono={0.160000}: clock_override_add +sys={0.180000}, mono={0.180000}: clock_override_add +sys={0.200000}, mono={0.200000}: clock_override_add +sys={0.200000}, mono={0.200000}: 12th RTP packet is received +sys={0.220000}, mono={0.220000}: clock_override_add +sys={0.220000}, mono={0.220000}: OSMUX message 1 (len=64): OSMUX seq=123 ccid=033 ft=1 rtp_m=0 ctr=3 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=00 [ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] + +sys={0.220000}, mono={0.220000}: 12th+1 RTP packet is received +sys={0.240000}, mono={0.240000}: clock_override_add +sys={0.240000}, mono={0.240000}: 12th+2 RTP packet is received +sys={0.260000}, mono={0.260000}: clock_override_add +sys={0.260000}, mono={0.260000}: 12th+3 RTP packet is received +sys={0.280000}, mono={0.280000}: clock_override_add +sys={0.280000}, mono={0.280000}: osmux batch transmitted +sys={0.300000}, mono={0.300000}: clock_override_add +sys={0.300000}, mono={0.300000}: OSMUX message 2 (len=64): OSMUX seq=124 ccid=033 ft=1 rtp_m=0 ctr=3 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=00 [ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] + +sys={0.300000}, mono={0.300000}: Closing circuit +===test_rtp_pkt_gap_bigger_than_batch_factor(65533)=== +sys={0.000000}, mono={0.000000}: clock_override_set +sys={0.000000}, mono={0.000000}: 1st RTP packet is received +sys={0.000000}, mono={0.000000}: 10 packets are lost +sys={0.020000}, mono={0.020000}: clock_override_add +sys={0.040000}, mono={0.040000}: clock_override_add +sys={0.060000}, mono={0.060000}: clock_override_add +sys={0.080000}, mono={0.080000}: clock_override_add +sys={0.100000}, mono={0.100000}: clock_override_add +sys={0.120000}, mono={0.120000}: clock_override_add +sys={0.140000}, mono={0.140000}: clock_override_add +sys={0.160000}, mono={0.160000}: clock_override_add +sys={0.180000}, mono={0.180000}: clock_override_add +sys={0.200000}, mono={0.200000}: clock_override_add +sys={0.200000}, mono={0.200000}: 12th RTP packet is received +sys={0.220000}, mono={0.220000}: clock_override_add +sys={0.220000}, mono={0.220000}: OSMUX message 1 (len=64): OSMUX seq=123 ccid=033 ft=1 rtp_m=0 ctr=3 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=00 [ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] + +sys={0.220000}, mono={0.220000}: 12th+1 RTP packet is received +sys={0.240000}, mono={0.240000}: clock_override_add +sys={0.240000}, mono={0.240000}: 12th+2 RTP packet is received +sys={0.260000}, mono={0.260000}: clock_override_add +sys={0.260000}, mono={0.260000}: 12th+3 RTP packet is received +sys={0.280000}, mono={0.280000}: clock_override_add +sys={0.280000}, mono={0.280000}: osmux batch transmitted +sys={0.300000}, mono={0.300000}: clock_override_add +sys={0.300000}, mono={0.300000}: OSMUX message 2 (len=64): OSMUX seq=124 ccid=033 ft=1 rtp_m=0 ctr=3 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=00 [ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] + +sys={0.300000}, mono={0.300000}: Closing circuit +===test_rtp_pkt_gap_bigger_than_batch_factor(65534)=== +sys={0.000000}, mono={0.000000}: clock_override_set +sys={0.000000}, mono={0.000000}: 1st RTP packet is received +sys={0.000000}, mono={0.000000}: 10 packets are lost +sys={0.020000}, mono={0.020000}: clock_override_add +sys={0.040000}, mono={0.040000}: clock_override_add +sys={0.060000}, mono={0.060000}: clock_override_add +sys={0.080000}, mono={0.080000}: clock_override_add +sys={0.100000}, mono={0.100000}: clock_override_add +sys={0.120000}, mono={0.120000}: clock_override_add +sys={0.140000}, mono={0.140000}: clock_override_add +sys={0.160000}, mono={0.160000}: clock_override_add +sys={0.180000}, mono={0.180000}: clock_override_add +sys={0.200000}, mono={0.200000}: clock_override_add +sys={0.200000}, mono={0.200000}: 12th RTP packet is received +sys={0.220000}, mono={0.220000}: clock_override_add +sys={0.220000}, mono={0.220000}: OSMUX message 1 (len=64): OSMUX seq=123 ccid=033 ft=1 rtp_m=0 ctr=3 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=00 [ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] + +sys={0.220000}, mono={0.220000}: 12th+1 RTP packet is received +sys={0.240000}, mono={0.240000}: clock_override_add +sys={0.240000}, mono={0.240000}: 12th+2 RTP packet is received +sys={0.260000}, mono={0.260000}: clock_override_add +sys={0.260000}, mono={0.260000}: 12th+3 RTP packet is received +sys={0.280000}, mono={0.280000}: clock_override_add +sys={0.280000}, mono={0.280000}: osmux batch transmitted +sys={0.300000}, mono={0.300000}: clock_override_add +sys={0.300000}, mono={0.300000}: OSMUX message 2 (len=64): OSMUX seq=124 ccid=033 ft=1 rtp_m=0 ctr=3 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=00 [ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] + +sys={0.300000}, mono={0.300000}: Closing circuit +===test_rtp_pkt_gap_bigger_than_batch_factor(65535)=== +sys={0.000000}, mono={0.000000}: clock_override_set +sys={0.000000}, mono={0.000000}: 1st RTP packet is received +sys={0.000000}, mono={0.000000}: 10 packets are lost +sys={0.020000}, mono={0.020000}: clock_override_add +sys={0.040000}, mono={0.040000}: clock_override_add +sys={0.060000}, mono={0.060000}: clock_override_add +sys={0.080000}, mono={0.080000}: clock_override_add +sys={0.100000}, mono={0.100000}: clock_override_add +sys={0.120000}, mono={0.120000}: clock_override_add +sys={0.140000}, mono={0.140000}: clock_override_add +sys={0.160000}, mono={0.160000}: clock_override_add +sys={0.180000}, mono={0.180000}: clock_override_add +sys={0.200000}, mono={0.200000}: clock_override_add +sys={0.200000}, mono={0.200000}: 12th RTP packet is received +sys={0.220000}, mono={0.220000}: clock_override_add +sys={0.220000}, mono={0.220000}: OSMUX message 1 (len=64): OSMUX seq=123 ccid=033 ft=1 rtp_m=0 ctr=3 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=00 [ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] + +sys={0.220000}, mono={0.220000}: 12th+1 RTP packet is received +sys={0.240000}, mono={0.240000}: clock_override_add +sys={0.240000}, mono={0.240000}: 12th+2 RTP packet is received +sys={0.260000}, mono={0.260000}: clock_override_add +sys={0.260000}, mono={0.260000}: 12th+3 RTP packet is received +sys={0.280000}, mono={0.280000}: clock_override_add +sys={0.280000}, mono={0.280000}: osmux batch transmitted +sys={0.300000}, mono={0.300000}: clock_override_add +sys={0.300000}, mono={0.300000}: OSMUX message 2 (len=64): OSMUX seq=124 ccid=033 ft=1 rtp_m=0 ctr=3 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=00 [ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] + +sys={0.300000}, mono={0.300000}: Closing circuit OK: Test passed -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30191 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I521c2e97a739e8a824b16f06ec2a578333388247 Gerrit-Change-Number: 30191 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: tests/osmux: Test replay of one lost RTP packet when generating osmux...
by pespin 16 Nov '22

16 Nov '22
Attention is currently required from: pespin. Hello osmith, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-netif/+/30173 to look at the new patch set (#2). Change subject: tests/osmux: Test replay of one lost RTP packet when generating osmux batches ...................................................................... tests/osmux: Test replay of one lost RTP packet when generating osmux batches Change-Id: I913c2ccfc3ad4e7ed801344d64e33e166a0817cf --- M tests/osmux/osmux_input_test.c M tests/osmux/osmux_input_test.ok 2 files changed, 98 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/73/30173/2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30173 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I913c2ccfc3ad4e7ed801344d64e33e166a0817cf Gerrit-Change-Number: 30173 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in libosmo-netif[master]: osmux: Drop noop OR during assignment
by pespin 16 Nov '22

16 Nov '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30190 ) Change subject: osmux: Drop noop OR during assignment ...................................................................... osmux: Drop noop OR during assignment osmuxh->rtp_m is zeroed at that point, it makes no sense to bit-OR at that point. Change-Id: I09c920035b1aa1af139a2a63f7cb4a3390bb9d36 --- M src/osmux_input.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/90/30190/1 diff --git a/src/osmux_input.c b/src/osmux_input.c index 866588f..a50a179 100644 --- a/src/osmux_input.c +++ b/src/osmux_input.c @@ -154,7 +154,7 @@ sizeof(struct osmux_hdr)); osmuxh->ft = OSMUX_FT_VOICE_AMR; osmuxh->ctr = 0; - osmuxh->rtp_m = osmuxh->rtp_m || state->rtph->marker; + osmuxh->rtp_m = state->rtph->marker; osmuxh->seq = state->circuit->seq++; osmuxh->circuit_id = state->circuit->ccid; osmuxh->amr_ft = state->amrh->ft; -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30190 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I09c920035b1aa1af139a2a63f7cb4a3390bb9d36 Gerrit-Change-Number: 30190 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in simtrace2[master]: firmware/sniffer: Group global variables in structs
by laforge 16 Nov '22

16 Nov '22
Attention is currently required from: laforge. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/simtrace2/+/30183 to look at the new patch set (#2). Change subject: firmware/sniffer: Group global variables in structs ...................................................................... firmware/sniffer: Group global variables in structs This is a purely cosmetic change that groups PPS, TPDU and ATR related global variables into structs. The structs get g_ prefixes to indicate a global variable. This avoids confusion between very short/generic variable names that might clash with local variables. Change-Id: I3e02f6c6b063ebc860b7a2a54dfc6051f1ea584f --- M firmware/libcommon/source/sniffer.c 1 file changed, 102 insertions(+), 94 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/83/30183/2 -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30183 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: I3e02f6c6b063ebc860b7a2a54dfc6051f1ea584f Gerrit-Change-Number: 30183 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newpatchset
1 0
0 0
Change in simtrace2[master]: firmware/sniffer: Rename global variable 'wt' to 'g_wt'
by laforge 16 Nov '22

16 Nov '22
Attention is currently required from: laforge. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/simtrace2/+/30188 to look at the new patch set (#2). Change subject: firmware/sniffer: Rename global variable 'wt' to 'g_wt' ...................................................................... firmware/sniffer: Rename global variable 'wt' to 'g_wt' It's a bad idea to have a two-character global variable which might easily clash with local variable names. Change-Id: Ic2fac64129d2772a1923f35e48582be3b130a0f2 --- M firmware/libcommon/source/sniffer.c 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/88/30188/2 -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30188 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: Ic2fac64129d2772a1923f35e48582be3b130a0f2 Gerrit-Change-Number: 30188 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newpatchset
1 0
0 0
Change in simtrace2[master]: firmware/sniffer: Disable TIMEOUT interrupts in USART IER on exit
by laforge 16 Nov '22

16 Nov '22
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/30189 ) Change subject: firmware/sniffer: Disable TIMEOUT interrupts in USART IER on exit ...................................................................... firmware/sniffer: Disable TIMEOUT interrupts in USART IER on exit Not critical (we disable the USART interrupts in NVIC anyway), but if Sniffer_init() enables this flag, it's good style for Sniffer_exit() to disable it. Change-Id: I92e16a160d60fcab33c81e0cf074088b9f20b9ae --- M firmware/libcommon/source/sniffer.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/89/30189/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 56f0b64..aeb2a5e 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -913,7 +913,7 @@ { TRACE_INFO("Sniffer exit\n\r"); /* Disable USART */ - USART_DisableIt(sniff_usart.base, US_IER_RXRDY); + USART_DisableIt(sniff_usart.base, US_IER_RXRDY | US_IER_TIMEOUT); /* NOTE: don't forget to set the IRQ according to the USART peripheral used */ NVIC_DisableIRQ(IRQ_USART_SIM); USART_SetReceiverEnabled(sniff_usart.base, 0); -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30189 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: I92e16a160d60fcab33c81e0cf074088b9f20b9ae Gerrit-Change-Number: 30189 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • ...
  • 251
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.