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
This commit is contained in:
Pau Espin 2023-08-22 12:34:34 +02:00
parent 60664a4df1
commit 2ef1651f5d
5 changed files with 23 additions and 3 deletions

View File

@ -131,6 +131,7 @@ struct gprs_pcu *gprs_pcu_alloc(void *ctx)
pcu->vty.ws_pdch = 0;
pcu->vty.llc_codel_interval_msec = LLC_CODEL_USE_DEFAULT;
pcu->vty.llc_idle_ack_csec = 10;
pcu->vty.msclass_default = PCU_DEFAULT_MSLOT_CLASS;
pcu->T_defs = T_defs_pcu;
osmo_tdefs_reset(pcu->T_defs);

View File

@ -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 */
@ -112,6 +115,7 @@ struct gprs_pcu {
uint32_t llc_discard_csec;
uint32_t llc_idle_ack_csec;
uint32_t llc_codel_interval_msec; /* 0=disabled, -1=use default interval */
uint8_t msclass_default; /* Assume this MSCLASS if unknown when creating TBF */
} vty;
struct gsmtap_inst *gsmtap;

View File

@ -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;

View File

@ -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 };

View File

@ -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);