Commit 4f2d9791 authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: enb.jinja2.cfg: lte: Move tunable parameters from cell_default to cell_list

Currently we set some cell tunable parameters on the cell object itself
(e.g. dl_earfcn), while other cell tunable parameters on the
cell_default object, e.g. cell bandwidth. This works ok when there is
only one cell, but with multiple cells it makes a problem because
different cells can have e.g. different bandwidth.

So as preparatory step for MultiRU move the code, that sets tunable
parameters for lte cells, from cell_default to cell object itself.

Rendered config changes but we can verify that the configuration, that
enb actually uses, stays the same: When enb starts it builds internal
configuration for all configured cell objects by merging cell_default +
cell's explicit configuration and using the result as the actual
configuration for the cell. There is no more cell_default in that actual
configuration. And also enb emits that actual runtime configuration in
the beginning of enb.log which we can extract and investigate(*)

So this way we can run enb with old and new generated enb.cfg and then
compare the actual configuration. It turns out to be empty:

    ~/enb# ./lteenb -n x/old/enb.cfg
    ...
    RF0: sample_rate=11.520 MHz dl_freq=1910.000 MHz ul_freq=1910.000 MHz (band 33) dl_ant=2 ul_ant=2
    (enb) quit
    ~/enb# mv log/enb.log log/enb.log.old

    ~/enb# ./lteenb -n x/out/enb.cfg
    ...
    RF0: sample_rate=11.520 MHz dl_freq=1910.000 MHz ul_freq=1910.000 MHz (band 33) dl_ant=2 ul_ant=2
    (enb) quit
    ~/enb# mv log/enb.log log/enb.log.new

    ~/enb# ../ots/json_util log log/enb.log.old >a
    ~/enb# ../ots/json_util log log/enb.log.new >b
    ~/enb# diff -u a b  # output is empty

which means that effective enb configuration before and after this patch is exactly the same.

For the reference, how internal configuration looks like is provided in the appendix.

(*) see https://tech-academy.amarisoft.com/ExtractConfigFromLog.html for details.

/cc @lu.xu, @tomo, @xavier_thompson, @Daetalus
/reviewed-by @jhuge
/reviewed-on nexedi/slapos!1515

P.S. for now I do not plan to expose full measurement configuration in
     the generic MultiRU and so it stays in cell_default with corresponding TODO.

--------

Appendix. Dump of internal enb configuration for enb.cfg before and after the patch

```
$ ../ots/json_util log log/enb.log.old
```

