From c33f0588cb0fdb52cf279fea68f827ce993658b8 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Mon, 8 Mar 2021 16:29:36 +0000 Subject: [PATCH] [SR-IOV] Add support for ACCELERATOR_DIRECT VNIC type Add support in SR-IOV mechanism driver for VNIC type "accelerator-direct". This VNIC type refers to any device that supports hardware acceleration of any kind and is provided by Cyborg [1]. NOTE: "accelerator-direct-physical" is not supported yet. [1]https://wiki.openstack.org/wiki/Cyborg Change-Id: I529e6a2a445a140dca7686976efeefcd13d333f0 Closes-Bug: #1909100 --- .../drivers/mech_sriov/mech_driver/mech_driver.py | 9 ++++++--- .../mech_driver/test_mech_sriov_nic_switch.py | 12 ++++++++---- ...supports_accelerator_direct-e550369b6e4c18e1.yaml | 9 +++++++++ 3 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 releasenotes/notes/sriov_supports_accelerator_direct-e550369b6e4c18e1.yaml diff --git a/neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py b/neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py index 8afa3e377c9..09fe1782e44 100644 --- a/neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py +++ b/neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py @@ -58,9 +58,12 @@ class SriovNicSwitchMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase): vif_details={portbindings.CAP_PORT_FILTER: False, portbindings.VIF_DETAILS_CONNECTIVITY: portbindings.CONNECTIVITY_L2}, - supported_vnic_types=[portbindings.VNIC_DIRECT, - portbindings.VNIC_MACVTAP, - portbindings.VNIC_DIRECT_PHYSICAL]): + supported_vnic_types=[ + portbindings.VNIC_DIRECT, + portbindings.VNIC_MACVTAP, + portbindings.VNIC_DIRECT_PHYSICAL, + portbindings.VNIC_ACCELERATOR_DIRECT, + ]): """Initialize base class for SriovNicSwitch L2 agent type. :param agent_type: Constant identifying agent type in agents_db diff --git a/neutron/tests/unit/plugins/ml2/drivers/mech_sriov/mech_driver/test_mech_sriov_nic_switch.py b/neutron/tests/unit/plugins/ml2/drivers/mech_sriov/mech_driver/test_mech_sriov_nic_switch.py index 63f37587296..425011f388e 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/mech_sriov/mech_driver/test_mech_sriov_nic_switch.py +++ b/neutron/tests/unit/plugins/ml2/drivers/mech_sriov/mech_driver/test_mech_sriov_nic_switch.py @@ -231,9 +231,11 @@ class SriovSwitchMechVnicTypesTestCase(SriovNicSwitchMechanismBaseTestCase): mech_driver.SriovNicSwitchMechanismDriver( supported_vnic_types=self.override_vnic_types) self.default_supported_vnics = [ - portbindings.VNIC_DIRECT, - portbindings.VNIC_MACVTAP, - portbindings.VNIC_DIRECT_PHYSICAL] + portbindings.VNIC_DIRECT, + portbindings.VNIC_MACVTAP, + portbindings.VNIC_DIRECT_PHYSICAL, + portbindings.VNIC_ACCELERATOR_DIRECT, + ] self.prohibit_list_cfg = { 'SRIOV_DRIVER': { 'vnic_type_prohibit_list': [] @@ -284,7 +286,9 @@ class SriovSwitchMechVnicTypesTestCase(SriovNicSwitchMechanismBaseTestCase): self.prohibit_list_cfg['SRIOV_DRIVER']['vnic_type_prohibit_list'] = \ [portbindings.VNIC_DIRECT, portbindings.VNIC_MACVTAP, - portbindings.VNIC_DIRECT_PHYSICAL] + portbindings.VNIC_DIRECT_PHYSICAL, + portbindings.VNIC_ACCELERATOR_DIRECT, + ] fake_conf = cfg.CONF fake_conf_fixture = base.MechDriverConfFixture( diff --git a/releasenotes/notes/sriov_supports_accelerator_direct-e550369b6e4c18e1.yaml b/releasenotes/notes/sriov_supports_accelerator_direct-e550369b6e4c18e1.yaml new file mode 100644 index 00000000000..ed06422ae8f --- /dev/null +++ b/releasenotes/notes/sriov_supports_accelerator_direct-e550369b6e4c18e1.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + Added support in SR-IOV agent for ``accelerator-direct`` VNIC + type. This type represents a port that supports any kind of + hardware acceleration and is provided by Cyborg + (https://wiki.openstack.org/wiki/Cyborg). `RFE: 1909100 + `_. + ``accelerator-direct-physical`` is still not supported.