AETHER-724 Add support of running UPF from SRIOV enabled VM

Change-Id: I4d9f337d1a91dedb35934246ba8703553a130820
diff --git a/omec/omec-upf-cni/Chart.yaml b/omec/omec-upf-cni/Chart.yaml
index ae32d3b..9ad20b7 100644
--- a/omec/omec-upf-cni/Chart.yaml
+++ b/omec/omec-upf-cni/Chart.yaml
@@ -9,4 +9,4 @@
 name: omec-upf-cni
 icon: https://guide.opencord.org/logos/cord.svg
 
-version: 0.1.1
+version: 0.1.2
diff --git a/omec/omec-upf-cni/templates/configmap-sriov-conf.yaml b/omec/omec-upf-cni/templates/configmap-sriov-conf.yaml
index e3e9bbd..72b9bd6 100644
--- a/omec/omec-upf-cni/templates/configmap-sriov-conf.yaml
+++ b/omec/omec-upf-cni/templates/configmap-sriov-conf.yaml
@@ -18,15 +18,23 @@
         {
           "resourceName": "sriov_vfio_access_net",
           "selectors": {
+{{- if hasKey .Values.config.sriov.resourceList.vfio "accessPciAddresses" }}
+              "pciAddresses": {{ toJson .Values.config.sriov.resourceList.vfio.accessPciAddresses }}
+{{- else if hasKey .Values.config.sriov.resourceList.vfio "accessPfNames" }}
               "pfNames": {{ toJson .Values.config.sriov.resourceList.vfio.accessPfNames }},
               "drivers": ["vfio-pci"]
+{{- end }}
           }
         },
         {
           "resourceName": "sriov_vfio_core_net",
           "selectors": {
+{{- if hasKey .Values.config.sriov.resourceList.vfio "corePciAddresses" }}
+              "pciAddresses": {{ toJson .Values.config.sriov.resourceList.vfio.corePciAddresses }}
+{{- else if hasKey .Values.config.sriov.resourceList.vfio "corePfNames" }}
               "pfNames": {{ toJson .Values.config.sriov.resourceList.vfio.corePfNames }},
               "drivers": ["vfio-pci"]
+{{- end }}
           }
         }
 {{- if hasKey .Values.config.sriov.resourceList "netDevice" }}
diff --git a/omec/omec-upf-cni/values.yaml b/omec/omec-upf-cni/values.yaml
index 2008555..e67a53e 100644
--- a/omec/omec-upf-cni/values.yaml
+++ b/omec/omec-upf-cni/values.yaml
@@ -19,8 +19,8 @@
     # If your cluster has multiple nodes with different interface names,
     # simply provide the whole list
     resourceList:
-      # Provide PF name with VF range for S1U and SGI interfaces.
-      # Note that VF range of S1U must be smaller than SGI's.
+      # Provide PF name with VF range or PCI address for access and core interfaces.
+      # PCI address has higher precedence when both provided.
       vfio:
         accessPfNames:
           - eno1#0-3
@@ -29,10 +29,9 @@
       # Provide PF name with its VFs bounded to PF's driver
       # The driver name must be specified to prevent one interface is
       # registered to both vfio and netdevice resource pools
-      # NOTE: netDevice is required to use CDN service
-      netDevice:
-        pfNames:
-          - eno1
-        drivers:
-          - i40evf
-          - ixgbevf
+      #netDevice:
+      #  pfNames:
+      #    - eno1
+      #  drivers:
+      #    - i40evf
+      #    - ixgbevf
diff --git a/omec/omec-user-plane/Chart.yaml b/omec/omec-user-plane/Chart.yaml
index 9c33dc9..49e9ac4 100644
--- a/omec/omec-user-plane/Chart.yaml
+++ b/omec/omec-user-plane/Chart.yaml
@@ -7,4 +7,4 @@
 name: omec-user-plane
 icon: https://guide.opencord.org/logos/cord.svg
 
-version: 0.3.4
+version: 0.3.5
diff --git a/omec/omec-user-plane/templates/statefulset-upf.yaml b/omec/omec-user-plane/templates/statefulset-upf.yaml
index 59187be..9285cd7 100644
--- a/omec/omec-user-plane/templates/statefulset-upf.yaml
+++ b/omec/omec-user-plane/templates/statefulset-upf.yaml
@@ -76,6 +76,9 @@
         image: {{ .Values.images.tags.bess | quote }}
         imagePullPolicy: {{ .Values.images.pullPolicy | quote }}
         securityContext:
+        {{- if .Values.config.upf.privileged }}
+          privileged: true
+        {{- end }}
           capabilities:
             add:
             - IPC_LOCK
diff --git a/omec/omec-user-plane/values.yaml b/omec/omec-user-plane/values.yaml
index e53951e..d1bc16c 100644
--- a/omec/omec-user-plane/values.yaml
+++ b/omec/omec-user-plane/values.yaml
@@ -57,6 +57,8 @@
     enabled: false
     path: /tmp/coredump
   upf:
+    # Enable privileged when run from VM with sriov support
+    privileged: false
     hugepage:
       enabled: true
     sriov: