This patch adds the following VTY commands to tune AGCH queue
handling:

  agch-queue-management
  no agch-queue-management
  agch-queue-management threshold THRES low LOW high HIGH

Examples:
  agch-queue-management
    Enable queue management with default parameters (default,
    recommended)
  no agch-queue-management
    Disable it completely
  agch-queue-management threshold 0 low 25 high 75
    Start dropping at 25%, drop all messages above 75% queue length
    (relative to max queue length corresponding to T3126). Between
    low and high, drop with a probability interpolated linearly
    between 0 (low) and 1 (high).
  agch-queue-management threshold 50 low 0 high 0
    Start dropping at 50% and continue until all IMM.ASS.REJ have
    been removed from the front (output) of the queue

Sponsored-by: On-Waves ehf
---
 src/common/vty.c |   63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/src/common/vty.c b/src/common/vty.c
index d2aeed0..f7a04d6 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -158,6 +158,16 @@ static void config_write_bts_single(struct vty *vty, 
struct gsm_bts *bts)
                VTY_NEWLINE);
        vty_out(vty, " paging lifetime %u%s", 
paging_get_lifetime(btsb->paging_state),
                VTY_NEWLINE);
+       if (btsb->agch_queue_thres_level == 
GSM_BTS_AGCH_QUEUE_THRES_LEVEL_DISABLE)
+               vty_out(vty, " no agch-queue-mgmt%s", VTY_NEWLINE);
+       else if (btsb->agch_queue_thres_level == 
GSM_BTS_AGCH_QUEUE_THRES_LEVEL_DEFAULT
+                && btsb->agch_queue_low_level == 
GSM_BTS_AGCH_QUEUE_LOW_LEVEL_DEFAULT
+                && btsb->agch_queue_high_level == 
GSM_BTS_AGCH_QUEUE_HIGH_LEVEL_DEFAULT)
+               vty_out(vty, " agch-queue-mgmt%s", VTY_NEWLINE);
+       else
+               vty_out(vty, " agch-queue-mgmt threshold %d low %d high %d%s",
+                       btsb->agch_queue_thres_level, 
btsb->agch_queue_low_level,
+                       btsb->agch_queue_high_level, VTY_NEWLINE);
 
        bts_model_config_write_bts(vty, bts);
 
@@ -324,6 +334,56 @@ DEFUN(cfg_bts_paging_lifetime,
        return CMD_SUCCESS;
 }
 
+#define AGCH_QUEUE_STR "AGCH queue mgmt\n"
+
+DEFUN(cfg_bts_agch_queue_mgmt_params,
+       cfg_bts_agch_queue_mgmt_params_cmd,
+       "agch-queue-mgmt threshold <0-100> low <0-100> high <0-100000>",
+       AGCH_QUEUE_STR
+       "Threshold to start cleanup\nin %% of the maximum queue length\n"
+       "Low water mark for cleanup\nin %% of the maximum queue length\n"
+       "High water mark for cleanup\nin %% of the maximum queue length\n")
+{
+       struct gsm_bts *bts = vty->index;
+       struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
+
+       btsb->agch_queue_thres_level = atoi(argv[0]);
+       btsb->agch_queue_low_level = atoi(argv[1]);
+       btsb->agch_queue_high_level = atoi(argv[2]);
+
+       return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_agch_queue_mgmt,
+       cfg_bts_agch_queue_mgmt_cmd,
+       "agch-queue-mgmt",
+       AGCH_QUEUE_STR)
+{
+       struct gsm_bts *bts = vty->index;
+       struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
+
+       btsb->agch_queue_thres_level = GSM_BTS_AGCH_QUEUE_THRES_LEVEL_DEFAULT;
+       btsb->agch_queue_low_level = GSM_BTS_AGCH_QUEUE_LOW_LEVEL_DEFAULT;
+       btsb->agch_queue_high_level = GSM_BTS_AGCH_QUEUE_HIGH_LEVEL_DEFAULT;
+
+       return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_no_agch_queue_mgmt,
+       cfg_bts_no_agch_queue_mgmt_cmd,
+       "no agch-queue-mgmt",
+       NO_STR AGCH_QUEUE_STR)
+{
+       struct gsm_bts *bts = vty->index;
+       struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
+
+       btsb->agch_queue_thres_level = GSM_BTS_AGCH_QUEUE_THRES_LEVEL_DISABLE;
+       btsb->agch_queue_low_level = 0;
+       btsb->agch_queue_high_level = 0;
+
+       return CMD_SUCCESS;
+}
+
 
 
 /* ======================================================================
@@ -496,6 +556,9 @@ int bts_vty_init(const struct log_info *cat)
        install_element(BTS_NODE, &cfg_no_description_cmd);
        install_element(BTS_NODE, &cfg_bts_paging_queue_size_cmd);
        install_element(BTS_NODE, &cfg_bts_paging_lifetime_cmd);
+       install_element(BTS_NODE, &cfg_bts_agch_queue_mgmt_cmd);
+       install_element(BTS_NODE, &cfg_bts_no_agch_queue_mgmt_cmd);
+       install_element(BTS_NODE, &cfg_bts_agch_queue_mgmt_params_cmd);
 
        /* add and link to TRX config node */
        install_element(BTS_NODE, &cfg_bts_trx_cmd);
-- 
1.7.9.5


Reply via email to