Change in osmo-gbproxy[master]: Add SDU length for an NSE (== BSSGP PDU size)

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/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Feb 18 00:57:02 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-gbproxy/+/22877 )

Change subject: Add SDU length for an NSE (== BSSGP PDU size)
......................................................................

Add SDU length for an NSE (== BSSGP PDU size)

Prepare tracking the SDU from NS. Initialize with a conservative default.
The value is not yet updated, that will happen in a later patch.

Related: OS#4889
Depends: I5016b295db6185ec131d83089cf6c806e34ef1b6 (libosmocore.git)
Depends: I9bb82ead27366b7370c9ff968e03ca2113ec11f0 (libosmocore.git)
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, 13 insertions(+), 0 deletions(-)

Approvals:
  lynxis lazus: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/sgsn/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h
index a36f305..c9d2fca 100644
--- a/include/osmocom/sgsn/gb_proxy.h
+++ b/include/osmocom/sgsn/gb_proxy.h
@@ -11,6 +11,7 @@
 #include <osmocom/gsm/gsm48.h>
 #include <osmocom/gsm/protocol/gsm_23_003.h>
 
+#include <osmocom/gprs/frame_relay.h>
 #include <osmocom/gprs/gprs_ns2.h>
 #include <osmocom/vty/command.h>
 
@@ -21,6 +22,9 @@
 #define GBPROXY_INIT_VU_GEN_TX 256
 #define GBPROXY_MAX_NR_SGSN	16
 
+/* Set conservative default BSSGP SDU (FR SDU - size of NS UNITDATA IEs) */
+#define DEFAULT_NSE_SDU (FRAME_RELAY_SDU - 4)
+
 /* BVCI uses 16 bits */
 #define BVC_LOG_CTX_FLAG (1<<17)
 
@@ -161,6 +165,9 @@
 	/* NSEI of the NSE */
 	uint16_t nsei;
 
+	/* Maximum side of the NS-UNITDATA NS SDU that can be transported by the NSE */
+	uint16_t max_sdu_len;
+
 	/* 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 8b57315..7f4af5b 100644
--- a/src/gb_proxy.c
+++ b/src/gb_proxy.c
@@ -684,6 +684,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_max_pdu_len(sgsn_bvc->fi, sgsn_nse->max_sdu_len);
 			bssgp_bvc_fsm_set_ops(sgsn_bvc->fi, &sgsn_ptp_bvc_fsm_ops, sgsn_bvc);
 
 			gbproxy_cell_add_sgsn_bvc(bvc->cell, sgsn_bvc);
@@ -828,6 +829,7 @@
 				gbproxy_bvc_free(from_bvc);
 				return -ENOMEM;
 			}
+			bssgp_bvc_fsm_set_max_pdu_len(from_bvc->fi, nse->max_sdu_len);
 			bssgp_bvc_fsm_set_ops(from_bvc->fi, &bss_sig_bvc_fsm_ops, from_bvc);
 		}
 	} else {
@@ -844,6 +846,7 @@
 				gbproxy_bvc_free(from_bvc);
 				return -ENOMEM;
 			}
+			bssgp_bvc_fsm_set_max_pdu_len(from_bvc->fi, nse->max_sdu_len);
 			bssgp_bvc_fsm_set_ops(from_bvc->fi, &bss_ptp_bvc_fsm_ops, from_bvc);
 		}
 #if 0
@@ -1500,6 +1503,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..a9471f0 100644
--- a/src/gb_proxy_peer.c
+++ b/src/gb_proxy_peer.c
@@ -447,6 +447,7 @@
 		return NULL;
 
 	nse->nsei = nsei;
+	nse->max_sdu_len = DEFAULT_NSE_SDU;
 	nse->cfg = cfg;
 	nse->sgsn_facing = sgsn_facing;
 
diff --git a/src/gb_proxy_vty.c b/src/gb_proxy_vty.c
index 04c7173..3a52e32 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_max_pdu_len(bvc->fi, nse->max_sdu_len);
 		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: 4
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210218/d44c3167/attachment.htm>


More information about the gerrit-log mailing list