Commit Graph

2373 Commits (b79842f289f0c9b9fdce9d6cc689538ec61216e7)

Author SHA1 Message Date
Brian Haley b79842f289 Start enforcing E125 flake8 directive
Removed E125 (continuation line does not distinguish itself
from next logical line) from the ignore list and fixed all
the indentation issues.  Didn't think it was going to be
close to 100 files when I started.

Change-Id: I0a6f5efec4b7d8d3632dd9dbb43e0ab58af9dff3
4 years ago
Zuul 597b8f62a1 Merge "ovs-agent: Trace remote methods only" 4 years ago
Zuul ccd627c3b3 Merge "Remove the l2pop agent_boot_time config" 4 years ago
Bence Romsics 0299746c72 ovs-agent: Trace remote methods only
Enabling osprofiler tracing on class OVSNeutronAgent decorates all of
its methods. Doing this as label "rpc" for locally called methods is
quite misleading.

More importantly later we want to enable tracing triggered by a vif
plug. For that profiler.init() must be called sometime in
OVSNeutronAgent.process_ports_events(). If process_ports_events() is
decorated for tracing and we call profiler.init() inside then we'll have
the end of the method call traced, but not its beginning. The unmatching
end-trace-event makes osprofiler raise.

Change-Id: I06b8643c75a30b5a5f6f78d75af9937180da645b
Partial-Bug: #1833674
4 years ago
LIU Yulong 76c0280635 Remove the l2pop agent_boot_time config
It was marked as deprecated, so let's do a quick
removal.

Related-Bug: #1813714
Change-Id: Ibc039b34b826641811a7e08b0d1bff0fd21b9193
4 years ago
Zuul 06754907e2 Merge "Ignore first local port update notification" 4 years ago
Zuul 8c08045c69 Merge "Fix update of network's segmentation id for network with ports" 4 years ago
Zuul c53dee3e8b Merge "Add "connectivity" parameter in vif_details" 4 years ago
Slawek Kaplonski 3367e2081b Fix update of network's segmentation id for network with ports
Filter neutron_lib.objects.utils.NotIn, designed to work with OVO objects
was used in db query and because of that ports belong to network wasn't
filtered by vif_type thus if there were any ports in network, it was not
possible to change its segmentation id.

Change-Id: I6ad2047c310e111bffe0942af12af1f642963b18
Closes-Bug: #1832985
4 years ago
Nate Johnston d0c172afa6 Fix bulk port binding
Bulk ports were not binding correctly when they were created.  This is
due to a few inconsistencies between the create_port code and the
create_port_bulk code, mostly a result of the use of the Port object in
the bulk code.

Change-Id: I3bcd3cec12b1b6f6a568cda4bfeb569f636efb98
Closes-Bug: #1835209
4 years ago
Rodolfo Alonso Hernandez a70f07deb1 Add "connectivity" parameter in vif_details
Added "connectivity" parameter to mech driver vif_details. The default
value is "legacy". The in-tree drivers (Linux Bridge, Open vSwitch, SR-IOV
and MacVTap) have "l2" connectivity.

Change-Id: I45480986fc89e0b2f475ee0ceb13d8742fb8c530
Related-Bug: #1821058
4 years ago
LIU Yulong eaf3ff5786 Ignore first local port update notification
Ovs-agent will scan and process the ports during the
first rpc_loop, and a local port update notification
will be sent out. This will cause these ports to
be processed again in the ovs-agent next (second)
rpc_loop.
This patch passes the restart flag (iteration num 0)
to the local port_update call trace. After this patch,
the local port_update notification will be ignored in
the first RPC loop.

Related-Bug: #1813703
Change-Id: Ic5bf718cfd056f805741892a91a8d45f7a6e0db3
4 years ago
Ryan Tidwell 7eb74d2c4a Implement subnetpool prefix operations
This changes provides the implementation of the subnetpool prefix
operations extension. This exposes explicit API's for adding to and
removing from the prefix list of a subnetpool. Prefixes added to a
subnetpool are subject to the prefix uniqueness constraints imposed
by address scopes. Prefixes to be removed from a subnetpool must not
be allocated to an existing subnet, and the subnet using the prefix
must be deleted before the prefix can be removed from the subnetpool.

Change-Id: I76783a4edaf46e184b4dea1d572b89e594bad0ac
Related-Bug: #1792901
4 years ago
Zuul d35dd9c9c8 Merge "Fix update of network's segmentation id" 4 years ago
Rodolfo Alonso Hernandez dc80fc9fe7 [OVS] Network segmentation ID change not allowed if multisegments
If a network has several segments, the provider network segmentation ID
cannot be changed. This is defined in the feature spec [1].

In the case of having a multisegment network, the OVS agent RPC call
"get_network_details" will return the following value:

  {
    "network": {
      "updated_at": "2019-02-19T13:25:15Z",
      "revision_number": 5,
      "id": "ba973781-065b-4c69-9f07-a5c4f9a3b754",
      ...
      "segments": [{
        "provider:network_type": "vxlan",
        "provider:physical_network": null,
        "provider:segmentation_id": 10041
      },
      {
        "provider:network_type": "vxlan",
        "provider:physical_network": null,
        "provider:segmentation_id": 10066
      }],
      ...
}

The provider network information will be contained inside the "segments"
list, instead of being container in the parent "network" dictionary.

Closes-Bug: #1832745

[1]https://opendev.org/openstack/neutron-specs/src/branch/master/specs/stein/change-segmentation-id-vlan-provider-network.rst

Change-Id: I4fa37519bbf91e93ebd2f0e46e4d14edd40728fd
4 years ago
LIU Yulong 3027b66c38 Fix mis-use of _dvr_to_src_mac_table_id
A simple dvr router admin-state down action can cause the
exception "TypeError: 'int' object is not iterable" in snat
node ovs-agent. This patch addresses that.

Closes-Bug: #1832743
Change-Id: If31de3cc831b0ee3caed9924e50d86270aeb9d7f
4 years ago
Slawek Kaplonski 352f5ac674 Fix update of network's segmentation id
In patch [1] there was added usage of context parameter in method
get_vif_type in openvswitch mech_driver.
This exposed that previously "wrong" context was passed to this method
in _update_segmentation_id() method in ml2 plugin and that caused
raising AttributeError as "Context" object didn't have attribute
'current'.

This patch adds new method "get_supported_vif_type" to mechanism
drivers and this method don't need context to return what vif_types
are supported regarding agent type.

[1] https://review.opendev.org/#/c/658784/

Change-Id: Ic6c738db28208e5009f78bb52598eb3c141f639f
Related-Bug: #1832985
4 years ago
Zuul 8b0f4495f9 Merge "DVR: Modify DVR flows to allow ARP requests to hit ARP Responder table" 4 years ago
Zuul 0f712e6713 Merge "SRIOV agent: wait VFs initialization on embedded switch create" 4 years ago
Zuul 1654bc1179 Merge "Reset MAC on unbinding direct-physical port" 4 years ago
Oleg Bondarev e603d19939 Reset MAC on unbinding direct-physical port
direct-physical ports inherit MAC address of physical device
when binding happens (VM created). When VM is deleted this
MAC has to be cleared so other ports may be bound to same device
without conflicts.

Change-Id: I9dc8562546e9a7365d18492678f7fc1cb3553622
Closes-Bug: #1830383
4 years ago
Oleg Bondarev c148c6df46 SRIOV agent: wait VFs initialization on embedded switch create
Check for configured and actual number of VFs to prevent
device registaration with 0 VFs.

Closes-Bug: #1831622
Change-Id: Ie699d245f8ae2fc1d16b96432d2962788d9dba57
4 years ago
Slawek Kaplonski ae3aa28f5a [DVR] Block ARP to dvr router's port instead of subnet's gateway
It may happen that subnet is connected to dvr router using IP address
different than subnet's gateway_ip.
So in br-tun arp to dvr router's port should be dropped instead of
dropping arp to subnet's gateway_ip (or mac in case of IPv6).

Change-Id: Ida6b7ae53f3fc76f54e389c5f7131b5a66f533ce
Closes-bug: #1831575
4 years ago
Zuul 3e6376f428 Merge "Add Smart NIC representor port to integration bridge" 4 years ago
Swaminathan Vasudevan 52b537ca22 DVR: Modify DVR flows to allow ARP requests to hit ARP Responder table
DVR does the ARP table update through the control plane, and does not
allow any ARP requests to get out of the node.

In order to address the allowed address pair VRRP IP issue with DVR,
we need to add an ARP entry into the ARP Responder table for the
allowed address pair IP ( which is taken care by the patch in [1])

This patch adds a rule in the br-int to redirect the packet
destinated to the router to the actual router-port and also moves
the arp filtering rule to the tunnel or the physical port based on the
configuration.

By adding the above rule it allows the ARP requests to reach the
ARP Responder table and filters the ARP requests before it reaches
the physical network or the tunnel.

[1] https://review.opendev.org/#/c/601336/
Related-Bug: #1774459

Change-Id: I3905ea56ca0ff35bdd96c818719e6d63a3eb5a72
4 years ago
Zuul e79d71677f Merge "OVS DPDK port representors support" 4 years ago
Zuul 39dcab011a Merge "Modify comments on some methods" 4 years ago
Hamdy Khader 47390226f5 OVS DPDK port representors support
Adds support for OVS DPDK port representors[1], a direct port on
a netdev datapath is considered a DPDK representor port.

get_vif_type returns OVS VIF type in case of a direct port.

[1] http://docs.openvswitch.org/en/latest/topics/dpdk/phy/#representors

Closes-Bug: #1829734
Change-Id: I3956eeda19ebc93fdb0b13c1cfb3dc64abffee9f
4 years ago
Ihar Hrachyshka 4aeec20001 Drop of_interface option
Default value for "of_interface" config option was switched
to "native" in Pike release.
In the same release this option was deprecated to removal.
Now it's time to remove it and force use of "native" driver to
manage openflows.

Change-Id: Ic900209868acfbe3bbb56fabbbf5c4472857e412
Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Co-Authored-By: Slawek Kaplonski <skaplons@redhat.com>
4 years ago
lidong 54329b8dcb Modify comments on some methods
Modify comments on some methods in  file:
...\neutron\neutron\plugins\ml2\managers.py

Change-Id: I48d618e35282eb1d1034856cb104ac16b8c29a20
4 years ago
Hamdy Khader b4243ad3f7 Add Smart NIC representor port to integration bridge
In case of Smart NIC vNIC type neutron should mimic nova-compute
that plug the port to the ovs bridge.

Extend the Neutron OVS mechanism driver and Neutron OVS Agent to bind
the Neutron port for the baremetal host with Smart NIC. This will allow
the Neutron OVS Agent to configure the pipeline of the OVS running on
the Smart NIC and leverage the pipeline features such as: VXLAN,
Security Groups and ARP Responder.

Story: #2003346
Closes-Bug: #1785608
Change-Id: I6d520d3bac2e9ceb30b5b6197c6eb0f958cc3659
4 years ago
Zuul 8887343782 Merge "Change provider network segmentation ID in OVS agent" 4 years ago
Zuul 3e1cd9abef Merge "ML2 plugin: extract and postpone limit in port query" 4 years ago
Rodolfo Alonso Hernandez 2bcc178be1 Change provider network segmentation ID in OVS agent
Added the ability to change the segmentation ID of a network
with ports bound to OVS agent. The rules, both in the integration
bridge and the physical bridge, to convert the internal VLAN tag
and the external segmentation ID (external VLAN tag) are deleted
and created again with the new value. The traffic from the tenant
networks will be tagged then with the new segmentation ID.

Added get network details agent RPC call to retrieve the information
of the updated network.

Partial-Bug: #1806052

Change-Id: I69f6f3ef717c3ed40218099b1f389afd3d39bd62
4 years ago
Darragh O'Reilly 540d00f68e Make OVS controller inactivity_probe configurable
This parameter applies to the OVSDB Controller table when the
native openflow driver is used. There are reports that increasing
it can reduce errors on busy systems. This patch also sets the
default value to 10s which is more than the OVS default of 5s.
See the ovs-vswitchd.conf.db man page for full description.

Change-Id: If0d42919412dac75deb4d7f484c42cea630fbc59
Partial-Bug: #1817022
4 years ago
Gabriele Cerami 94bc403078 ML2 plugin: extract and postpone limit in port query
as with https://review.opendev.org/#/c/656066/ if limit is applied in
any place other than at the end of the filters, sql alchemy will return
an error, and possibily we could return less result than intended.

Change-Id: I9a54ae99d2d5dfda63cb0061bcf3d727ed7cc992
Closes-Bug: #1827363
4 years ago
Zuul ab8de4fee6 Merge "[Trivial fix]Remove unnecessary slash" 4 years ago
zhufl 18dd598696 [Trivial fix]Remove unnecessary slash
This is to remove the unncessary slash when the line doesn't
exceed the length of 79, to make the code more readable.

Change-Id: I5e7c8d5fc6d4b3917b6e8e196f9cbcacb8807e6c
4 years ago
Kailun Qin 0dc730c7c0 Populate binding levels when concurrent ops fail
Concurrent calls to _bind_port_if_needed may lead to a missing RPC
notification which can cause a port stuck in a DOWN state. If the only
caller that succeeds in the concurrency does not specify that an RPC
notification is allowed then no RPC would be sent to the agent. The
other caller which needs to send an RPC notification will fail since the
resulting PortContext instance will not have any binding levels set.

The failure has negative effects on consumers of the L2Population
functionality because the L2Population mechanism driver will not be
triggered to publish that a port is UP on a given compute node. Manual
intervention is required in this case.

This patch proposes to handle this by populating the PortContext with
the current binding levels so that the caller can continue on and have
an RPC notification sent out.

Closes-Bug: #1755810
Story: 2003922
Change-Id: Ie2b813b2bdf181fb3c24743dbd13487ace6ee76a
4 years ago
Zuul 6f4962dcf8 Merge "Move subnet postcommit out of transaction for bulk create" 4 years ago
Zuul 07969cfe15 Merge "Don't add arp responder for non tunnel network port" 4 years ago
Zuul bd250f9dcf Merge "Rehome provider_network_attribute_updates_supported to API definition" 4 years ago
Zuul fb518b1cb9 Merge "Replace git.openstack.org URLs with opendev.org URLs" 4 years ago
Yang Li 5301ecf41b Don't add arp responder for non tunnel network port
When the vlan and vxlan both exist in env, and l2population
and arp_responder are enabled, if we update a port's ip address
from vlan network, there will be arp responder related flows
added into br-tun, this will cause too many arp reply for
one arp request, and vm connections will be unnormal.

Closes-Bug: #1824504
Change-Id: I1b6154b9433a9442d3e0118dedfa01c4a9b4740b
4 years ago
Zuul 0018e1b08e Merge "Check in "_update_segmentation_id" that the mech_driver has an agent" 4 years ago
Rodolfo Alonso Hernandez cfaf5cc1e1 Rehome provider_network_attribute_updates_supported to API definition
Rehomed provider_network_attribute_updates_supported to
plugins.ml2.api.MechanismDriver, in order to be inherited in other
mechanism drivers.

Related-Bug: #1823865

Change-Id: I9be175aa2334111a17d8fec874d2331e23923837
4 years ago
Rodolfo Alonso Hernandez 749b33e41b Check in "_update_segmentation_id" that the mech_driver has an agent
In [1] it is assumed that all mechanism drivers have an agent, but the
mech driver API [2] doesn't enforce it. VIF types will be retrieved
only from those mechanism drivers with an associated agent.

[1]https://review.openstack.org/#/c/633165/20/neutron/plugins/ml2/plugin.py@814
[2]https://github.com/openstack/neutron-lib/blob/stable/stein/neutron_lib/plugins/ml2/api.py#L37

Change-Id: I5c334f31259871ed5251d5d4a2ba8cae36bd2355
Closes-Bug: #1824346
4 years ago
Oleg Bondarev 14c76d3181 Move subnet postcommit out of transaction for bulk create
For auto-address IPv6 subnets postcommit has update port action
if the net already has ports. This results in
"cannot be called within a transaction" error for bulk IPv6 subnet
create.

Closes-Bug: #1822582
Change-Id: Ia32ec4c11c0793e7df07dcce19c122b3c7f865e1
4 years ago
ZhongShengping 161e6b80f0 Replace git.openstack.org URLs with opendev.org URLs
Thorough replacement of git.openstack.org URLs with their opendev.org
counterparts.

Change-Id: Ifc446e00d7f69cb23411b3a50c8d880c719f1e73
4 years ago
Boden R 957eca96f4 delete common_db_mixin
The functionality within neutron.db.common_db_mixin is available via
neutron-lib APIs. This patch removes common_db_mixin and updates any
uses of it to use neutron-lib instead.

Depends-On: https://review.openstack.org/#/c/636159/

NeutronLibImpact

Change-Id: I2388f90b37abb09408809dda8c21da551bcd94bb
4 years ago