Commit 473009c8 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 1c79ee77
......@@ -98,11 +98,11 @@
{%- endif %}
{%- set dev_argv = [] %}
{%- ru_cpri_dict = {} %} {# dev -> ru #}
{%- ru_cpri_dict = {} %} {# dev -> ru for ru with link_kind = cpri #}
{%- for rf_port, (ru_ref, ru) in enumerate(ru_dict|dictsort) %}
{%- do ru['.rf_port'] = rf_port %}
{%- if ru['ru_type'] == 'sdr' %}
XXX mov to ru/sdr ?
XXX move to ru/sdr ?
{%- for n in ru['dev_list'] %}
{%- do dev_argv.append("dev%d=/dev/sdr%d" % (len(dev_argv), n)) %}
{%- endfor %}
......@@ -111,8 +111,12 @@
{%- elif ru['ru_link_type'] == 'cpri' %}
{%- do ru_cpri_dict[len(dev_argv)] = ru %}
{%- do dev_argv.append("dev%d=/dev/sdr%d@%d" % (len(dev_argv), ru['sdr_dev'], ru['sfp_port'])) %}
XXX set cpri parameters to default
{%- ru.setdefault('cpri_mapping', 'hw') %} ... <- should be preset set by ru ?
{# set cpri parameters to default
{%- ru.setdefault('cpri_mapping', 'hw') %} XXX <- should be preset set by ru? (specific to ru?)
{%- ru.setdefault('cpri_mult', 16) %}
{%- ru.setdefault('cpri_rx_delay', 0) %}
{%- ru.setdefault('cpri_tx_delay', 0) %}
{%- ru.setdefault('cpri_tx_dbm', 0) %}
{%- else %}
{{ bug('unreachable') %}
{%- endif %}
......@@ -124,7 +128,7 @@
{# NOTE values for non-cpri links come as empty XXX recheck this is ok #}
{%- if ru_cpri_dict|length > 0 %}
{%- set vcpri = [None]*(dev_argv|length) %}
{%- for dev, ru in ru_cpri_dict %}
{%- for dev, ru in ru_cpri_dict|dictsort %}
{%- do vcpri[dev] = ru %}
{%- endfor %}
cpri_mapping: "{{ vcpri | map(attribute='cpri_mapping') | join(',') }}",
......@@ -132,8 +136,17 @@
cpri_rx_delay: "{{ vcpri | map(attribute='cpri_rx_delay') | join(',') }}",
cpri_tx_delay: "{{ vcpri | map(attribute='cpri_tx_delay') | join(',') }}",
cpri_tx_dbm: "{{ vcpri | map(attribute='cpri_tx_dbm') | join(',') }}",
ifname: "{{ vcpri | map(attribute='ifname') | join(',') }}",
{%- endif %}
{%- set tap_base = slap_configuration.get('tap-name', '') %}
{%- set vtap = ['']*(dev_argv|length) %}
{%- for i, (dev, _) in enumerate(ru_cpri_dict|dictsort) %}
{%- if ru_cpri_dict|length > 1 %}
{%- set tap = "%s-%d" % (tap_base, i) %}
{%- else %}
{%- set tap = tap_base %}
{%- do vtap[dev] = tap %}
{%- endfor %}
ifname: "{{ vtap | join(',') }}",
{%- endif %}
}
......
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