add nested DPDK VIF classes for kuryr-kubernetes

This change adds new nested DPDK VIF type and port profile for use with nested
DPDK driver in kuryr-kubernetes.

Co-Authored-By: Gary Loughnane <gary.loughnane@intel.com>
Co-Authored-By: Kural Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>
Co-Authored-By: Marco Chiappero <marco.chiappero@intel.com>

Change-Id: Ib38c427b84606fd232c2ce35cab520790d6ad8ae
Signed-off-by: Przemyslaw Lal <przemyslawx.lal@intel.com>
This commit is contained in:
Przemyslaw Lal 2018-09-25 09:45:14 +02:00
parent 3eded6ba37
commit d42b7bbbba
4 changed files with 63 additions and 0 deletions

View File

@ -75,6 +75,16 @@ VIFHostDevice
This class provides a way to pass a physical device to the guest. Either an
entire physical device, or an SR-IOV PCI device virtual function, are permitted.
.. _vif-nesteddpdk:
VIFNestedDPDK
-------------
This class provides a configuration, where kuryr-kuberentes is used to provide
accelerated DPDK datapath for nested Kubernetes pods running inside the VM.
Port is first attached to the virtual machine, bound to the userspace driver
(e.g. uio_pci_generic, igb_uio or vfio-pci) and then consumed by Kubernetes
pod via kuryr-kubernetes CNI plugin.
VIF port profile objects
========================
@ -129,6 +139,11 @@ VIFPortProfileFPTap
This profile provides the metadata required to associate a fast path vhost-user
VIF with a Calico port.
VIFPortProfileK8sDPDK
---------------------
This profile provides the metadata required to associate nested DPDK VIF with
a Kubernetes pod.
VIF network objects
===================

View File

@ -161,6 +161,22 @@ class VIFHostDevice(VIFBase):
}
@base.VersionedObjectRegistry.register
class VIFNestedDPDK(VIFBase):
# For kuryr-kubernetes nested DPDK interfaces
VERSION = '1.0'
fields = {
# PCI address of the device.
'pci_address': fields.StringField(),
# Name of the driver the device was previously bound to; it makes
# the controller driver agnostic (virtio, sr-iov, etc.)
'dev_driver': fields.StringField(),
}
@base.VersionedObjectRegistry.register
class VIFPortProfileBase(osv_base.VersionedObject,
base.ComparableVersionedObject):
@ -282,3 +298,22 @@ class VIFPortProfile8021Qbh(VIFPortProfileBase):
fields = {
'profile_id': fields.StringField()
}
@base.VersionedObjectRegistry.register
class VIFPortProfileK8sDPDK(VIFPortProfileBase):
# Port profile info for Kuryr-Kubernetes DPDK ports
VERSION = '1.0'
fields = {
# Specify whether this vif requires L3 setup.
'l3_setup': fields.BooleanField(),
# String containing URL representing object in Kubernetes API.
'selflink': fields.StringField(),
# String used in Kubernetes v1 API to identifies
# the server's internal version of this object.
'resourceversion': fields.StringField()
}

View File

@ -46,6 +46,8 @@ object_data = {
'VIFPortProfileFPTap': '1.0-11670d8dbabd772ff0da26961adadc5a',
'VIFVHostUser': '1.1-1f95b43be1f884f090ca1f4d79adfd35',
'VIFPortProfileOVSRepresentor': '1.1-30e555981003a109b133da5b43ded5df',
'VIFNestedDPDK': '1.0-fdbaf6b20afd116529929b21aa7158dc',
'VIFPortProfileK8sDPDK': '1.0-f1e0daa66b041ded4e6dbc053b4a66d5',
}

View File

@ -193,3 +193,14 @@ class TestVIFS(base.TestCase):
self._test_vif(objects.vif.VIFHostDevice,
dev_address="0002:24:12.3",
port_profile=prof)
def test_vif_nested_dpdk_k8s(self):
prof = objects.vif.VIFPortProfileK8sDPDK(
l3_setup=False,
selflink="/some/url",
resourceversion="1")
self._test_vif(
objects.vif.VIFNestedDPDK,
pci_adress="0002:24:12.3",
dev_driver="virtio_pci",
port_profile=prof)