Add support for VIFPortProfileOVSRepresentor

* This patch adds support for a VF representor port profile,
  specifically supporting OVS. If representor_name is set, the os-vif
  plugin is requested to rename the representor to that.

* Some VIF types already have a VF associated with them. In that case,
  the PCI dev_address should copied to the VIF port profile subclassed
  object's representor_address for use by os-vif plug/unplug. The
  hypervisor will still use the VIF's dev_address for instance spawning.

Change-Id: Id95a9f311e71b3cefb170704728641a4a1a91144
Signed-off-by: Jan Gutter <jan.gutter@netronome.com>
This commit is contained in:
Jan Gutter 2017-07-14 14:47:00 +02:00
parent 4a8e07f6c5
commit 777ea9494e
4 changed files with 42 additions and 0 deletions

View File

@ -109,6 +109,14 @@ VIFPortProfileFPOpenVSwitch
This profile provides the metadata required to associate a fast path :term:`vhost-user`
VIF with an :term:`Open vSwitch` port.
VIFPortProfileOVSRepresentor
----------------------------
This profile provides the metadata required to associate a VIF with a
:term:`VF` representor and :term:`Open vSwitch` port. If `representor_name` is
specified, it indicates a desire to rename the representor to the given name
on plugging.
VIFPortProfileFPBridge
----------------------

View File

@ -195,6 +195,21 @@ class VIFPortProfileFPOpenVSwitch(VIFPortProfileOpenVSwitch):
}
@base.VersionedObjectRegistry.register
class VIFPortProfileOVSRepresentor(VIFPortProfileOpenVSwitch):
# Port profile info for OpenVSwitch networks using a representor
VERSION = '1.0'
fields = {
# Name to set on the representor (if set)
'representor_name': fields.StringField(nullable=True),
# The PCI address of the Virtual Function
'representor_address': fields.PCIAddressField(nullable=True),
}
@base.VersionedObjectRegistry.register
class VIFPortProfileFPBridge(VIFPortProfileBase):
# Port profile info for LinuxBridge networks using fastpath

View File

@ -106,6 +106,18 @@ class TestVIFS(base.TestCase):
vif_name="tap123",
port_profile=prof)
def test_vif_vhost_user_ovs_representor(self):
prof = objects.vif.VIFPortProfileOVSRepresentor(
interface_id="07bd6cea-fb37-4594-b769-90fc51854ee8",
profile_id="fishfood",
representor_name="tap123",
representor_address="0002:24:12.3")
self._test_vif(objects.vif.VIFVHostUser,
path="/some/socket.path",
mode=objects.fields.VIFVHostUserMode.CLIENT,
vif_name="tap123",
port_profile=prof)
def test_vif_vhost_user_fp_lb(self):
prof = objects.vif.VIFPortProfileFPBridge(bridge_name="brq456")
self._test_vif(objects.vif.VIFVHostUser,
@ -161,6 +173,7 @@ object_data = {
'VIFPortProfileFPBridge': '1.0-d50872b3cddd245ffebef6053dfbe27a',
'VIFPortProfileFPTap': '1.0-11670d8dbabd772ff0da26961adadc5a',
'VIFVHostUser': '1.1-1f95b43be1f884f090ca1f4d79adfd35',
'VIFPortProfileOVSRepresentor': '1.0-d1b67d954bcab8378c8064771d62ecd5',
}

View File

@ -0,0 +1,6 @@
---
features:
- A new port profile has been added to describe VF representors on OVS-based
switches, as featured in Linux kernel 4.8 and later. This port profile can
currently be used with Agilio OVS networks. It is intended to be flexible
enough to be used by multiple vendors.