]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove deprecated sriov agent_required option
authorCedric Brandily <zzelle@gmail.com>
Tue, 20 Oct 2015 19:51:09 +0000 (21:51 +0200)
committerCedric Brandily <zzelle@gmail.com>
Wed, 21 Oct 2015 11:41:19 +0000 (13:41 +0200)
The SR-IOV option agent_required has been deprecated in Liberty.

This change removes it and from now agents are mandatory for SR-IOV
mechanism in order to support extended features: QoS, port security.

DocImpact
Closes-Bug: #1508182
Related-Bug: #1488807
Change-Id: I4e6497da6b287531a211084a5208028c84112a83

devstack/lib/ml2_drivers/sriovnicswitch
etc/neutron/plugins/ml2/ml2_conf_sriov.ini
neutron/cmd/sanity_check.py
neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py
neutron/tests/unit/plugins/ml2/drivers/mech_sriov/mech_driver/test_mech_sriov_nic_switch.py

index 43e9566a911b47819fca5ede88d8d17cc29448ca..3a12c067f909153f9996fbfe4d60c35c5f5cce73 100755 (executable)
@@ -1,3 +1,3 @@
 function configure_ml2_sriovnicswitch {
-    iniset /$Q_PLUGIN_CONF_FILE ml2_sriov agent_required True
-}
\ No newline at end of file
+    :
+}
index a39b61e6efadbcbcf8c9177019f3045f8e799717..a240059aca129ab22d357a316e13ee7640fd9d7f 100644 (file)
@@ -6,9 +6,3 @@
 #
 # supported_pci_vendor_devs = 15b3:1004, 8086:10ca
 # Example: supported_pci_vendor_devs = 15b3:1004
-#
-# (BoolOpt) Requires running SRIOV neutron agent for port binding
-# agent_required = True
-# DEPRECATED: This option is deprecated in the Liberty release
-# and will be removed in the Mitaka release. From Mitaka the agent will
-# always be required.
index 9eca181fa702d9d384430e95cd1f0716e90e65ef..c063481f73cec7ac522037bbf9d456de179250d1 100644 (file)
@@ -241,6 +241,7 @@ def enable_tests_from_config():
     run all necessary tests, just by passing in the appropriate configs.
     """
 
+    cfg.CONF.set_override('vf_management', True)
     if 'vxlan' in cfg.CONF.AGENT.tunnel_types:
         cfg.CONF.set_override('ovs_vxlan', True)
     if 'geneve' in cfg.CONF.AGENT.tunnel_types:
@@ -260,8 +261,6 @@ def enable_tests_from_config():
     if cfg.CONF.AGENT.prevent_arp_spoofing:
         cfg.CONF.set_override('arp_header_match', True)
         cfg.CONF.set_override('icmpv6_header_match', True)
-    if cfg.CONF.ml2_sriov.agent_required:
-        cfg.CONF.set_override('vf_management', True)
     if not cfg.CONF.AGENT.use_helper_for_ns_read:
         cfg.CONF.set_override('read_netns', True)
     if cfg.CONF.dhcp_driver == 'neutron.agent.linux.dhcp.Dnsmasq':
index 2aca1019865a202b54e41665bdb422b9fd61af53..f904cc655f02b0ef551a16ce5394c2e0651535ea 100644 (file)
@@ -38,13 +38,6 @@ sriov_opts = [
                       "vendor_id:product_id according to the PCI ID "
                       "Repository. Default enables support for Intel "
                       "and Mellanox SR-IOV capable NICs")),
-    cfg.BoolOpt('agent_required',
-                default=True,
-                help=_("SRIOV neutron agent is required for port binding. "
-                       'DEPRECATED: This option is deprecated in the Liberty '
-                       'release and will be removed in the Mitaka release. '
-                       'From Mitaka the agent will always be required.'),
-                deprecated_for_removal=True),
 ]
 
 cfg.CONF.register_opts(sriov_opts, "ml2_sriov")
@@ -61,9 +54,6 @@ class SriovNicSwitchMechanismDriver(api.MechanismDriver):
     L2 agent is not essential for port binding; port binding is handled by
     VIF Driver via libvirt domain XML.
     L2 Agent presents in  order to manage port update events.
-    If vendor NIC does not support updates, setting agent_required = False
-    will allow to use Mechanism Driver without L2 agent.
-
     """
 
     supported_qos_rule_types = [qos_consts.RULE_TYPE_BANDWIDTH_LIMIT]
