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

Change subject: vty: Allow modifying default msclass
......................................................................

vty: Allow modifying default msclass

Until now, if timeslot resources where being allocated for an MS
whose msclass is not known, msclass=12 was being selected.
While it's true that msclass=12 is quite a usual one implemented by
phones (Rx=4, Rx=4, Sum=5), some MS implementations may not support such
modes.
As a result, if the PCU allocates a TBF for an MS which its msclass is
not known (eg. because it used 1-phase access aka no Pkt Res Req), then
a minimal msclass=1 should be assumed. Otherwise, it may assign more
multislots than the MS can handle, and will work incorrectly since an
amount of RLC/MAC blocks won't be sent/received properly.

With the existing code base, changing the default MSCLASS to 1 would,
however, create a worse user experiencie for the vast majority of devices
(which are msclass >= 12). The code should be improved to first use only
1 TS until the MS CLASS is known, and at that point reallocate resources
and re-assign them (eg. RECONFIGURE TBF rlc/mac ctrl blk).

So, for now, simply add a hidden VTY config to allow changing the
default assumed MS Class, so that operators wishing to support all
devices can eg. set it to 1.

Change-Id: If80fdd793db7dad029faa83dbf980ffc4959e2e5
---
M src/gprs_pcu.c
M src/gprs_pcu.h
M src/mslot_class.c
M src/mslot_class.h
M src/pcu_vty.c
5 files changed, 53 insertions(+), 3 deletions(-)

Approvals:
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Hoernchen: Looks good to me, but someone else must approve
  jolly: Looks good to me, but someone else must approve
  Jenkins Builder: Verified




diff --git a/src/gprs_pcu.c b/src/gprs_pcu.c
index 069f170..83ae38d 100644
--- a/src/gprs_pcu.c
+++ b/src/gprs_pcu.c
@@ -129,6 +129,7 @@
        /* TODO: increase them when CRBB decoding is implemented */
        pcu->vty.ws_base = 64;
        pcu->vty.ws_pdch = 0;
+       pcu->vty.msclass_default = PCU_DEFAULT_MSLOT_CLASS;
        pcu->vty.llc_codel_interval_msec = LLC_CODEL_USE_DEFAULT;
        pcu->vty.llc_idle_ack_csec = 10;

diff --git a/src/gprs_pcu.h b/src/gprs_pcu.h
index 66cfca3..4451996 100644
--- a/src/gprs_pcu.h
+++ b/src/gprs_pcu.h
@@ -43,6 +43,9 @@
 #define PCU_TDEF_NEIGH_CACHE_ALIVE (-10)
 #define PCU_TDEF_SI_CACHE_ALIVE    (-11)

+/* If Multislot Class is not known during TS allocation, assume ms_class=12: 
Rx=4 Tx=4 Sum=5 */
+#define PCU_DEFAULT_MSLOT_CLASS 12
+
 /* see bts->gsmtap_categ_mask */
 enum pcu_gsmtap_category {
        PCU_GSMTAP_C_DL_UNKNOWN         = 0,    /* unknown or undecodable 
downlink blocks */
@@ -108,6 +111,7 @@
                int ns_priority;
                uint16_t ws_base;
                uint16_t ws_pdch; /* increase WS by this value per PDCH */
+               uint8_t msclass_default; /* Assume this MSCLASS if unknown when 
creating TBF */
                uint16_t force_llc_lifetime; /* overrides lifetime from SGSN */
                uint32_t llc_discard_csec;
                uint32_t llc_idle_ack_csec;
diff --git a/src/mslot_class.c b/src/mslot_class.c
index 1809cd7..caab2b5 100644
--- a/src/mslot_class.c
+++ b/src/mslot_class.c
@@ -18,6 +18,7 @@

 #include <mslot_class.h>
 #include <gprs_debug.h>
+#include <gprs_pcu.h>

 #include <osmocom/core/bits.h>
 #include <osmocom/core/utils.h>
@@ -86,7 +87,7 @@

 static inline const struct gprs_ms_multislot_class *get_mslot_table(uint8_t 
ms_cl)
 {
-       uint8_t index = ms_cl ? ms_cl : DEFAULT_MSLOT_CLASS;
+       uint8_t index = ms_cl ? ms_cl : the_pcu->vty.msclass_default;

        if (ms_cl >= ARRAY_SIZE(gprs_ms_multislot_class))
                index = 0;
diff --git a/src/mslot_class.h b/src/mslot_class.h
index d273cad..0d48c83 100644
--- a/src/mslot_class.h
+++ b/src/mslot_class.h
@@ -30,8 +30,6 @@
 #define MS_C   252 /* 1 with hopping, 0 without (change Tx to Rx)*/
 #define MS_TO  251 /* 31 symbol periods (this can be provided by a TA offset, 
i.e. a minimum TA value) */

-#define DEFAULT_MSLOT_CLASS 12
-
 #define NO_FREE_TFI 0xffffffff

 enum { MASK_TT = 0, MASK_TR = 1 };
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 84c0456..9de99c8 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -279,6 +279,8 @@
        vty_out(vty, " gamma %d%s", the_pcu->vty.gamma * 2, VTY_NEWLINE);
        if (!the_pcu->vty.dl_tbf_preemptive_retransmission)
                vty_out(vty, " no dl-tbf-preemptive-retransmission%s", 
VTY_NEWLINE);
+       if (the_pcu->vty.msclass_default != PCU_DEFAULT_MSLOT_CLASS)
+               vty_out(vty, " multislot-class default %u%s", 
the_pcu->vty.msclass_default, VTY_NEWLINE);
        if (strcmp(the_pcu->pcu_sock_path, PCU_SOCK_DEFAULT))
                vty_out(vty, " pcu-socket %s%s", the_pcu->pcu_sock_path, 
VTY_NEWLINE);

@@ -882,6 +884,19 @@
        return CMD_SUCCESS;
 }

+DEFUN_ATTR_USRATTR(cfg_pcu_msclass_default,
+                  cfg_pcu_msclass_default_cmd,
+                  CMD_ATTR_HIDDEN,
+                  X(PCU_VTY_ATTR_NEW_TBF),
+                  "multislot-class default <1-45>",
+                  "MultiSlot Class configuration\n"
+                  "Set assumed default MultiSlot Class if unknown during TBF 
allocation\n"
+                  "MultiSlot Class number to use as default (default: 12)\n")
+{
+       the_pcu->vty.msclass_default = atoi(argv[0]);
+       return CMD_SUCCESS;
+}
+
 #define MS_IDLE_TIME_STR "keep an idle MS object alive for the time given\n"
 DEFUN_DEPRECATED(cfg_pcu_ms_idle_time,
       cfg_pcu_ms_idle_time_cmd,
@@ -1314,6 +1329,7 @@
        install_element(PCU_NODE, &cfg_pcu_no_dl_tbf_idle_time_cmd);
        install_element(PCU_NODE, 
&cfg_pcu_dl_tbf_preemptive_retransmission_cmd);
        install_element(PCU_NODE, 
&cfg_pcu_no_dl_tbf_preemptive_retransmission_cmd);
+       install_element(PCU_NODE, &cfg_pcu_msclass_default_cmd);
        install_element(PCU_NODE, &cfg_pcu_ms_idle_time_cmd);
        install_element(PCU_NODE, &cfg_pcu_no_ms_idle_time_cmd);
        install_element(PCU_NODE, &cfg_pcu_gsmtap_remote_host_cmd);

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: If80fdd793db7dad029faa83dbf980ffc4959e2e5
Gerrit-Change-Number: 33983
Gerrit-PatchSet: 6
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Hoernchen <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: jolly <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to