Change in osmo-pcu[master]: Move dl_arq_type field from BTS to PCU

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

pespin gerrit-no-reply at lists.osmocom.org
Mon Jan 18 14:44:53 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/22183 )

Change subject: Move dl_arq_type field from BTS to PCU
......................................................................

Move dl_arq_type field from BTS to PCU

Change-Id: I0b82ab59edd58d60e5581c707dc49f58de0ba203
---
M src/bts.cpp
M src/bts.h
M src/coding_scheme.h
M src/gprs_pcu.c
M src/gprs_pcu.h
M src/pcu_vty.c
M src/tbf_dl.cpp
M tests/tbf/TbfTest.cpp
8 files changed, 19 insertions(+), 29 deletions(-)

Approvals:
  lynxis lazus: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/bts.cpp b/src/bts.cpp
index 46f0033..5eefc36 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -245,12 +245,6 @@
 	bts->llc_codel_interval_msec = LLC_CODEL_USE_DEFAULT;
 	bts->llc_idle_ack_csec = 10;
 
-	/*
-	 * By default resegmentation is supported in DL
-	 * can also be configured through VTY
-	 */
-	bts->dl_arq_type = EGPRS_ARQ1;
-
 	bts->app_info = NULL;
 	bts->bts = bts_obj;
 	bts->T_defs_bts = T_defs_bts;
diff --git a/src/bts.h b/src/bts.h
index 1394bfe..b46621a 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -108,8 +108,6 @@
 
 	uint8_t si13[GSM_MACBLOCK_LEN];
 	bool si13_is_set;
-	/* 0 to support resegmentation in DL, 1 for no reseg */
-	uint8_t dl_arq_type;
 
 	uint8_t cs_adj_enabled; /* whether cs_adj_{upper,lower}_limit are used to adjust DL CS */
 	uint8_t cs_adj_upper_limit; /* downgrade DL CS if error rate above its value */
diff --git a/src/coding_scheme.h b/src/coding_scheme.h
index ea1ded1..1b21265 100644
--- a/src/coding_scheme.h
+++ b/src/coding_scheme.h
@@ -38,8 +38,10 @@
 	EGPRS,
 };
 
-#define EGPRS_ARQ1            0x0
-#define EGPRS_ARQ2            0x1
+enum egprs_arq_type {
+	EGPRS_ARQ1 = 0,
+	EGPRS_ARQ2 = 1
+};
 
 extern const struct value_string mcs_names[];
 const char *mcs_name(enum CodingScheme val);
diff --git a/src/gprs_pcu.c b/src/gprs_pcu.c
index 3b44d36..2a84f7b 100644
--- a/src/gprs_pcu.c
+++ b/src/gprs_pcu.c
@@ -52,6 +52,9 @@
 	pcu->vty.max_mcs_dl = MAX_EDGE_MCS;
 	pcu->vty.alpha = 0; /* a = 0.0 */
 	pcu->vty.dl_tbf_preemptive_retransmission = true;
+	/* By default resegmentation is supported in DL can also be configured
+	 * through VTY */
+	pcu->vty.dl_arq_type = EGPRS_ARQ1;
 
 	pcu->T_defs = T_defs_pcu;
 	osmo_tdefs_reset(pcu->T_defs);
diff --git a/src/gprs_pcu.h b/src/gprs_pcu.h
index 2f2fdc7..f07510b 100644
--- a/src/gprs_pcu.h
+++ b/src/gprs_pcu.h
@@ -27,6 +27,7 @@
 #include <osmocom/core/gsmtap_util.h>
 
 #include "gprs_bssgp_pcu.h"
+#include "coding_scheme.h"
 
 #define LLC_CODEL_DISABLE 0
 #define LLC_CODEL_USE_DEFAULT (-1)
@@ -77,6 +78,7 @@
 		uint8_t force_two_phase;
 		uint8_t alpha, gamma;
 		bool dl_tbf_preemptive_retransmission;
+		enum egprs_arq_type dl_arq_type; /* EGPRS_ARQ1 to support resegmentation in DL, EGPRS_ARQ2 for no reseg */
 	} vty;
 
 	struct gsmtap_inst *gsmtap;
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 727712d..ef86879 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -198,9 +198,8 @@
 	vty_out(vty, " window-size %d %d%s", bts->ws_base, bts->ws_pdch,
 		VTY_NEWLINE);
 
-	if (bts->dl_arq_type)
-		vty_out(vty, " egprs dl arq-type arq2%s",
-			VTY_NEWLINE);
+	if (the_pcu->vty.dl_arq_type == EGPRS_ARQ2)
+		vty_out(vty, " egprs dl arq-type arq2%s", VTY_NEWLINE);
 
 	if (bts->force_llc_lifetime == 0xffff)
 		vty_out(vty, " queue lifetime infinite%s", VTY_NEWLINE);
@@ -574,12 +573,10 @@
 	   "enable ARQ2 support",
 	   CMD_ATTR_IMMEDIATE)
 {
-	struct gprs_rlcmac_bts *bts = bts_main_data();
-
 	if (!strcmp(argv[0], "arq2"))
-		bts->dl_arq_type = 1;
+		the_pcu->vty.dl_arq_type = EGPRS_ARQ2;
 	else
-		bts->dl_arq_type = 0;
+		the_pcu->vty.dl_arq_type = EGPRS_ARQ1;
 
 	return CMD_SUCCESS;
 }
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 6f57e7d..b6d3a9e 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -486,7 +486,7 @@
 			/* Table 8.1.1.2 and Table 8.1.1.1 of 44.060 */
 			m_rlc.block(bsn)->cs_current_trans = get_retx_mcs(m_rlc.block(bsn)->cs_init,
 									  ms_current_cs_dl(ms()),
-									  !bts->bts_data()->dl_arq_type);
+									  bts->pcu->vty.dl_arq_type == EGPRS_ARQ1);
 
 			LOGPTBFDL(this, LOGL_DEBUG,
 				  "initial_cs_dl(%s) last_mcs(%s) demanded_mcs(%s) cs_trans(%s) arq_type(%d) bsn(%d)\n",
@@ -494,7 +494,7 @@
 				  mcs_name(m_rlc.block(bsn)->cs_last),
 				  mcs_name(ms_current_cs_dl(ms())),
 				  mcs_name(m_rlc.block(bsn)->cs_current_trans),
-				  bts->bts_data()->dl_arq_type, bsn);
+				  the_pcu->vty.dl_arq_type, bsn);
 
 			/* TODO: Need to remove this check when MCS-8 -> MCS-6
 			 * transistion is handled.
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 69f07aa..52403e1 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -2525,7 +2525,6 @@
 {
 	the_pcu->bts = bts_alloc(the_pcu);
 	BTS *the_bts = the_pcu->bts;
-	gprs_rlcmac_bts *bts;
 	uint8_t ms_class = 11;
 	uint8_t egprs_ms_class = 11;
 	uint8_t trx_no;
@@ -2546,12 +2545,10 @@
 
 	fprintf(stderr, "=== start %s ===\n", __func__);
 
-	bts = the_bts->bts_data();
-
 	setup_bts(the_bts, ts_no);
 	OSMO_ASSERT(osmo_tdef_set(the_pcu->T_defs, -2031, 200, OSMO_TDEF_MS) == 0);
 	/* ARQ II */
-	bts->dl_arq_type = EGPRS_ARQ2;
+	the_pcu->vty.dl_arq_type = EGPRS_ARQ2;
 
 	/*
 	 * Simulate a message captured during over-the-air testing,
@@ -3083,7 +3080,7 @@
 	setup_bts(the_bts, ts_no);
 	OSMO_ASSERT(osmo_tdef_set(the_pcu->T_defs, -2031, 200, OSMO_TDEF_MS) == 0);
 	/* ARQ II */
-	bts->dl_arq_type = EGPRS_ARQ2;
+	the_pcu->vty.dl_arq_type = EGPRS_ARQ2;
 
 
 	/* First parameter is current MCS, second one is demanded_mcs */
@@ -3114,7 +3111,7 @@
 	OSMO_ASSERT(osmo_tdef_set(the_pcu->T_defs, -2031, 200, OSMO_TDEF_MS) == 0);
 
 	/* ARQ I resegmentation support */
-	bts->dl_arq_type = EGPRS_ARQ1;
+	the_pcu->vty.dl_arq_type = EGPRS_ARQ1;
 
 	/*
 	 * First parameter is current MCS, second one is demanded_mcs
@@ -3135,18 +3132,15 @@
 {
 	the_pcu->bts = bts_alloc(the_pcu);
 	BTS *the_bts = the_pcu->bts;
-	gprs_rlcmac_bts *bts;
 	uint8_t ts_no = 4;
 	int i;
 
 	fprintf(stderr, "=== start %s ===\n", __func__);
 
-	bts = the_bts->bts_data();
-
 	setup_bts(the_bts, ts_no);
 	OSMO_ASSERT(osmo_tdef_set(the_pcu->T_defs, -2031, 200, OSMO_TDEF_MS) == 0);
 	/* ARQ II */
-	bts->dl_arq_type = EGPRS_ARQ2;
+	the_pcu->vty.dl_arq_type = EGPRS_ARQ2;
 
 	for (i = 1; i <= 9; i++)
 		establish_and_use_egprs_dl_tbf(the_bts, i);

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I0b82ab59edd58d60e5581c707dc49f58de0ba203
Gerrit-Change-Number: 22183
Gerrit-PatchSet: 5
Gerrit-Owner: pespin <pespin 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/20210118/07b60634/attachment.htm>


More information about the gerrit-log mailing list