Change in osmo-gbproxy[master]: WIP: Set BSSGP PDU MTU from NS SDU MTU

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

daniel gerrit-no-reply at lists.osmocom.org
Fri Feb 12 04:06:44 UTC 2021


daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-gbproxy/+/22877 )


Change subject: WIP: Set BSSGP PDU MTU from NS SDU MTU
......................................................................

WIP: Set BSSGP PDU MTU from NS SDU MTU

Related: OS#4889
Change-Id: Ic1080abde942ec5a2ae7cdee0ffe716a2fbddb1e
---
M include/osmocom/sgsn/gb_proxy.h
M src/gb_proxy.c
M src/gb_proxy_peer.c
M src/gb_proxy_vty.c
4 files changed, 11 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gbproxy refs/changes/77/22877/1

diff --git a/include/osmocom/sgsn/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h
index a36f305..9f07503 100644
--- a/include/osmocom/sgsn/gb_proxy.h
+++ b/include/osmocom/sgsn/gb_proxy.h
@@ -21,6 +21,9 @@
 #define GBPROXY_INIT_VU_GEN_TX 256
 #define GBPROXY_MAX_NR_SGSN	16
 
+/* Set the FR MTU as default (IP can fragment) - FR Header - NS-UNITDATA Header */
+#define DEFAULT_NSE_MTU (1600 - 2 - 4)
+
 /* BVCI uses 16 bits */
 #define BVC_LOG_CTX_FLAG (1<<17)
 
@@ -160,6 +163,8 @@
 
 	/* NSEI of the NSE */
 	uint16_t nsei;
+	/* MTU of the NSE */
+	uint16_t mtu;
 
 	/* Are we facing towards a SGSN (true) or BSS (false) */
 	bool sgsn_facing;
diff --git a/src/gb_proxy.c b/src/gb_proxy.c
index a226b93..c4062fd 100644
--- a/src/gb_proxy.c
+++ b/src/gb_proxy.c
@@ -700,6 +700,7 @@
 			sgsn_bvc->fi = bssgp_bvc_fsm_alloc_ptp_bss(sgsn_bvc, cfg->nsi, sgsn_nse->nsei,
 								   bvci, ra_id, cell_id);
 			OSMO_ASSERT(sgsn_bvc->fi);
+			bssgp_bvc_fsm_set_mtu(sgsn_bvc->fi, sgsn_nse->mtu);
 			bssgp_bvc_fsm_set_ops(sgsn_bvc->fi, &sgsn_ptp_bvc_fsm_ops, sgsn_bvc);
 
 			gbproxy_cell_add_sgsn_bvc(bvc->cell, sgsn_bvc);
@@ -844,6 +845,7 @@
 				gbproxy_bvc_free(from_bvc);
 				return -ENOMEM;
 			}
+			bssgp_bvc_fsm_set_mtu(from_bvc->fi, nse->mtu);
 			bssgp_bvc_fsm_set_ops(from_bvc->fi, &bss_sig_bvc_fsm_ops, from_bvc);
 		}
 	} else {
@@ -860,6 +862,7 @@
 				gbproxy_bvc_free(from_bvc);
 				return -ENOMEM;
 			}
+			bssgp_bvc_fsm_set_mtu(from_bvc->fi, nse->mtu);
 			bssgp_bvc_fsm_set_ops(from_bvc->fi, &bss_ptp_bvc_fsm_ops, from_bvc);
 		}
 #if 0
@@ -1522,6 +1525,7 @@
 {
 	/* TODO: bss nsei available/unavailable  bssgp_tx_simple_bvci(BSSGP_PDUT_BVC_BLOCK, nsvc->nsei, bvc->bvci, 0);
 	 * TODO: sgsn nsei available/unavailable
+	 * TODO: Update MTU
 	 */
 
 	struct gbproxy_bvc *bvc;
diff --git a/src/gb_proxy_peer.c b/src/gb_proxy_peer.c
index 27d73b8..6aed38c 100644
--- a/src/gb_proxy_peer.c
+++ b/src/gb_proxy_peer.c
@@ -447,6 +447,7 @@
 		return NULL;
 
 	nse->nsei = nsei;
+	nse->mtu = DEFAULT_NSE_MTU;
 	nse->cfg = cfg;
 	nse->sgsn_facing = sgsn_facing;
 
diff --git a/src/gb_proxy_vty.c b/src/gb_proxy_vty.c
index d62fe5f..11a1215 100644
--- a/src/gb_proxy_vty.c
+++ b/src/gb_proxy_vty.c
@@ -241,6 +241,7 @@
 		bvc->fi = bssgp_bvc_fsm_alloc_sig_bss(bvc, nse->cfg->nsi, nsei, features);
 		if (!bvc->fi)
 			goto free_bvc;
+		bssgp_bvc_fsm_set_mtu(bvc->fi, nse->mtu);
 		bssgp_bvc_fsm_set_ops(bvc->fi, &sgsn_sig_bvc_fsm_ops, bvc);
 		osmo_fsm_inst_dispatch(bvc->fi, BSSGP_BVCFSM_E_REQ_RESET, &cause);
 	}

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/22877
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: Ic1080abde942ec5a2ae7cdee0ffe716a2fbddb1e
Gerrit-Change-Number: 22877
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210212/3d2decd3/attachment.htm>


More information about the gerrit-log mailing list