Change in osmo-mgw[master]: legacy-mgcp: switch to new osmux output APIs

2018-05-17 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/9213


Change subject: legacy-mgcp: switch to new osmux output APIs
..

legacy-mgcp: switch to new osmux output APIs

Older ones are being deprecated as they may generate interleaved
packets.

This commit is a forward-port of openbsc.git Change-Id
I189564fc63139c15314db8975afd423c7153ea32.

Change-Id: I9b8a19e5b8d62deaa9bbb92d49d99e8c33b7e345
---
M src/libosmo-legacy-mgcp/mgcp_osmux.c
1 file changed, 11 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/13/9213/1

diff --git a/src/libosmo-legacy-mgcp/mgcp_osmux.c 
b/src/libosmo-legacy-mgcp/mgcp_osmux.c
index 743d3f9..b53e2b5 100644
--- a/src/libosmo-legacy-mgcp/mgcp_osmux.c
+++ b/src/libosmo-legacy-mgcp/mgcp_osmux.c
@@ -267,7 +267,6 @@
 {
struct msgb *msg;
struct osmux_hdr *osmuxh;
-   struct llist_head list;
struct sockaddr_in addr;
struct mgcp_config *cfg = ofd->data;
uint32_t rem;
@@ -297,8 +296,7 @@
endp->osmux.stats.chunks++;
rem = msg->len;

-   osmux_xfrm_output(osmuxh, &endp->osmux.out, &list);
-   osmux_tx_sched(&list, scheduled_tx_bts_cb, endp);
+   osmux_xfrm_output_sched(&endp->osmux.out, osmuxh);
}
 out:
msgb_free(msg);
@@ -359,7 +357,6 @@
 {
struct msgb *msg;
struct osmux_hdr *osmuxh;
-   struct llist_head list;
struct sockaddr_in addr;
struct mgcp_config *cfg = ofd->data;
uint32_t rem;
@@ -389,8 +386,7 @@
endp->osmux.stats.chunks++;
rem = msg->len;

-   osmux_xfrm_output(osmuxh, &endp->osmux.out, &list);
-   osmux_tx_sched(&list, scheduled_tx_net_cb, endp);
+   osmux_xfrm_output_sched(&endp->osmux.out, osmuxh);
}
 out:
msgb_free(msg);
@@ -470,9 +466,13 @@
switch (endp->cfg->role) {
case MGCP_BSC_NAT:
endp->type = MGCP_OSMUX_BSC_NAT;
+   osmux_xfrm_output_set_tx_cb(&endp->osmux.out,
+   scheduled_tx_net_cb, 
endp);
break;
case MGCP_BSC:
endp->type = MGCP_OSMUX_BSC;
+   osmux_xfrm_output_set_tx_cb(&endp->osmux.out,
+   scheduled_tx_bts_cb, 
endp);
break;
}
endp->osmux.state = OSMUX_STATE_ENABLED;
@@ -484,6 +484,11 @@
 {
LOGP(DLMGCP, LOGL_INFO, "Releasing endpoint %u using Osmux CID %u\n",
 ENDPOINT_NUMBER(endp), endp->osmux.cid);
+
+   /* We are closing, we don't need pending RTP packets to be transmitted 
*/
+   osmux_xfrm_output_set_tx_cb(&endp->osmux.out, NULL, NULL);
+   osmux_xfrm_output_flush(&endp->osmux.out);
+
osmux_xfrm_input_close_circuit(endp->osmux.in, endp->osmux.cid);
endp->osmux.state = OSMUX_STATE_DISABLED;
endp->osmux.cid = -1;

--
To view, visit https://gerrit.osmocom.org/9213
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b8a19e5b8d62deaa9bbb92d49d99e8c33b7e345
Gerrit-Change-Number: 9213
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 


Change in osmo-mgw[master]: legacy-mgcp: switch to new osmux output APIs

2018-05-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9213 )

Change subject: legacy-mgcp: switch to new osmux output APIs
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/9213
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9b8a19e5b8d62deaa9bbb92d49d99e8c33b7e345
Gerrit-Change-Number: 9213
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Thu, 17 May 2018 12:03:29 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-mgw[master]: legacy-mgcp: switch to new osmux output APIs

2018-05-19 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/9213 )

Change subject: legacy-mgcp: switch to new osmux output APIs
..


Patch Set 1:

It's a forward port and it's been +1 for several days, merging.


--
To view, visit https://gerrit.osmocom.org/9213
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9b8a19e5b8d62deaa9bbb92d49d99e8c33b7e345
Gerrit-Change-Number: 9213
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Sat, 19 May 2018 12:05:41 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-mgw[master]: legacy-mgcp: switch to new osmux output APIs

2018-05-19 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/9213 )

Change subject: legacy-mgcp: switch to new osmux output APIs
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9213
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9b8a19e5b8d62deaa9bbb92d49d99e8c33b7e345
Gerrit-Change-Number: 9213
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Sat, 19 May 2018 12:05:50 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-mgw[master]: legacy-mgcp: switch to new osmux output APIs

2018-05-19 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9213 )

Change subject: legacy-mgcp: switch to new osmux output APIs
..

legacy-mgcp: switch to new osmux output APIs

Older ones are being deprecated as they may generate interleaved
packets.

This commit is a forward-port of openbsc.git Change-Id
I189564fc63139c15314db8975afd423c7153ea32.

Change-Id: I9b8a19e5b8d62deaa9bbb92d49d99e8c33b7e345
---
M src/libosmo-legacy-mgcp/mgcp_osmux.c
1 file changed, 11 insertions(+), 6 deletions(-)

Approvals:
  Harald Welte: Looks good to me, but someone else must approve
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libosmo-legacy-mgcp/mgcp_osmux.c 
b/src/libosmo-legacy-mgcp/mgcp_osmux.c
index 743d3f9..b53e2b5 100644
--- a/src/libosmo-legacy-mgcp/mgcp_osmux.c
+++ b/src/libosmo-legacy-mgcp/mgcp_osmux.c
@@ -267,7 +267,6 @@
 {
struct msgb *msg;
struct osmux_hdr *osmuxh;
-   struct llist_head list;
struct sockaddr_in addr;
struct mgcp_config *cfg = ofd->data;
uint32_t rem;
@@ -297,8 +296,7 @@
endp->osmux.stats.chunks++;
rem = msg->len;

-   osmux_xfrm_output(osmuxh, &endp->osmux.out, &list);
-   osmux_tx_sched(&list, scheduled_tx_bts_cb, endp);
+   osmux_xfrm_output_sched(&endp->osmux.out, osmuxh);
}
 out:
msgb_free(msg);
@@ -359,7 +357,6 @@
 {
struct msgb *msg;
struct osmux_hdr *osmuxh;
-   struct llist_head list;
struct sockaddr_in addr;
struct mgcp_config *cfg = ofd->data;
uint32_t rem;
@@ -389,8 +386,7 @@
endp->osmux.stats.chunks++;
rem = msg->len;

-   osmux_xfrm_output(osmuxh, &endp->osmux.out, &list);
-   osmux_tx_sched(&list, scheduled_tx_net_cb, endp);
+   osmux_xfrm_output_sched(&endp->osmux.out, osmuxh);
}
 out:
msgb_free(msg);
@@ -470,9 +466,13 @@
switch (endp->cfg->role) {
case MGCP_BSC_NAT:
endp->type = MGCP_OSMUX_BSC_NAT;
+   osmux_xfrm_output_set_tx_cb(&endp->osmux.out,
+   scheduled_tx_net_cb, 
endp);
break;
case MGCP_BSC:
endp->type = MGCP_OSMUX_BSC;
+   osmux_xfrm_output_set_tx_cb(&endp->osmux.out,
+   scheduled_tx_bts_cb, 
endp);
break;
}
endp->osmux.state = OSMUX_STATE_ENABLED;
@@ -484,6 +484,11 @@
 {
LOGP(DLMGCP, LOGL_INFO, "Releasing endpoint %u using Osmux CID %u\n",
 ENDPOINT_NUMBER(endp), endp->osmux.cid);
+
+   /* We are closing, we don't need pending RTP packets to be transmitted 
*/
+   osmux_xfrm_output_set_tx_cb(&endp->osmux.out, NULL, NULL);
+   osmux_xfrm_output_flush(&endp->osmux.out);
+
osmux_xfrm_input_close_circuit(endp->osmux.in, endp->osmux.cid);
endp->osmux.state = OSMUX_STATE_DISABLED;
endp->osmux.cid = -1;

--
To view, visit https://gerrit.osmocom.org/9213
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9b8a19e5b8d62deaa9bbb92d49d99e8c33b7e345
Gerrit-Change-Number: 9213
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol