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 libosmo-netif[master]: osmux: Drop marker bit in forged RTP packets to fill gaps
by osmith 16 Nov '22

16 Nov '22
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30170 ) Change subject: osmux: Drop marker bit in forged RTP packets to fill gaps ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30170 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I5cef6185afbfce748473a096e8ebabd9c9628e12 Gerrit-Change-Number: 30170 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-Comment-Date: Wed, 16 Nov 2022 13:19:13 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-netif[master]: osmux: recreate lost RTP pkts before handling newest one
by osmith 16 Nov '22

16 Nov '22
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30169 ) Change subject: osmux: recreate lost RTP pkts before handling newest one ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30169 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Ib5dd7b1fa6213c96ece803b781a7ef1cf102a1d4 Gerrit-Change-Number: 30169 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-Comment-Date: Wed, 16 Nov 2022 13:17:31 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-netif[master]: osmux: dup in RTP pkt: Replace potentially internally forged pkt with...
by osmith 16 Nov '22

16 Nov '22
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30168 ) Change subject: osmux: dup in RTP pkt: Replace potentially internally forged pkt with incoming one ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30168 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I82e11ef3dcd20ffea33c94ed83abcedf0f186871 Gerrit-Change-Number: 30168 Gerrit-PatchSet: 3 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-Comment-Date: Wed, 16 Nov 2022 13:15:41 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-netif[master]: osmux: dup in RTP pkt: check before applying queue flush due to Marke...
by osmith 16 Nov '22

16 Nov '22
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30167 ) Change subject: osmux: dup in RTP pkt: check before applying queue flush due to Marker bit ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30167 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I4a01b0935f112d650d8fc161b3389eda6c8e75ec Gerrit-Change-Number: 30167 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-Comment-Date: Wed, 16 Nov 2022 13:08:45 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmocom-bb[master]: trxcon: turn libtrxcon into shared library libosmo-trxcon
by Hoernchen 16 Nov '22

16 Nov '22
Attention is currently required from: laforge, pespin, fixeria. Hoernchen has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30105 ) Change subject: trxcon: turn libtrxcon into shared library libosmo-trxcon ...................................................................... Patch Set 3: Code-Review-1 (1 comment) Patchset: PS3: > isn't this to be used by trxcon and by osmo-ms-trx (which AFAIK is in another repo?) Yes. I don't want a "proper" global lib that only exists for one single very specific use case... The transceiver lives in the osmo-trx repo because it shares some code with osmo-trx, and there is no point trying to split that, but it needs the trxcon part of osmocom-bb and links to it, so the plan was to have osmocom-bb as a submodule of osmo-trx and build a static lib. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30105 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I508292e76c81ba7bc0c35db391a8622c46bdbe41 Gerrit-Change-Number: 30105 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 16 Nov 2022 13:08:37 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-netif[master]: osmux: Add internal backpointer to in_handle to simplify param passing
by pespin 16 Nov '22

16 Nov '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30163 ) Change subject: osmux: Add internal backpointer to in_handle to simplify param passing ...................................................................... osmux: Add internal backpointer to in_handle to simplify param passing A lof of mess is inherited from the fact that there's a public object (struct osmux_in_handle) which internally uses a private object (struct osmux_link). The struct osmux_in_handle fields are no longer expected to be accessed or allocated by the user, hence the struct is only kept in the header for backward compatibility with older versions. At some point, both structs can be moved to the C file and merged, simplifying the code further. For now, let's simply add a backpointer from struct osmux_link to the related struct osmux_in_handle, so that we can pass 1 pointer and have all fields accessible in the code. This allows further simplifying the code. We could also add an extra backpointer from osmux_circuit to osmux_link, but that's not really estimated as needed as of now since we can easily pass the osmux_link pointer down the called functions. Change-Id: I5c226c5c809a240f9eb80aa2e83679adc717d717 --- M src/osmux_input.c 1 file changed, 29 insertions(+), 27 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/src/osmux_input.c b/src/osmux_input.c index 72cbd4e..2d0b752 100644 --- a/src/osmux_input.c +++ b/src/osmux_input.c @@ -62,6 +62,12 @@ return sizeof(struct osmux_hdr) + (osmo_amr_bytes(amr_ft) * batch_factor); } +/* This is (struct osmux_in_handle)->internal_data. + * TODO: API have been defined to access all fields of osmux_in_handle + * (deprecated osmux_xfrm_input_init()), hence at some point we remove struct + * osmux_in_handle definition from osmux.h and we move it here internally and + * merge it with struct osmux_link. + */ struct osmux_link { struct osmo_timer_list timer; struct osmux_hdr *osmuxh; @@ -69,6 +75,7 @@ unsigned int remaining_bytes; uint32_t nmsgs; int ndummy; + struct osmux_in_handle *h; /* backpointer to parent object */ }; struct osmux_circuit { @@ -81,14 +88,13 @@ }; /* returns: 1 if batch is full, 0 if batch still not full, negative on error. */ -static int osmux_circuit_enqueue(struct osmux_circuit *circuit, struct msgb *msg, - uint8_t batch_factor) +static int osmux_circuit_enqueue(struct osmux_link *link, struct osmux_circuit *circuit, struct msgb *msg) { /* Validate amount of messages per batch. The counter field of the * osmux header is just 3 bits long, so make sure it doesn't overflow. */ - OSMO_ASSERT(batch_factor <= 8); - if (circuit->nmsgs >= batch_factor) { + OSMO_ASSERT(link->h->batch_factor <= 8); + if (circuit->nmsgs >= link->h->batch_factor) { struct rtp_hdr *rtph; rtph = osmo_rtp_get_hdr(msg); @@ -130,8 +136,7 @@ int add_osmux_hdr; }; -static int osmux_link_put(struct osmux_link *link, - struct osmux_input_state *state) +static int osmux_link_put(struct osmux_link *link, struct osmux_input_state *state) { if (state->add_osmux_hdr) { struct osmux_hdr *osmuxh; @@ -167,17 +172,16 @@ return 0; } -static void osmux_encode_dummy(struct osmux_link *link, uint8_t batch_factor, - struct osmux_input_state *state) +static void osmux_encode_dummy(struct osmux_link *link, struct osmux_input_state *state) { struct osmux_hdr *osmuxh; /* TODO: This should be configurable at some point. */ - uint32_t payload_size = osmux_ft_dummy_size(AMR_FT_3, batch_factor) - + uint32_t payload_size = osmux_ft_dummy_size(AMR_FT_3, link->h->batch_factor) - sizeof(struct osmux_hdr); osmuxh = (struct osmux_hdr *)state->out_msg->tail; osmuxh->ft = OSMUX_FT_DUMMY; - osmuxh->ctr = batch_factor - 1; + osmuxh->ctr = link->h->batch_factor - 1; osmuxh->amr_f = 0; osmuxh->amr_q = 0; osmuxh->seq = 0; @@ -190,8 +194,7 @@ msgb_put(state->out_msg, payload_size); } -static struct msgb *osmux_build_batch(struct osmux_link *link, - uint32_t batch_size, uint8_t batch_factor) +static struct msgb *osmux_build_batch(struct osmux_link *link) { struct msgb *batch_msg; struct osmux_circuit *circuit; @@ -200,7 +203,7 @@ LOGP(DLMUX, LOGL_DEBUG, "Now building batch\n"); #endif - batch_msg = msgb_alloc(batch_size, "osmux"); + batch_msg = msgb_alloc(link->h->batch_size, "osmux"); if (batch_msg == NULL) { LOGP(DLMUX, LOGL_ERROR, "Not enough memory\n"); return NULL; @@ -216,7 +219,7 @@ .out_msg = batch_msg, .circuit = circuit, }; - osmux_encode_dummy(link, batch_factor, &state); + osmux_encode_dummy(link, &state); continue; } @@ -275,7 +278,7 @@ #ifdef DEBUG_MSG LOGP(DLMUX, LOGL_DEBUG, "invoking delivery function\n"); #endif - batch_msg = osmux_build_batch(link, h->batch_size, h->batch_factor); + batch_msg = osmux_build_batch(link); if (!batch_msg) return; h->stats.output_osmux_msgs++; @@ -341,8 +344,8 @@ } /* returns: 1 if batch is full, 0 if batch still not full, negative on error. */ -static int osmux_replay_lost_packets(struct osmux_circuit *circuit, - struct rtp_hdr *cur_rtph, int batch_factor) +static int osmux_replay_lost_packets(struct osmux_link *link, struct osmux_circuit *circuit, + struct rtp_hdr *cur_rtph) { int16_t diff; struct msgb *last; @@ -396,7 +399,7 @@ DELTA_RTP_TIMESTAMP); /* No more room in this batch, skip padding with more clones */ - rc = osmux_circuit_enqueue(circuit, clone, batch_factor); + rc = osmux_circuit_enqueue(link, circuit, clone); if (rc != 0) { msgb_free(clone); return rc; @@ -428,7 +431,7 @@ /* returns: 1 if batch is full, 0 if batch still not full, negative on error. */ static int -osmux_link_add(struct osmux_link *link, uint32_t batch_factor, struct msgb *msg, +osmux_link_add(struct osmux_link *link, struct msgb *msg, struct rtp_hdr *rtph, int ccid) { int bytes = 0, amr_payload_len; @@ -495,12 +498,12 @@ return 1; /* Handle RTP packet loss scenario */ - rc = osmux_replay_lost_packets(circuit, rtph, batch_factor); + rc = osmux_replay_lost_packets(link, circuit, rtph); if (rc != 0) return rc; /* This batch is full, force batch delivery */ - rc = osmux_circuit_enqueue(circuit, msg, batch_factor); + rc = osmux_circuit_enqueue(link, circuit, msg); if (rc != 0) return rc; @@ -517,7 +520,7 @@ LOGP(DLMUX, LOGL_DEBUG, "osmux start timer batch\n"); #endif osmo_timer_schedule(&link->timer, 0, - batch_factor * DELTA_RTP_MSG); + link->h->batch_factor * DELTA_RTP_MSG); } link->nmsgs++; @@ -572,7 +575,7 @@ */ /* Add this RTP to the OSMUX batch */ - ret = osmux_link_add(link, h->batch_factor, msg, rtph, ccid); + ret = osmux_link_add(link, msg, rtph, ccid); if (ret < 0) { /* Cannot put this message into the batch. * Malformed, duplicated, OOM. Drop it and tell @@ -616,18 +619,17 @@ struct osmux_in_handle *osmux_xfrm_input_alloc(void *ctx) { struct osmux_in_handle *h; + struct osmux_link *link; h = talloc_zero(ctx, struct osmux_in_handle); OSMO_ASSERT(h); - struct osmux_link *link; - h->batch_size = OSMUX_BATCH_DEFAULT_MAX; link = talloc_zero(h, struct osmux_link); OSMO_ASSERT(link); - INIT_LLIST_HEAD(&link->circuit_list); + link->h = h; link->remaining_bytes = h->batch_size; osmo_timer_setup(&link->timer, osmux_link_timer_expired, h); @@ -651,8 +653,8 @@ link = talloc_zero(osmux_ctx, struct osmux_link); if (link == NULL) return; - INIT_LLIST_HEAD(&link->circuit_list); + link->h = h; link->remaining_bytes = h->batch_size; osmo_timer_setup(&link->timer, osmux_link_timer_expired, h); -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30163 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I5c226c5c809a240f9eb80aa2e83679adc717d717 Gerrit-Change-Number: 30163 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in libosmo-netif[master]: osmux: Fix endianness logging duplicaed seqnum
by pespin 16 Nov '22

16 Nov '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30165 ) Change subject: osmux: Fix endianness logging duplicaed seqnum ...................................................................... osmux: Fix endianness logging duplicaed seqnum Change-Id: I431d3a64e971bd7ba2bed007265559af876bc10b --- M src/osmux_input.c 1 file changed, 2 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve diff --git a/src/osmux_input.c b/src/osmux_input.c index 2d0b752..fb246a5 100644 --- a/src/osmux_input.c +++ b/src/osmux_input.c @@ -476,9 +476,8 @@ /* Already exists message with this sequence, skip */ if (rtph2->sequence == rtph->sequence) { - LOGP(DLMUX, LOGL_ERROR, "already exists " - "message with seq=%u, skip it\n", - rtph->sequence); + LOGP(DLMUX, LOGL_ERROR, "RTP pkt with seq=%u already exists, skip it\n", + ntohs(rtph->sequence)); return -1; } } -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30165 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I431d3a64e971bd7ba2bed007265559af876bc10b Gerrit-Change-Number: 30165 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in libosmo-netif[master]: osmux: rename internal struct osmux_batch -> osmux_link
by pespin 16 Nov '22

16 Nov '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30162 ) Change subject: osmux: rename internal struct osmux_batch -> osmux_link ...................................................................... osmux: rename internal struct osmux_batch -> osmux_link This struct matches the lifecycle of the link, holds all the circuits acting as a trunk. The previous name was utterly misleading since "batch" usually is per circuit group of AMR frames with an osmux header. Change-Id: Ib118fd2c1fead78655756156ce5d4ce4a6d080df --- M src/osmux_input.c 1 file changed, 67 insertions(+), 70 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve osmith: Looks good to me, approved diff --git a/src/osmux_input.c b/src/osmux_input.c index aa48049..72cbd4e 100644 --- a/src/osmux_input.c +++ b/src/osmux_input.c @@ -62,7 +62,7 @@ return sizeof(struct osmux_hdr) + (osmo_amr_bytes(amr_ft) * batch_factor); } -struct osmux_batch { +struct osmux_link { struct osmo_timer_list timer; struct osmux_hdr *osmuxh; struct llist_head circuit_list; @@ -110,13 +110,13 @@ circuit->nmsgs--; } -static void osmux_circuit_del_msgs(struct osmux_batch *batch, struct osmux_circuit *circuit) +static void osmux_circuit_del_msgs(struct osmux_link *link, struct osmux_circuit *circuit) { struct msgb *cur, *tmp; llist_for_each_entry_safe(cur, tmp, &circuit->msg_list, list) { osmux_circuit_dequeue(circuit, cur); msgb_free(cur); - batch->nmsgs--; + link->nmsgs--; } } @@ -130,7 +130,7 @@ int add_osmux_hdr; }; -static int osmux_batch_put(struct osmux_batch *batch, +static int osmux_link_put(struct osmux_link *link, struct osmux_input_state *state) { if (state->add_osmux_hdr) { @@ -145,20 +145,20 @@ osmuxh->amr_ft = state->amrh->ft; /* annotate current osmux header */ - batch->osmuxh = osmuxh; + link->osmuxh = osmuxh; } else { - if (batch->osmuxh->ctr == 0x7) { + if (link->osmuxh->ctr == 0x7) { LOGP(DLMUX, LOGL_ERROR, "cannot add msg=%p, " "too many messages for this RTP ssrc=%u\n", state->msg, state->rtph->ssrc); return 0; } - batch->osmuxh->ctr++; + link->osmuxh->ctr++; } /* For fields below, we only use the last included in batch and ignore any previous: */ - batch->osmuxh->amr_cmr = state->amrh->cmr; - batch->osmuxh->amr_f = state->amrh->f; - batch->osmuxh->amr_q = state->amrh->q; + link->osmuxh->amr_cmr = state->amrh->cmr; + link->osmuxh->amr_f = state->amrh->f; + link->osmuxh->amr_q = state->amrh->q; memcpy(state->out_msg->tail, osmo_amr_get_payload(state->amrh), state->amr_payload_len); @@ -167,7 +167,7 @@ return 0; } -static void osmux_encode_dummy(struct osmux_batch *batch, uint8_t batch_factor, +static void osmux_encode_dummy(struct osmux_link *link, uint8_t batch_factor, struct osmux_input_state *state) { struct osmux_hdr *osmuxh; @@ -190,7 +190,7 @@ msgb_put(state->out_msg, payload_size); } -static struct msgb *osmux_build_batch(struct osmux_batch *batch, +static struct msgb *osmux_build_batch(struct osmux_link *link, uint32_t batch_size, uint8_t batch_factor) { struct msgb *batch_msg; @@ -206,7 +206,7 @@ return NULL; } - llist_for_each_entry(circuit, &batch->circuit_list, head) { + llist_for_each_entry(circuit, &link->circuit_list, head) { struct msgb *cur, *tmp; int ctr = 0; int prev_amr_ft; @@ -216,7 +216,7 @@ .out_msg = batch_msg, .circuit = circuit, }; - osmux_encode_dummy(batch, batch_factor, &state); + osmux_encode_dummy(link, batch_factor, &state); continue; } @@ -256,12 +256,12 @@ state.add_osmux_hdr = 1; } - osmux_batch_put(batch, &state); + osmux_link_put(link, &state); osmux_circuit_dequeue(circuit, cur); prev_amr_ft = state.amrh->ft; ctr++; msgb_free(cur); - batch->nmsgs--; + link->nmsgs--; } } return batch_msg; @@ -270,33 +270,31 @@ void osmux_xfrm_input_deliver(struct osmux_in_handle *h) { struct msgb *batch_msg; - struct osmux_batch *batch = (struct osmux_batch *)h->internal_data; + struct osmux_link *link = (struct osmux_link *)h->internal_data; #ifdef DEBUG_MSG LOGP(DLMUX, LOGL_DEBUG, "invoking delivery function\n"); #endif - batch_msg = osmux_build_batch(batch, h->batch_size, h->batch_factor); + batch_msg = osmux_build_batch(link, h->batch_size, h->batch_factor); if (!batch_msg) return; h->stats.output_osmux_msgs++; h->stats.output_osmux_bytes += batch_msg->len; h->deliver(batch_msg, h->data); - osmo_timer_del(&batch->timer); - batch->remaining_bytes = h->batch_size; + osmo_timer_del(&link->timer); + link->remaining_bytes = h->batch_size; - if (batch->ndummy) { - osmo_timer_schedule(&batch->timer, 0, - h->batch_factor * DELTA_RTP_MSG); - } + if (link->ndummy) + osmo_timer_schedule(&link->timer, 0, h->batch_factor * DELTA_RTP_MSG); } -static void osmux_batch_timer_expired(void *data) +static void osmux_link_timer_expired(void *data) { struct osmux_in_handle *h = data; #ifdef DEBUG_MSG - LOGP(DLMUX, LOGL_DEBUG, "osmux_batch_timer_expired\n"); + LOGP(DLMUX, LOGL_DEBUG, "osmux_link_timer_expired\n"); #endif osmux_xfrm_input_deliver(h); } @@ -408,29 +406,29 @@ } static struct osmux_circuit * -osmux_batch_find_circuit(struct osmux_batch *batch, int ccid) +osmux_link_find_circuit(struct osmux_link *link, int ccid) { struct osmux_circuit *circuit; - llist_for_each_entry(circuit, &batch->circuit_list, head) { + llist_for_each_entry(circuit, &link->circuit_list, head) { if (circuit->ccid == ccid) return circuit; } return NULL; } -static void osmux_batch_del_circuit(struct osmux_batch *batch, struct osmux_circuit *circuit) +static void osmux_link_del_circuit(struct osmux_link *link, struct osmux_circuit *circuit) { if (circuit->dummy) - batch->ndummy--; + link->ndummy--; llist_del(&circuit->head); - osmux_circuit_del_msgs(batch, circuit); + osmux_circuit_del_msgs(link, circuit); talloc_free(circuit); } /* returns: 1 if batch is full, 0 if batch still not full, negative on error. */ static int -osmux_batch_add(struct osmux_batch *batch, uint32_t batch_factor, struct msgb *msg, +osmux_link_add(struct osmux_link *link, uint32_t batch_factor, struct msgb *msg, struct rtp_hdr *rtph, int ccid) { int bytes = 0, amr_payload_len; @@ -440,14 +438,14 @@ struct amr_hdr *amrh; uint32_t amr_len; - circuit = osmux_batch_find_circuit(batch, ccid); + circuit = osmux_link_find_circuit(link, ccid); if (!circuit) return -1; /* We've seen the first RTP message, disable dummy padding */ if (circuit->dummy) { circuit->dummy = 0; - batch->ndummy--; + link->ndummy--; } amrh = osmo_rtp_get_payload(rtph, msg, &amr_len); @@ -493,7 +491,7 @@ bytes += amr_payload_len; /* No room, sorry. You'll have to retry */ - if (bytes > batch->remaining_bytes) + if (bytes > link->remaining_bytes) return 1; /* Handle RTP packet loss scenario */ @@ -512,16 +510,16 @@ #endif /* Update remaining room in this batch */ - batch->remaining_bytes -= bytes; + link->remaining_bytes -= bytes; - if (batch->nmsgs == 0) { + if (link->nmsgs == 0) { #ifdef DEBUG_MSG LOGP(DLMUX, LOGL_DEBUG, "osmux start timer batch\n"); #endif - osmo_timer_schedule(&batch->timer, 0, + osmo_timer_schedule(&link->timer, 0, batch_factor * DELTA_RTP_MSG); } - batch->nmsgs++; + link->nmsgs++; return 0; } @@ -543,7 +541,7 @@ { int ret; struct rtp_hdr *rtph; - struct osmux_batch *batch = (struct osmux_batch *)h->internal_data; + struct osmux_link *link = (struct osmux_link *)h->internal_data; /* Ignore too big RTP/RTCP messages, most likely forged. Sanity check * to avoid a possible forever loop in the caller. @@ -574,8 +572,7 @@ */ /* Add this RTP to the OSMUX batch */ - ret = osmux_batch_add(batch, h->batch_factor, - msg, rtph, ccid); + ret = osmux_link_add(link, h->batch_factor, msg, rtph, ccid); if (ret < 0) { /* Cannot put this message into the batch. * Malformed, duplicated, OOM. Drop it and tell @@ -595,14 +592,14 @@ static int osmux_xfrm_input_talloc_destructor(struct osmux_in_handle *h) { - struct osmux_batch *batch = (struct osmux_batch *)h->internal_data; + struct osmux_link *link = (struct osmux_link *)h->internal_data; struct osmux_circuit *circuit, *next; - llist_for_each_entry_safe(circuit, next, &batch->circuit_list, head) - osmux_batch_del_circuit(batch, circuit); + llist_for_each_entry_safe(circuit, next, &link->circuit_list, head) + osmux_link_del_circuit(link, circuit); - osmo_timer_del(&batch->timer); - talloc_free(batch); + osmo_timer_del(&link->timer); + talloc_free(link); return 0; } @@ -623,18 +620,18 @@ h = talloc_zero(ctx, struct osmux_in_handle); OSMO_ASSERT(h); - struct osmux_batch *batch; + struct osmux_link *link; h->batch_size = OSMUX_BATCH_DEFAULT_MAX; - batch = talloc_zero(h, struct osmux_batch); - OSMO_ASSERT(batch); + link = talloc_zero(h, struct osmux_link); + OSMO_ASSERT(link); - INIT_LLIST_HEAD(&batch->circuit_list); - batch->remaining_bytes = h->batch_size; - osmo_timer_setup(&batch->timer, osmux_batch_timer_expired, h); + INIT_LLIST_HEAD(&link->circuit_list); + link->remaining_bytes = h->batch_size; + osmo_timer_setup(&link->timer, osmux_link_timer_expired, h); - h->internal_data = (void *)batch; + h->internal_data = (void *)link; LOGP(DLMUX, LOGL_DEBUG, "initialized osmux input converter\n"); @@ -645,21 +642,21 @@ /* DEPRECATED: Use osmux_xfrm_input_alloc() instead */ void osmux_xfrm_input_init(struct osmux_in_handle *h) { - struct osmux_batch *batch; + struct osmux_link *link; /* Default to osmux packet size if not specified */ if (h->batch_size == 0) h->batch_size = OSMUX_BATCH_DEFAULT_MAX; - batch = talloc_zero(osmux_ctx, struct osmux_batch); - if (batch == NULL) + link = talloc_zero(osmux_ctx, struct osmux_link); + if (link == NULL) return; - INIT_LLIST_HEAD(&batch->circuit_list); - batch->remaining_bytes = h->batch_size; - osmo_timer_setup(&batch->timer, osmux_batch_timer_expired, h); + INIT_LLIST_HEAD(&link->circuit_list); + link->remaining_bytes = h->batch_size; + osmo_timer_setup(&link->timer, osmux_link_timer_expired, h); - h->internal_data = (void *)batch; + h->internal_data = (void *)link; LOGP(DLMUX, LOGL_DEBUG, "initialized osmux input converter\n"); } @@ -700,10 +697,10 @@ int osmux_xfrm_input_open_circuit(struct osmux_in_handle *h, int ccid, int dummy) { - struct osmux_batch *batch = (struct osmux_batch *)h->internal_data; + struct osmux_link *link = (struct osmux_link *)h->internal_data; struct osmux_circuit *circuit; - circuit = osmux_batch_find_circuit(batch, ccid); + circuit = osmux_link_find_circuit(link, ccid); if (circuit != NULL) { LOGP(DLMUX, LOGL_ERROR, "circuit %u already exists!\n", ccid); return -1; @@ -718,13 +715,13 @@ circuit->ccid = ccid; circuit->seq = h->osmux_seq; INIT_LLIST_HEAD(&circuit->msg_list); - llist_add_tail(&circuit->head, &batch->circuit_list); + llist_add_tail(&circuit->head, &link->circuit_list); if (dummy) { circuit->dummy = dummy; - batch->ndummy++; - if (!osmo_timer_pending(&batch->timer)) - osmo_timer_schedule(&batch->timer, 0, + link->ndummy++; + if (!osmo_timer_pending(&link->timer)) + osmo_timer_schedule(&link->timer, 0, h->batch_factor * DELTA_RTP_MSG); } return 0; @@ -732,17 +729,17 @@ void osmux_xfrm_input_close_circuit(struct osmux_in_handle *h, int ccid) { - struct osmux_batch *batch = (struct osmux_batch *)h->internal_data; + struct osmux_link *link = (struct osmux_link *)h->internal_data; struct osmux_circuit *circuit; - circuit = osmux_batch_find_circuit(batch, ccid); + circuit = osmux_link_find_circuit(link, ccid); if (circuit == NULL) { LOGP(DLMUX, LOGL_NOTICE, "Unable to close circuit %d: Not found\n", ccid); return; } - osmux_batch_del_circuit(batch, circuit); + osmux_link_del_circuit(link, circuit); } /* DEPRECATED: Use talloc_free() instead (will call osmux_xfrm_input_talloc_destructor()) */ -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30162 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Ib118fd2c1fead78655756156ce5d4ce4a6d080df Gerrit-Change-Number: 30162 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in libosmo-netif[master]: osmux: Fix endianness logging duplicaed seqnum
by pespin 16 Nov '22

16 Nov '22
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30165 ) Change subject: osmux: Fix endianness logging duplicaed seqnum ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30165 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I431d3a64e971bd7ba2bed007265559af876bc10b Gerrit-Change-Number: 30165 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 16 Nov 2022 13:07:39 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-netif[master]: osmux: Use internal struct to cache parsing state of rtp pkt from user
by osmith 16 Nov '22

16 Nov '22
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30166 ) Change subject: osmux: Use internal struct to cache parsing state of rtp pkt from user ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30166 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I55e0d2772e7054c0d734f5918c6938a5c8a6e781 Gerrit-Change-Number: 30166 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-Comment-Date: Wed, 16 Nov 2022 13:07:26 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • ...
  • 251
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.