@@ -93,7 +83,6 @@ class SriovNicSwitchMechanismDriver(api.MechanismDriver):
         try:
             self.pci_vendor_info = cfg.CONF.ml2_sriov.supported_pci_vendor_devs
             self._check_pci_vendor_config(self.pci_vendor_info)
-            self.agent_required = cfg.CONF.ml2_sriov.agent_required
         except ValueError:
             LOG.exception(_LE("Failed to parse supported PCI vendor devices"))
             raise cfg.Error(_("Parsing supported pci_vendor_devs failed"))
@@ -114,27 +103,22 @@ class SriovNicSwitchMechanismDriver(api.MechanismDriver):
             LOG.debug("Refusing to bind due to unsupported pci_vendor device")
             return
 
-        if self.agent_required:
-            for agent in context.host_agents(self.agent_type):
-                LOG.debug("Checking agent: %s", agent)
-                if agent['alive']:
-                    if self.try_to_bind(context, agent):
-                        return
-                else:
-                    LOG.warning(_LW("Attempting to bind with dead agent: %s"),
-                                agent)
-        else:
-            self.try_to_bind(context)
+        for agent in context.host_agents(self.agent_type):
+            LOG.debug("Checking agent: %s", agent)
+            if agent['alive']:
+                if self.try_to_bind(context, agent):
+                    return
+            else:
+                LOG.warning(_LW("Attempting to bind with dead agent: %s"),
+                            agent)
 
-    def try_to_bind(self, context, agent=None):
+    def try_to_bind(self, context, agent):
         for segment in context.segments_to_bind:
             if self.check_segment(segment, agent):
-                port_status = (constants.PORT_STATUS_ACTIVE if agent is None
-                    else constants.PORT_STATUS_DOWN)
                 context.set_binding(segment[api.ID],
                                     self.vif_type,
                                     self._get_vif_details(segment),
-                                    port_status)
+                                    constants.PORT_STATUS_DOWN)
                 LOG.debug("Bound using segment: %s", segment)
                 return True
         return False
index 15033b56e904e594b8ca48dbd13bc59a3af21cab..4f5b7d9e03613a6d8f2e00b0e59066f4deadf326 100644 (file)
@@ -80,7 +80,6 @@ class SriovNicSwitchMechanismBaseTestCase(base.AgentMechanismBaseTestCase):
         cfg.CONF.set_override('supported_pci_vendor_devs',
                               DEFAULT_PCI_INFO,
                               'ml2_sriov')
-        cfg.CONF.set_override('agent_required', True, 'ml2_sriov')
         super(SriovNicSwitchMechanismBaseTestCase, self).setUp()
         self.driver = mech_driver.SriovNicSwitchMechanismDriver()
         self.driver.initialize()
@@ -225,18 +224,6 @@ class SriovSwitchMechVifDetailsTestCase(SriovNicSwitchMechanismBaseTestCase):
         with testtools.ExpectedException(exc.SriovUnsupportedNetworkType):
             self.driver._get_vif_details(segment)
 
-    def test_get_vif_details_without_agent(self):
-        cfg.CONF.set_override('agent_required', False, 'ml2_sriov')
-        self.driver = mech_driver.SriovNicSwitchMechanismDriver()
-        self.driver.initialize()
-        context = TestFakePortContext(self.AGENT_TYPE,
-                                      self.AGENTS,
-                                      self.VLAN_SEGMENTS,
-                                      portbindings.VNIC_DIRECT)
-
-        self.driver.bind_port(context)
-        self.assertEqual(constants.PORT_STATUS_ACTIVE, context._bound_state)
-
     def test_get_vif_details_with_agent(self):
         context = TestFakePortContext(self.AGENT_TYPE,
                                       self.AGENTS,