Include VFIO SRIOV interfaces into TenantConfig 08/2208/3 master
authorKrisztian Lengyel <krisztian.lengyel@nokia.com>
Wed, 22 Jan 2020 09:59:17 +0000 (10:59 +0100)
committerKrisztian Lengyel <krisztian.lengyel@nokia.com>
Wed, 22 Jan 2020 14:30:41 +0000 (15:30 +0100)
Change-Id: I50d77a3ddf7de41ac4f6fa9fd4fd899df1c54616

SPECS/infra-charts.spec
SPECS/instantiate.spec
SPECS/utils.spec
ansible/filter_plugins/config_helpers.py
ansible/roles/post_install_caas_infra/templates/danm-tenant-config.yaml.j2

index a3e4200..1c4e93c 100644 (file)
@@ -15,7 +15,7 @@
 %define COMPONENT infra-charts
 %define RPM_NAME caas-%{COMPONENT}
 %define RPM_MAJOR_VERSION 1.0.0
-%define RPM_MINOR_VERSION 48
+%define RPM_MINOR_VERSION 49
 
 Name:           %{RPM_NAME}
 Version:        %{RPM_MAJOR_VERSION}
index 6db95c9..cf1a98c 100644 (file)
@@ -15,7 +15,7 @@
 %define COMPONENT instantiate
 %define RPM_NAME caas-%{COMPONENT}
 %define RPM_MAJOR_VERSION 1.0.0
-%define RPM_MINOR_VERSION 24
+%define RPM_MINOR_VERSION 25
 
 Name:           %{RPM_NAME}
 Version:        %{RPM_MAJOR_VERSION}
index a65d59c..0d888a7 100644 (file)
@@ -15,7 +15,7 @@
 %define COMPONENT utils
 %define RPM_NAME caas-%{COMPONENT}
 %define RPM_MAJOR_VERSION 1.0.0
-%define RPM_MINOR_VERSION 10
+%define RPM_MINOR_VERSION 11
 
 Name:           %{RPM_NAME}
 Version:        %{RPM_MAJOR_VERSION}
index e21726a..984ff4a 100755 (executable)
@@ -23,6 +23,7 @@ class FilterModule(object):
             'extract_sriov_provider_network_interfaces': extract_sriov_provider_network_interfaces,
             'filter_network_profiles_by_type': filter_network_profiles_by_type,
             'filter_provider_networks_by_type': filter_provider_networks_by_type,
+            'filter_dpdk_sriov_provider_networks': filter_dpdk_sriov_provider_networks,
             'get_kube_options': get_kube_options,
             'get_mapped_key': get_mapped_key,
             'get_provider_networks': get_provider_networks,
@@ -45,6 +46,11 @@ def filter_provider_networks_by_type(profile, type):
             if network.get('type', "") == type}
 
 
+def filter_dpdk_sriov_provider_networks(profile):
+    return {name: network for name, network in profile.iteritems()
+            if 0 < network.get('dpdk_vf_count', 0)}
+
+
 def get_kube_options(options):
     _validate_dict(options)
     option_template = "{}={}"
index 70f69c7..0dee1f2 100644 (file)
@@ -52,6 +52,12 @@ hostDevices:
         {% set sriov_interaces = caas_sriov_provider_networks | extract_sriov_provider_network_interfaces %}
         {% set sriov_device_pools = sriov_interaces | map('regex_replace', '(.*)', 'nokia.k8s.io/sriov_\\1') | list %}
   {{ make_host_devices(sriov_device_pools, networking['provider_networks'][tenant_network]) | indent(2) -}}
+        {% set caas_dpdk_sriov_provider_networks = caas_sriov_provider_networks | filter_dpdk_sriov_provider_networks() %}
+        {% if caas_dpdk_sriov_provider_networks %}
+          {% set dpdk_sriov_interaces = caas_dpdk_sriov_provider_networks | extract_sriov_provider_network_interfaces %}
+          {% set dpdk_sriov_device_pools = dpdk_sriov_interaces | map('regex_replace', '(.*)', 'nokia.k8s.io/sriov_vfio_\\1') | list %}
+  {{ make_host_devices(dpdk_sriov_device_pools, networking['provider_networks'][tenant_network]) | indent(2) -}}
+        {% endif %}
       {% endif %}
     {% endfor %}
   {% endfor %}