diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-08-22 12:34:34 +0200 |
---|---|---|
committer | pespin <pespin@sysmocom.de> | 2023-08-23 11:55:59 +0000 |
commit | 3a6e19ce2b803161662785bfd41dd33012dd0fcc (patch) | |
tree | 3dd058135ff92b7e8d0b6e19e06fb7b1fdc46604 | |
parent | 245d340006a4855880b9a546f24fd699bbbc0915 (diff) |
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
-rw-r--r-- | src/gprs_pcu.c | 1 | ||||
-rw-r--r-- | src/gprs_pcu.h | 4 | ||||
-rw-r--r-- | src/mslot_class.c | 3 | ||||
-rw-r--r-- | src/mslot_class.h | 2 | ||||
-rw-r--r-- | src/pcu_vty.c | 16 |
5 files changed, 23 insertions, 3 deletions
diff --git a/src/gprs_pcu.c b/src/gprs_pcu.c index 069f1704..83ae38d8 100644 --- a/src/gprs_pcu.c +++ b/src/gprs_pcu.c @@ -129,6 +129,7 @@ struct gprs_pcu *gprs_pcu_alloc(void *ctx) /* 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 66cfca33..44519964 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 @@ struct gprs_pcu { 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 1809cd76..caab2b51 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 const struct gprs_ms_multislot_class gprs_ms_multislot_class[] = { 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 d273cad8..0d48c83d 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 84c04568..9de99c82 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -279,6 +279,8 @@ static int config_write_pcu(struct vty *vty) 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 @@ DEFUN_ATTR(cfg_pcu_no_dl_tbf_preemptive_retransmission, 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 @@ int pcu_vty_init(void) 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); |