```json
{
    "cell_list": [
        {
            "cell_barred": false,
            "cell_id": 0,
            "cipher_algo_pref": [],
            "cqi_period": 40,
            "cyclic_prefix": "normal",
            "dl_256qam": true,
            "dl_earfcn": 36100,
            "dpc": true,
            "dpc_pucch_snr_target": 25,
            "dpc_pusch_snr_target": 25,
            "drb_config": [ ... ],		# removed for brevity
            "ho_from_meas": true,
            "inactivity_timer": 10000,
            "initial_cqi": 3,
            "integ_algo_pref": [2, 1],
            "intra_freq_reselection": true,
            "m_ri": 8,
            "mac_config": {
                "dl_max_harq_tx": 5,
                "ul_max_harq_tx": 5
            },
            "manual_ref_signal_power": true,
            "meas_config_desc": {
                "a1_hysteresis": 0,
                "a1_report_type": "rsrp",
                "a1_rsrp": -70,
                "a1_time_to_trigger": 640,
                "a2_hysteresis": 0,
                "a2_report_type": "rsrp",
                "a2_rsrp": -80,
                "a2_time_to_trigger": 640,
                "a3_hysteresis": 0,
                "a3_offset": 6,
                "a3_report_type": "rsrp",
                "a3_time_to_trigger": 480
            },
            "meas_gap_config": "gp0",
            "n_antenna_dl": 2,
            "n_antenna_ul": 2,
            "n_id_cell": 0,
            "n_rb_dl": 50,
            "n_symb_cch": 0,
            "pdcch_format": 2,
            "pdsch_dedicated": {
                "p_a": -3,
                "p_b": -1
            },
            "phich_duration": "normal",
            "phich_resource": "1",
            "plmn_list": ["00101"],
            "prach_config_index": 4,
            "prach_freq_offset": -1,
            "pucch_dedicated": {
                "cqi_pucch_n_rb": 1,
                "n1_pucch_sr_count": 11,
                "tdd_ack_nack_feedback_mode": "multiplexing"
            },
            "pusch_dedicated": {
                "beta_offset_ack_index": 9,
                "beta_offset_cqi_index": 6,
                "beta_offset_ri_index": 6
            },
            "pusch_hopping_offset": -1,
            "pusch_max_its": 6,
            "pusch_msg3_mcs": 0,
            "q_rx_lev_min": -70,
            "rf_port": 0,
            "root_sequence_index": 204,
            "scell_list": [],
            "si_coderate": 0.2,
            "si_pdcch_format": 2,
            "si_value_tag": 0,
            "si_window_length": 40,
            "sib_sched_list": [ ... ],		# remove for brevity
            "sp_config": 7,
            "sr_period": 20,
            "srb_config": [
                {
                    "id": 1,
                    "maxRetxThreshold": 32,
                    "t_PollRetransmit": 60,
                    "t_Reordering": 45
                },
                {
                    "id": 2,
                    "maxRetxThreshold": 32,
                    "t_PollRetransmit": 60,
                    "t_Reordering": 45
                }
            ],
            "srs_dedicated": {
                "srs_bandwidth": 2,
                "srs_bandwidth_config": 2,
                "srs_hopping_bandwidth": 0,
                "srs_period": 40,
                "srs_subframe_config": 3
            },
            "tac": 1,
            "transmission_mode": 3,
            "ul_64qam": true,
            "uldl_config": 6
        }
    ],
    "com_addr": "127.0.1.2:9001",
    "enb_id": 107216,
    "gtp_addr": "127.0.1.1",
    "log_filename": "log/enb.log",
    "log_options": "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
    "mme_list": [
        {
            "mme_addr": "127.0.1.100"
        }
    ],
    "rf_driver": {
        "args": "dev0=/dev/sdr0",
        "name": "sdr",
        "realtime": 1,
        "rx_antenna": "tx_rx",
        "tdd_tx_mod": 1
    },
    "rx_gain": 43,
    "tx_gain": 62
}
```
parent fe512654
......@@ -108,7 +108,7 @@ md5sum = dcaac06553a3222b14c0013a13f4a149
[enb.jinja2.cfg]
filename = config/enb.jinja2.cfg
md5sum = 914d781af63f4214e6cc3be4ffe93215
md5sum = 118ec404449cbe471d7d89f8867a5187
[drb_lte.jinja2.cfg]
filename = config/drb_lte.jinja2.cfg
......
......@@ -252,17 +252,18 @@
cell_list: [
{%- if do_lte %}
{%- for i, k in enumerate(cell_list) %}
{%- if i == 0 -%}
{
{%- else -%}
, {
{%- endif %}
rf_port: {{ i }},
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: N_ANTENNA_UL,
cell_id: {{ cell_list[k].get('cell_id', slapparameter_dict.get('cell_id', '0x0' + i|string)) }},
tac: {{ cell_list[k].get('tac', slapparameter_dict.get('tac', '0x0001')) }},
n_id_cell: {{ cell_list[k].get('pci', slapparameter_dict.get('pci', i)) }},
root_sequence_index: {{ cell_list[k].get('root_sequence_index', slapparameter_dict.get('root_sequence_index', 204 + i)) }},
dl_earfcn: {{ cell_list[k].get('dl_earfcn', slapparameter_dict.get('dl_earfcn', earfcn)) }},
inactivity_timer: {{ slapparameter_dict.get('inactivity_timer', slap_configuration['configuration.default_lte_inactivity_timer']) }},
{%- if slapparameter_dict.get('ncell_list', '') %}
ncell_list: [
{%- for i, k in enumerate(slapparameter_dict['ncell_list']) %}
......@@ -297,65 +298,22 @@
}
{%- endfor %}
],
}
{%- endfor %}
{%- endif %}
],
{%- if do_lte %}
cell_default: {
plmn_list: [
{%- if slapparameter_dict.get('plmn_list', '') %}
{%- for i, k in enumerate(slapparameter_dict['plmn_list']) %}
{%- if i == 0 -%}
{
{%- else -%}
, {
{%- endif %}
plmn: "{{ slapparameter_dict['plmn_list'][k]['plmn'] }}",
reserved: {{ str(slapparameter_dict['plmn_list'][k].get('reserved', false)).lower() }},
attach_without_pdn: {{ str(slapparameter_dict['plmn_list'][k].get('attach_without_pdn', false)).lower() }},
}
{%- endfor -%}
{% else %}
"00101",
{% endif %}
],
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: N_ANTENNA_UL,
{% if bbu == "ors" %}
manual_ref_signal_power: true,
{% endif %}
#if TDD == 1
uldl_config: {{ tdd_config }},
sp_config: 7,
#endif
n_rb_dl: N_RB_DL,
cyclic_prefix: "normal",
phich_duration: "normal",
phich_resource: "1",
si_value_tag: 0,
cell_barred: false,
intra_freq_reselection: true,
q_rx_lev_min: -70,
si_window_length: 40,
sib_sched_list: [
{
filename: "{{ sib23_file }}",
si_periodicity: 16,
},
],
n_rb_dl: N_RB_DL,
#if N_RB_DL == 6
si_coderate: 0.30,
#else
si_coderate: 0.20,
#endif
si_pdcch_format: 2,
n_symb_cch: 0,
pdsch_dedicated: {
#if N_ANTENNA_DL == 4
......@@ -379,7 +337,12 @@
#else
prach_config_index: 4,
#endif
prach_freq_offset: -1,
#if N_RB_DL == 6
initial_cqi: 5,
#else
initial_cqi: 3,
#endif
pucch_dedicated: {
n1_pucch_sr_count: 11,
......@@ -389,29 +352,6 @@
#endif
},
pusch_dedicated: {
beta_offset_ack_index: 9,
beta_offset_ri_index: 6,
beta_offset_cqi_index: 6,
},
pusch_hopping_offset: -1,
pusch_msg3_mcs: 0,
#if N_RB_DL == 6
initial_cqi: 5,
#else
initial_cqi: 3,
#endif
dl_256qam: true,
ul_64qam: true,
sr_period: 20,
cqi_period: 40,
#if N_ANTENNA_DL >= 2
m_ri: 8,
transmission_mode: 3,
......@@ -442,6 +382,72 @@
srs_hopping_bandwidth: 0,
},
drb_config: "{{ drb_file }}",
sib_sched_list: [
{
filename: "{{ sib23_file }}",
si_periodicity: 16,
},
],
},
{%- endfor %}
{%- endif %}
],
{%- if do_lte %}
cell_default: {
plmn_list: [
{%- if slapparameter_dict.get('plmn_list', '') %}
{%- for i, k in enumerate(slapparameter_dict['plmn_list']) %}
{%- if i == 0 -%}
{
{%- else -%}
, {
{%- endif %}
plmn: "{{ slapparameter_dict['plmn_list'][k]['plmn'] }}",
reserved: {{ str(slapparameter_dict['plmn_list'][k].get('reserved', false)).lower() }},
attach_without_pdn: {{ str(slapparameter_dict['plmn_list'][k].get('attach_without_pdn', false)).lower() }},
}
{%- endfor -%}
{% else %}
"00101",
{% endif %}
],
cyclic_prefix: "normal",
phich_duration: "normal",
phich_resource: "1",
si_value_tag: 0,
cell_barred: false,
intra_freq_reselection: true,
q_rx_lev_min: -70,
si_window_length: 40,
si_pdcch_format: 2,
n_symb_cch: 0,
prach_freq_offset: -1,
pusch_dedicated: {
beta_offset_ack_index: 9,
beta_offset_ri_index: 6,
beta_offset_cqi_index: 6,
},
pusch_hopping_offset: -1,
pusch_msg3_mcs: 0,
dl_256qam: true,
ul_64qam: true,
sr_period: 20,
cqi_period: 40,
mac_config: {
ul_max_harq_tx: 5,
dl_max_harq_tx: 5,
......@@ -456,8 +462,6 @@
cipher_algo_pref: [],
integ_algo_pref: [2, 1],
inactivity_timer: {{ slapparameter_dict.get('inactivity_timer', slap_configuration['configuration.default_lte_inactivity_timer']) }},
srb_config: [
{
id: 1,
......@@ -473,8 +477,7 @@
}
],
drb_config: "{{ drb_file }}",
{# TODO fully expose lte meas_config_desc in generic SR #}
meas_config_desc: {
a1_report_type: "rsrp",
a1_rsrp: -70,
......
......@@ -145,8 +145,8 @@ def test_enb_conf(self):
if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
self.assertEqual(conf['cell_default']['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_default']['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_list'][0]['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn'])
self.assertEqual(conf['enb_id'], int(enb_param_dict['enb_id'], 16))
self.assertEqual(conf['cell_list'][0]['n_id_cell'], enb_param_dict['pci'])
......
......@@ -145,8 +145,8 @@ def test_enb_conf(self):
if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
self.assertEqual(conf['cell_default']['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_default']['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_list'][0]['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn'])
self.assertEqual(conf['enb_id'], int(enb_param_dict['enb_id'], 16))
self.assertEqual(conf['cell_list'][0]['n_id_cell'], enb_param_dict['pci'])
......
......@@ -145,8 +145,8 @@ def test_enb_conf(self):
if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
self.assertEqual(conf['cell_default']['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_default']['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_list'][0]['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn'])
self.assertEqual(conf['enb_id'], int(enb_param_dict['enb_id'], 16))
self.assertEqual(conf['cell_list'][0]['n_id_cell'], enb_param_dict['pci'])
......
......@@ -145,8 +145,8 @@ def test_enb_conf(self):
if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
self.assertEqual(conf['cell_default']['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_default']['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_list'][0]['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn'])
self.assertEqual(conf['enb_id'], int(enb_param_dict['enb_id'], 16))
self.assertEqual(conf['cell_list'][0]['n_id_cell'], enb_param_dict['pci'])
......
......@@ -145,8 +145,8 @@ def test_enb_conf(self):
if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
self.assertEqual(conf['cell_default']['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_default']['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_list'][0]['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn'])
self.assertEqual(conf['enb_id'], int(enb_param_dict['enb_id'], 16))
self.assertEqual(conf['cell_list'][0]['n_id_cell'], enb_param_dict['pci'])
......
......@@ -145,8 +145,8 @@ def test_enb_conf(self):
if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
self.assertEqual(conf['cell_default']['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_default']['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_list'][0]['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn'])
self.assertEqual(conf['enb_id'], int(enb_param_dict['enb_id'], 16))
self.assertEqual(conf['cell_list'][0]['n_id_cell'], enb_param_dict['pci'])
......
......@@ -145,8 +145,8 @@ def test_enb_conf(self):
if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
self.assertEqual(conf['cell_default']['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_default']['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_list'][0]['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn'])
self.assertEqual(conf['enb_id'], int(enb_param_dict['enb_id'], 16))
self.assertEqual(conf['cell_list'][0]['n_id_cell'], enb_param_dict['pci'])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment