diff --git a/doc/source/user/vif-types.rst b/doc/source/user/vif-types.rst index 366076bf..43ca9587 100644 --- a/doc/source/user/vif-types.rst +++ b/doc/source/user/vif-types.rst @@ -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 ---------------------- diff --git a/os_vif/objects/vif.py b/os_vif/objects/vif.py index 1c2cee02..b0d9f803 100644 --- a/os_vif/objects/vif.py +++ b/os_vif/objects/vif.py @@ -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 diff --git a/os_vif/tests/unit/test_vif.py b/os_vif/tests/unit/test_vif.py index 590c721c..6f5e8c57 100644 --- a/os_vif/tests/unit/test_vif.py +++ b/os_vif/tests/unit/test_vif.py @@ -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', } diff --git a/releasenotes/notes/add-ovs-representor-portprofile-5f8290e5a40bf0a4.yaml b/releasenotes/notes/add-ovs-representor-portprofile-5f8290e5a40bf0a4.yaml new file mode 100644 index 00000000..4bb43319 --- /dev/null +++ b/releasenotes/notes/add-ovs-representor-portprofile-5f8290e5a40bf0a4.yaml @@ -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.