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

September 2022

  • 2 participants
  • 1860 discussions
Change in osmo-mgw[master]: osmux: Improve per-conn tx rate counters
by pespin 24 Sep '22

24 Sep '22
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29470 ) Change subject: osmux: Improve per-conn tx rate counters ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29470 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: If030f5d921bdfcfcd00b015b4a9e48bb3b04e721 Gerrit-Change-Number: 29470 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Sat, 24 Sep 2022 22:07:42 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-mgw[master]: osmux: Fix incorrect rate_ctr_group used in mgcp_osmux.c
by pespin 24 Sep '22

24 Sep '22
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29469 ) Change subject: osmux: Fix incorrect rate_ctr_group used in mgcp_osmux.c ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29469 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ia2e5601c7d476b79afd95032dbc019517f8209af Gerrit-Change-Number: 29469 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Sat, 24 Sep 2022 22:07:38 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-mgw[master]: osmux: Improve per-conn tx rate counters
by pespin 24 Sep '22

24 Sep '22
Attention is currently required from: pespin. Hello Jenkins Builder, laforge, fixeria, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-mgw/+/29470 to look at the new patch set (#2). Change subject: osmux: Improve per-conn tx rate counters ...................................................................... osmux: Improve per-conn tx rate counters Change-Id: If030f5d921bdfcfcd00b015b4a9e48bb3b04e721 --- M include/osmocom/mgcp/mgcp_conn.h M src/libosmo-mgcp/mgcp_osmux.c 2 files changed, 17 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/70/29470/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29470 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: If030f5d921bdfcfcd00b015b4a9e48bb3b04e721 Gerrit-Change-Number: 29470 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-mgw[master]: osmux: Fix incorrect rate_ctr_group used in mgcp_osmux.c
by pespin 24 Sep '22

24 Sep '22
Attention is currently required from: pespin. Hello Jenkins Builder, laforge, fixeria, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-mgw/+/29469 to look at the new patch set (#2). Change subject: osmux: Fix incorrect rate_ctr_group used in mgcp_osmux.c ...................................................................... osmux: Fix incorrect rate_ctr_group used in mgcp_osmux.c During development of the counters, they were first added to the same RTP counter group and later on split, but some places still used the RTP related functions to increment the counters. Let's add a seaprate set of helpers to update the correct osmux counter group. Fixes: 582c2bf7b0b3f6aabfb048a2d71c5fd9c60a105e Change-Id: Ia2e5601c7d476b79afd95032dbc019517f8209af --- M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_ratectr.c 2 files changed, 21 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/69/29469/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29469 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ia2e5601c7d476b79afd95032dbc019517f8209af Gerrit-Change-Number: 29469 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-mgw[master]: vty: show per-connection Osmux VTY stats
by pespin 24 Sep '22

24 Sep '22
Attention is currently required from: pespin. Hello Jenkins Builder, laforge, fixeria, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-mgw/+/29471 to look at the new patch set (#2). Change subject: vty: show per-connection Osmux VTY stats ...................................................................... vty: show per-connection Osmux VTY stats Related: SYS#5987 Change-Id: Ieab6dcbd195c8e01a73a2a832bce78ee015ae1c3 --- M include/osmocom/mgcp/osmux.h M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_vty.c 3 files changed, 35 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/71/29471/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29471 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ieab6dcbd195c8e01a73a2a832bce78ee015ae1c3 Gerrit-Change-Number: 29471 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-mgw[master]: Use bool type instead of int in config field
by pespin 24 Sep '22

24 Sep '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29463 ) Change subject: Use bool type instead of int in config field ...................................................................... Use bool type instead of int in config field Change-Id: Ie2624a6a6848c3c88deb39760317860d8074acb9 --- M include/osmocom/mgcp/mgcp.h M src/libosmo-mgcp/mgcp_osmux.c 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index ee419ef..c707f07 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -164,7 +164,7 @@ /* The BSC-NAT may ask for enabling osmux on demand. This tells us if * the osmux socket is already initialized. */ - int osmux_init; + bool osmux_init; /* osmux batch factor: from 1 to 4 maximum */ int osmux_batch; /* osmux batch size (in bytes) */ diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c index 06dc705..83a96fe 100644 --- a/src/libosmo-mgcp/mgcp_osmux.c +++ b/src/libosmo-mgcp/mgcp_osmux.c @@ -463,7 +463,7 @@ osmo_sock_get_name2(osmux_fd.fd)); return ret; } - cfg->osmux_init = 1; + cfg->osmux_init = true; LOGP(DOSMUX, LOGL_INFO, "OSMUX socket listening on %s\n", osmo_sock_get_name2(osmux_fd.fd)); -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29463 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ie2624a6a6848c3c88deb39760317860d8074acb9 Gerrit-Change-Number: 29463 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-mgw[master]: osmux: Support local CID != remote CID
by pespin 24 Sep '22

24 Sep '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29465 ) Change subject: osmux: Support local CID != remote CID ...................................................................... osmux: Support local CID != remote CID So far the implementation only allowed the remote CID being the same as the one dynamically implemented internally. Related: SYS#6138 Change-Id: I6b03eabc0305580c9788c529bec7dda9044a008f --- M include/osmocom/mgcp/mgcp_conn.h M include/osmocom/mgcp/osmux.h M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c 5 files changed, 66 insertions(+), 63 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/include/osmocom/mgcp/mgcp_conn.h b/include/osmocom/mgcp/mgcp_conn.h index 14ddfbb..9ffa7dc 100644 --- a/include/osmocom/mgcp/mgcp_conn.h +++ b/include/osmocom/mgcp/mgcp_conn.h @@ -80,10 +80,14 @@ struct { /* Osmux state: disabled, activating, active */ enum osmux_state state; - /* Is cid holding valid data? is it allocated from pool? */ - bool cid_allocated; - /* Allocated Osmux circuit ID for this conn */ - uint8_t cid; + /* Is local_cid holding valid data? is it allocated from pool? */ + bool local_cid_allocated; + /* Allocated local Osmux circuit ID for this conn */ + uint8_t local_cid; + /* Is remote_cid holding valid data? was it already received from client? */ + bool remote_cid_present; + /* Received remote Osmux circuit ID for this conn */ + uint8_t remote_cid; /* handle to batch messages, shared (refcounted) among several conns */ struct osmux_in_handle *in; /* handle to unbatch messages, one allocated and owned per conn */ diff --git a/include/osmocom/mgcp/osmux.h b/include/osmocom/mgcp/osmux.h index 26c1bdf..1a99e6d 100644 --- a/include/osmocom/mgcp/osmux.h +++ b/include/osmocom/mgcp/osmux.h @@ -17,8 +17,8 @@ int osmux_enable_conn(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, const struct osmo_sockaddr *addr); void conn_osmux_disable(struct mgcp_conn_rtp *conn); -int conn_osmux_allocate_cid(struct mgcp_conn_rtp *conn, int osmux_cid); -void conn_osmux_release_cid(struct mgcp_conn_rtp *conn); +int conn_osmux_allocate_local_cid(struct mgcp_conn_rtp *conn); +void conn_osmux_release_local_cid(struct mgcp_conn_rtp *conn); int osmux_xfrm_to_osmux(char *buf, int buf_len, struct mgcp_conn_rtp *conn); int osmux_send_dummy(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn); diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index d963a56..cc309a3 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -95,8 +95,10 @@ static atomic_uint rate_ctr_index = 0; conn_rtp->type = MGCP_RTP_DEFAULT; - conn_rtp->osmux.cid_allocated = false; - conn_rtp->osmux.cid = 0; + conn_rtp->osmux.local_cid_allocated = false; + conn_rtp->osmux.local_cid = 0; + conn_rtp->osmux.remote_cid_present = false; + conn_rtp->osmux.remote_cid = 0; /* backpointer to the generic part of the connection */ conn->u.rtp.conn = conn; diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c index 83a96fe..72152c7 100644 --- a/src/libosmo-mgcp/mgcp_osmux.c +++ b/src/libosmo-mgcp/mgcp_osmux.c @@ -210,7 +210,7 @@ if (conn->osmux.state != OSMUX_STATE_ENABLED) { LOGPCONN(conn->conn, DOSMUX, LOGL_INFO, "forwarding RTP to Osmux conn not yet enabled, dropping (cid=%d)\n", - conn->osmux.cid); + conn->osmux.remote_cid); rtpconn_rate_ctr_inc(conn, conn->conn->endp, OSMUX_DROPPED_AMR_PAYLOADS_CTR); return -1; } @@ -222,7 +222,7 @@ memcpy(msg->data, buf, buf_len); msgb_put(msg, buf_len); - while ((ret = osmux_xfrm_input(conn->osmux.in, msg, conn->osmux.cid)) > 0) { + while ((ret = osmux_xfrm_input(conn->osmux.in, msg, conn->osmux.remote_cid)) > 0) { /* batch full, build and deliver it */ osmux_xfrm_input_deliver(conn->osmux.in); } @@ -231,7 +231,7 @@ /* Lookup the endpoint that corresponds to the specified address (port) */ static struct mgcp_conn_rtp* -osmux_conn_lookup(struct mgcp_trunk *trunk, uint8_t cid, const struct osmo_sockaddr *rem_addr) +osmux_conn_lookup(struct mgcp_trunk *trunk, uint8_t local_cid, const struct osmo_sockaddr *rem_addr) { struct mgcp_endpoint *endp; struct mgcp_conn *conn = NULL; @@ -252,13 +252,13 @@ /* FIXME: Match remote address! */ - if (conn_rtp->osmux.cid == cid) + if (conn_rtp->osmux.local_cid == local_cid) return conn_rtp; } } - LOGP(DOSMUX, LOGL_ERROR, "Cannot find osmux conn with rem_addr=%s cid=%d\n", - osmo_sockaddr_to_str(rem_addr), cid); + LOGP(DOSMUX, LOGL_ERROR, "Cannot find osmux conn with rem_addr=%s local_cid=%d\n", + osmo_sockaddr_to_str(rem_addr), local_cid); return NULL; } @@ -327,7 +327,8 @@ LOGPCONN(conn->conn, DOSMUX, LOGL_INFO, "Osmux %s CID %u towards %s is now enabled\n", sending ? "sent" : "received", - conn->osmux.cid, osmo_sockaddr_to_str(&rem_addr)); + sending ? conn->osmux.remote_cid : conn->osmux.local_cid, + osmo_sockaddr_to_str(&rem_addr)); return 0; case OSMUX_STATE_ENABLED: return 0; @@ -517,16 +518,16 @@ mgcp_conn_dump(conn->conn)); return -1; } - if (osmux_xfrm_input_open_circuit(conn->osmux.in, conn->osmux.cid, osmux_dummy) < 0) { + if (osmux_xfrm_input_open_circuit(conn->osmux.in, conn->osmux.remote_cid, osmux_dummy) < 0) { LOGPCONN(conn->conn, DOSMUX, LOGL_ERROR, "Cannot open osmux circuit %u for conn:%s\n", - conn->osmux.cid, mgcp_conn_dump(conn->conn)); + conn->osmux.remote_cid, mgcp_conn_dump(conn->conn)); return -1; } conn->osmux.out = osmux_xfrm_output_alloc(conn->conn); osmux_xfrm_output_set_rtp_ssrc(conn->osmux.out, - (conn->osmux.cid * rtp_ssrc_winlen) + + (conn->osmux.remote_cid * rtp_ssrc_winlen) + (random() % rtp_ssrc_winlen)); osmux_xfrm_output_set_rtp_pl_type(conn->osmux.out, conn->end.codec->payload_type); osmux_xfrm_output_set_tx_cb(conn->osmux.out, @@ -547,7 +548,7 @@ OSMO_ASSERT(conn->osmux.state != OSMUX_STATE_DISABLED); LOGPCONN(conn->conn, DOSMUX, LOGL_INFO, - "Releasing connection using Osmux CID %u\n", conn->osmux.cid); + "Releasing connection using local Osmux CID %u\n", conn->osmux.local_cid); struct rate_ctr_group *all_osmux_stats = conn->conn->endp->trunk->ratectr.all_osmux_conn_stats; rate_ctr_inc(rate_ctr_group_get_ctr(all_osmux_stats, OSMUX_NUM_CONNECTIONS)); @@ -557,53 +558,44 @@ osmux_xfrm_output_set_tx_cb(conn->osmux.out, NULL, NULL); TALLOC_FREE(conn->osmux.out); - osmux_xfrm_input_close_circuit(conn->osmux.in, conn->osmux.cid); + osmux_xfrm_input_close_circuit(conn->osmux.in, conn->osmux.remote_cid); conn->osmux.state = OSMUX_STATE_DISABLED; osmux_handle_put(conn->osmux.in); + conn->osmux.remote_cid = 0; + conn->osmux.remote_cid_present = false; rate_ctr_group_free(conn->osmux.ctrg); conn->osmux.ctrg = NULL; } - conn_osmux_release_cid(conn); + conn_osmux_release_local_cid(conn); } /*! relase OSXMUX cid, that had been allocated to this connection. * \param[in] conn connection with OSMUX cid to release */ -void conn_osmux_release_cid(struct mgcp_conn_rtp *conn) +void conn_osmux_release_local_cid(struct mgcp_conn_rtp *conn) { - if (conn->osmux.cid_allocated) - osmux_cid_pool_put(conn->osmux.cid); - conn->osmux.cid = 0; - conn->osmux.cid_allocated = false; + if (conn->osmux.local_cid_allocated) + osmux_cid_pool_put(conn->osmux.local_cid); + conn->osmux.local_cid = 0; + conn->osmux.local_cid_allocated = false; } -/*! allocate OSXMUX cid to connection. - * \param[in] conn connection for which we allocate the OSMUX cid - * \param[in] osmux_cid OSMUX cid to allocate. -1 Means take next available one. - * \returns Allocated OSMUX cid, -1 on error (no free cids avail, or selected one is already taken). +/*! allocate local OSMUX cid to connection. + * \param[in] conn connection for which we allocate the local OSMUX cid + * \returns Allocated OSMUX cid, -1 on error (no free CIDs avail). */ -int conn_osmux_allocate_cid(struct mgcp_conn_rtp *conn, int osmux_cid) +int conn_osmux_allocate_local_cid(struct mgcp_conn_rtp *conn) { - if (osmux_cid != -1 && osmux_cid_pool_allocated((uint8_t) osmux_cid)) { + OSMO_ASSERT(conn->osmux.local_cid_allocated == false); + int osmux_cid = osmux_cid_pool_get_next(); + if (osmux_cid == -1) { LOGPCONN(conn->conn, DOSMUX, LOGL_INFO, - "Osmux CID %d already allocated!\n", - osmux_cid); + "no available local Osmux CID to allocate!\n"); return -1; } - if (osmux_cid == -1) { - osmux_cid = osmux_cid_pool_get_next(); - if (osmux_cid == -1) { - LOGPCONN(conn->conn, DOSMUX, LOGL_INFO, - "no available Osmux CID to allocate!\n"); - return -1; - } - } else { - osmux_cid_pool_get(osmux_cid); - } - - conn->osmux.cid = (uint8_t) osmux_cid; - conn->osmux.cid_allocated = true; + conn->osmux.local_cid = (uint8_t) osmux_cid; + conn->osmux.local_cid_allocated = true; conn->type = MGCP_OSMUX_BSC; return osmux_cid; } @@ -640,12 +632,12 @@ memset(osmuxh, 0, buf_len); osmuxh->ft = OSMUX_FT_DUMMY; osmuxh->amr_ft = AMR_FT_0; - osmuxh->circuit_id = conn->osmux.cid; + osmuxh->circuit_id = conn->osmux.remote_cid; LOGPCONN(conn->conn, DOSMUX, LOGL_DEBUG, "sending OSMUX dummy load to %s:%u CID %u\n", osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf), - ntohs(conn->end.rtp_port), conn->osmux.cid); + ntohs(conn->end.rtp_port), conn->osmux.remote_cid); return mgcp_udp_send(osmux_fd.fd, &conn->end.addr, conn->end.rtp_port, (char*)osmuxh, buf_len); diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 7f31cfd..506de34 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -301,7 +301,7 @@ /* Attach optional OSMUX parameters */ if (mgcp_conn_rtp_is_osmux(conn)) { - rc = msgb_printf(sdp, MGCP_X_OSMO_OSMUX_HEADER " %u\r\n", conn->osmux.cid); + rc = msgb_printf(sdp, MGCP_X_OSMO_OSMUX_HEADER " %u\r\n", conn->osmux.local_cid); if (rc < 0) goto error; } @@ -846,7 +846,7 @@ const char *callid = NULL; const char *mode = NULL; char *line; - int have_sdp = 0, osmux_cid = -2; + int have_sdp = 0, remote_osmux_cid = -2; struct mgcp_conn_rtp *conn = NULL; struct mgcp_conn *_conn = NULL; char conn_name[512]; @@ -895,7 +895,7 @@ /* If osmux is disabled, just skip setting it up */ if (rq->endp->trunk->cfg->osmux_use == OSMUX_USAGE_OFF) break; - osmux_cid = mgcp_osmux_setup(endp, line); + remote_osmux_cid = mgcp_osmux_setup(endp, line); break; } @@ -1001,12 +1001,17 @@ /* Annotate Osmux circuit ID and set it to negotiating state until this * is fully set up from the dummy load. */ conn->osmux.state = OSMUX_STATE_DISABLED; - if (osmux_cid >= -1) { /* -1 is wilcard, alloc next avail CID */ + /* If X-Osmux (remote CID) was received (-1 is wilcard), alloc next avail CID as local CID */ + if (remote_osmux_cid >= -1) { conn->osmux.state = OSMUX_STATE_ACTIVATING; - if (conn_osmux_allocate_cid(conn, osmux_cid) == -1) { + if (conn_osmux_allocate_local_cid(conn) == -1) { rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_NO_OSMUX)); goto error2; } + if (remote_osmux_cid >= 0) { + conn->osmux.remote_cid_present = true; + conn->osmux.remote_cid = remote_osmux_cid; + } } else if (endp->trunk->cfg->osmux_use == OSMUX_USAGE_ONLY) { LOGPCONN(_conn, DLMGCP, LOGL_ERROR, "CRCX: osmux only and no osmux offered\n"); @@ -1118,7 +1123,7 @@ const char *mode = NULL; struct mgcp_conn_rtp *conn = NULL; const char *conn_id = NULL; - int osmux_cid = -2; + int remote_osmux_cid = -2; int rc; LOGPENDP(endp, DLMGCP, LOGL_NOTICE, "MDCX: modifying existing connection ...\n"); @@ -1176,7 +1181,7 @@ /* If osmux is disabled, just skip setting it up */ if (endp->trunk->cfg->osmux_use == OSMUX_USAGE_OFF) break; - osmux_cid = mgcp_osmux_setup(endp, line); + remote_osmux_cid = mgcp_osmux_setup(endp, line); break; } /* Ignore unknown X-headers */ @@ -1253,23 +1258,23 @@ } if (mgcp_conn_rtp_is_osmux(conn)) { - OSMO_ASSERT(conn->osmux.cid_allocated); - if (osmux_cid < -1) { + OSMO_ASSERT(conn->osmux.local_cid_allocated); + if (remote_osmux_cid < -1) { LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, "MDCX: Failed to parse Osmux CID!\n"); goto error3; - } else if (osmux_cid == -1) { + } else if (remote_osmux_cid == -1) { LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, "MDCX: wilcard in MDCX is not supported!\n"); goto error3; - } else if (osmux_cid != (int) conn->osmux.cid) { + } else if (conn->osmux.remote_cid_present && + remote_osmux_cid != (int) conn->osmux.remote_cid) { LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, "MDCX: changing already allocated CID is not supported!\n"); goto error3; } - /* TODO: In the future (when we have recvCID!=sendCID), we need to - tell Osmux code that osmux_cid is to be used as sendCID for - that conn. */ + conn->osmux.remote_cid_present = true; + conn->osmux.remote_cid = remote_osmux_cid; } /* MDCX may have provided a new remote address, which means we may need -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29465 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I6b03eabc0305580c9788c529bec7dda9044a008f Gerrit-Change-Number: 29465 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-mgw[master]: osmux: Rename field osmux usage policy and define it with proper type
by pespin 24 Sep '22

24 Sep '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29462 ) Change subject: osmux: Rename field osmux usage policy and define it with proper type ...................................................................... osmux: Rename field osmux usage policy and define it with proper type Change-Id: I7f41a443f488b75df792597ec3cec8f7e97a7411 --- M include/osmocom/mgcp/mgcp.h M include/osmocom/mgcp/osmux.h M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_stat.c M src/libosmo-mgcp/mgcp_vty.c 6 files changed, 18 insertions(+), 13 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index f1e6460..ee419ef 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -29,6 +29,7 @@ #include <osmocom/core/logging.h> #include <osmocom/mgcp/mgcp_common.h> +#include <osmocom/mgcp/osmux.h> #include <arpa/inet.h> #include <sys/types.h> @@ -156,8 +157,8 @@ enum mgcp_role role; - /* osmux translator: 0 means disabled, 1 means enabled */ - int osmux; + /* Osmux usage policy: */ + enum osmux_usage osmux_use; /* addr to bind the server to */ char osmux_addr[INET6_ADDRSTRLEN]; /* The BSC-NAT may ask for enabling osmux on demand. This tells us if diff --git a/include/osmocom/mgcp/osmux.h b/include/osmocom/mgcp/osmux.h index 736025b..26c1bdf 100644 --- a/include/osmocom/mgcp/osmux.h +++ b/include/osmocom/mgcp/osmux.h @@ -9,6 +9,10 @@ OSMUX_ROLE_BSC_NAT, }; +struct mgcp_trunk; +struct mgcp_endpoint; +struct mgcp_conn_rtp; + int osmux_init(int role, struct mgcp_trunk *trunk); int osmux_enable_conn(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, const struct osmo_sockaddr *addr); diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c index 5647348..06dc705 100644 --- a/src/libosmo-mgcp/mgcp_osmux.c +++ b/src/libosmo-mgcp/mgcp_osmux.c @@ -394,7 +394,7 @@ rate_ctr_inc(rate_ctr_group_get_ctr(all_rtp_stats, OSMUX_PACKETS_RX_CTR)); - if (!trunk->cfg->osmux) { + if (trunk->cfg->osmux_use == OSMUX_USAGE_OFF) { LOGP(DOSMUX, LOGL_ERROR, "bsc-nat wants to use Osmux but bsc did not request it\n"); goto out; diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 74ed871..7f31cfd 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -893,7 +893,7 @@ case 'X': if (strncasecmp("Osmux: ", line + 2, strlen("Osmux: ")) == 0) { /* If osmux is disabled, just skip setting it up */ - if (!rq->endp->trunk->cfg->osmux) + if (rq->endp->trunk->cfg->osmux_use == OSMUX_USAGE_OFF) break; osmux_cid = mgcp_osmux_setup(endp, line); break; @@ -1007,7 +1007,7 @@ rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_NO_OSMUX)); goto error2; } - } else if (endp->trunk->cfg->osmux == OSMUX_USAGE_ONLY) { + } else if (endp->trunk->cfg->osmux_use == OSMUX_USAGE_ONLY) { LOGPCONN(_conn, DLMGCP, LOGL_ERROR, "CRCX: osmux only and no osmux offered\n"); rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_NO_OSMUX)); @@ -1174,7 +1174,7 @@ case 'X': if (strncasecmp("Osmux: ", line + 2, strlen("Osmux: ")) == 0) { /* If osmux is disabled, just skip setting it up */ - if (!endp->trunk->cfg->osmux) + if (endp->trunk->cfg->osmux_use == OSMUX_USAGE_OFF) break; osmux_cid = mgcp_osmux_setup(endp, line); break; diff --git a/src/libosmo-mgcp/mgcp_stat.c b/src/libosmo-mgcp/mgcp_stat.c index e63feac..acc9419 100644 --- a/src/libosmo-mgcp/mgcp_stat.c +++ b/src/libosmo-mgcp/mgcp_stat.c @@ -99,7 +99,7 @@ str += nchars; str_len -= nchars; - if (conn->conn->endp->trunk->cfg->osmux != OSMUX_USAGE_OFF) { + if (conn->conn->endp->trunk->cfg->osmux_use != OSMUX_USAGE_OFF) { /* Error Counter */ nchars = snprintf(str, str_len, "\r\nX-Osmo-CP: EC TI=%" PRIu64 ", TO=%" PRIu64, diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index 5abbf0e..34c2d4b 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -129,7 +129,7 @@ vty_out(vty, " rtp force-ptime %d%s", g_cfg->force_ptime, VTY_NEWLINE); - switch (g_cfg->osmux) { + switch (g_cfg->osmux_use) { case OSMUX_USAGE_ON: vty_out(vty, " osmux on%s", VTY_NEWLINE); break; @@ -141,7 +141,7 @@ vty_out(vty, " osmux off%s", VTY_NEWLINE); break; } - if (g_cfg->osmux) { + if (g_cfg->osmux_use != OSMUX_USAGE_OFF) { vty_out(vty, " osmux bind-ip %s%s", g_cfg->osmux_addr, VTY_NEWLINE); vty_out(vty, " osmux batch-factor %d%s", @@ -350,7 +350,7 @@ llist_for_each_entry(trunk, &g_cfg->trunks, entry) dump_trunk(vty, trunk, show_stats, active_only); - if (g_cfg->osmux) + if (g_cfg->osmux_use != OSMUX_USAGE_OFF) vty_out(vty, "Osmux used CID: %d%s", osmux_cid_pool_count_used(), VTY_NEWLINE); @@ -1547,12 +1547,12 @@ OSMO_ASSERT(trunk); if (strcmp(argv[0], "off") == 0) { - g_cfg->osmux = OSMUX_USAGE_OFF; + g_cfg->osmux_use = OSMUX_USAGE_OFF; return CMD_SUCCESS; } else if (strcmp(argv[0], "on") == 0) - g_cfg->osmux = OSMUX_USAGE_ON; + g_cfg->osmux_use = OSMUX_USAGE_ON; else if (strcmp(argv[0], "only") == 0) - g_cfg->osmux = OSMUX_USAGE_ONLY; + g_cfg->osmux_use = OSMUX_USAGE_ONLY; return CMD_SUCCESS; -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29462 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I7f41a443f488b75df792597ec3cec8f7e97a7411 Gerrit-Change-Number: 29462 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-mgw[master]: osmux: Support local CID != remote CID
by pespin 24 Sep '22

24 Sep '22
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29465 ) Change subject: osmux: Support local CID != remote CID ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29465 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I6b03eabc0305580c9788c529bec7dda9044a008f Gerrit-Change-Number: 29465 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Sat, 24 Sep 2022 22:04:08 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-mgw[master]: Use bool type instead of int in config field
by pespin 24 Sep '22

24 Sep '22
Attention is currently required from: laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29463 ) Change subject: Use bool type instead of int in config field ...................................................................... Patch Set 1: Code-Review+2 (1 comment) Patchset: PS1: > I'd also rename it to osmux_initialized which is much clearer IMHO I'll do that as a followup patch. -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29463 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ie2624a6a6848c3c88deb39760317860d8074acb9 Gerrit-Change-Number: 29463 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Sat, 24 Sep 2022 22:04:03 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • ...
  • 186
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.