Remove deprecated sriov agent_required option

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
This commit is contained in:
Cedric Brandily 2015-10-20 21:51:09 +02:00
parent 3854fd9af3
commit 83c9578fcc
5 changed files with 13 additions and 49 deletions

View File

@ -1,3 +1,3 @@
function configure_ml2_sriovnicswitch {
iniset /$Q_PLUGIN_CONF_FILE ml2_sriov agent_required True
}
:
}

View 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.

View 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':

View 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

View 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,