]> git.proxmox.com Git - ovs.git/log
ovs.git
6 years agoSystem-tests: Improve reliability of an icmp test.
Darrell Ball [Thu, 20 Jul 2017 20:02:43 +0000 (13:02 -0700)]
System-tests: Improve reliability of an icmp test.

One SNAT test is based on a single ping being successful;
to make the result more predictable, static arp binding is now used.
To put less stress on the stack a single arp binding is used for
the reverse direction mapping.  This does not change the goal of the
test, but significantly increases the reliability; I ran the test
100 times without failure.

Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agoSystem-tests: Allow SNAT address variability retries.
Darrell Ball [Thu, 20 Jul 2017 20:02:42 +0000 (13:02 -0700)]
System-tests: Allow SNAT address variability retries.

Three of the SNAT tests allow for wget retries, which occasionally
happen.  However, these tests did not allow for SNAT address
variability for the retries, which is now tolerated.

Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agoAUTHORS.rst: Update name and e-mail.
Tonghao Zhang [Wed, 19 Jul 2017 03:44:16 +0000 (20:44 -0700)]
AUTHORS.rst: Update name and e-mail.

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agodocs: Note currently used L3 gateway HA approach.
Russell Bryant [Sun, 16 Jul 2017 19:39:56 +0000 (15:39 -0400)]
docs: Note currently used L3 gateway HA approach.

The OVN gateway HA design document is very useful in its current form.
It describes a range of options OVN could take to provide gateway HA.
Leave all the useful discussion in place and add a note to indicate
how the current implementation lines up with the options described.

I plan to follow up with an additional patch to describe the current L3
gateway HA implementation in the ovn-architecture document.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Miguel Angel Ajo <majopela@redhat.com>
6 years agodatapath: Fix kernel panic for ovs reassemble.
wangzhike [Thu, 6 Jul 2017 20:57:34 +0000 (13:57 -0700)]
datapath: Fix kernel panic for ovs reassemble.

Ovs and kernel stack would add frag_queue to same netns_frags list.
As result, ovs and kernel may access the fraq_queue without correct
lock. Also the struct ipq may be different on kernel(older than 4.3),
which leads to invalid pointer access.

The fix creates specific netns_frags for ovs.

Signed-off-by: wangzhike <wangzhike@jd.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agorhel/systemd: Set ovs-vswitchd timeout to 5 minutes
aaron conole [Thu, 13 Jul 2017 14:51:34 +0000 (10:51 -0400)]
rhel/systemd: Set ovs-vswitchd timeout to 5 minutes

During initialization, it's possible that the startup time takes longer
than the systemd default provided.  Set this to be 5 minutes.  If we
take longer than 5 minutes, maybe something is wrong.

As an example of long initialization, enable DPDK, and allocate large
numbers of hugepages before starting ovs-vswitchd.  The vswitchd can
take two or more minutes to start.  During that time, systemd will decide
that the startup time took too long, and kill the parent process, leading
eventually to an error like:
   ovs|00011|daemon_unix|EMER|pipe write failed (Broken pipe)

And a systemd log like:
   ovs-vswitchd.service start operation timed out. Terminating.

The 5 minutes setting has been observed to work on a system where 400G
of hugepages were allocated.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Markos Chandras <mchandras@suse.de>
Acked-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agorhel: Fix creation of symlink for ocf script
Timothy Redaelli [Wed, 19 Jul 2017 12:56:28 +0000 (14:56 +0200)]
rhel: Fix creation of symlink for ocf script

The policy is to use %files to track installed files.

If %files is not used the resulting file is not owned by any package.

Before this commit:
 # rpm -qf /usr/lib/ocf/resource.d/ovn/ovndb-servers
 file /usr/lib/ocf/resource.d/ovn/ovndb-servers is not owned by any package

After this commit:
 # rpm -qf /usr/lib/ocf/resource.d/ovn/ovndb-servers
 openvswitch-ovn-common-2.7.90-1.fc26.x86_64

Fixes: a4245b7869c8 ("ovn: Add ovn db servers ocf script in fedora packager")
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agoovn-architecture: Add notes on L3 gateway HA.
Russell Bryant [Sun, 16 Jul 2017 20:07:12 +0000 (16:07 -0400)]
ovn-architecture: Add notes on L3 gateway HA.

Add some comments to the ovn-architecture document that distributed
gateway ports can also be made highly available.  Provide a brief
overview of the approach and point to the gateway HA design document
for a more detailed discussion of the approach taken.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Miguel Angel Ajo <majopela@redhat.com>
6 years agoNEWS: Add OVN L3 Gateway HA.
Russell Bryant [Sun, 16 Jul 2017 18:59:04 +0000 (14:59 -0400)]
NEWS: Add OVN L3 Gateway HA.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Miguel Angel Ajo <majopela@redhat.com>
6 years agoodp-execute: Reuse rss hash in OVS_ACTION_ATTR_HASH.
Ilya Maximets [Thu, 13 Jul 2017 15:07:03 +0000 (18:07 +0300)]
odp-execute: Reuse rss hash in OVS_ACTION_ATTR_HASH.

If RSS hash exists in a packet it can be reused instead of
5 tuple hash re-calculation in OVS_ACTION_ATTR_HASH. This
leads to increasing the performance of sending packets to
the OVS bonding in userspace datapath up to 10-15%.

Additionally fixed unit test 'select group with dp_hash
selection method' to not depend on dp_hash value.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
6 years agodpif-netdev: Indicate support for various ct features.
Justin Pettit [Wed, 19 Jul 2017 05:55:35 +0000 (22:55 -0700)]
dpif-netdev: Indicate support for various ct features.

The userspace datapath uses a structure to indicate supported features
that affects debug output.  This commit updates that structure to
indicate that "ct_state_nat", "ct_orig_tuple", and "ct_orig_tuple6" are
supported.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Darrell Ball <dlu998@gmail.com>
6 years agotunneling: Avoid datapath-recirc by combining recirc actions at xlate.
Sugesh Chandran [Wed, 19 Jul 2017 13:46:03 +0000 (14:46 +0100)]
tunneling: Avoid datapath-recirc by combining recirc actions at xlate.

This patch set removes the recirculation of encapsulated tunnel packets
if possible. It is done by computing the post tunnel actions at the time of
translation. The combined nested action set are programmed in the datapath
using CLONE action.

The following test results shows the performance improvement offered by
this optimization for tunnel encap.

          +-------------+
      dpdk0 |             |
         -->o    br-in    |
            |             o--> gre0
            +-------------+

                   --> LOCAL
            +-----------o-+
            |             | dpdk1
            |    br-p1    o-->
            |             |
            +-------------+

Test result on OVS master with DPDK 16.11.2 (Without optimization):

 # dpdk0

 RX packets         : 7037641.60  / sec
 RX packet errors   : 0  / sec
 RX packets dropped : 7730632.90  / sec
 RX rate            : 402.69 MB/sec

 # dpdk1

 TX packets         : 7037641.60  / sec
 TX packet errors   : 0  / sec
 TX packets dropped : 0  / sec
 TX rate            : 657.73 MB/sec
 TX processing cost per TX packets in nsec : 142.09

Test result on OVS master + DPDK 16.11.2 (With optimization):

 # dpdk0

 RX packets         : 9386809.60  / sec
 RX packet errors   : 0  / sec
 RX packets dropped : 5381496.40  / sec
 RX rate            : 537.11 MB/sec

 # dpdk1

 TX packets         : 9386809.60  / sec
 TX packet errors   : 0  / sec
 TX packets dropped : 0  / sec
 TX rate            : 877.29 MB/sec
 TX processing cost per TX packets in nsec : 106.53

The offered performance gain is approx 30%.

Signed-off-by: Sugesh Chandran <sugesh.chandran@intel.com>
Signed-off-by: Zoltán Balogh <zoltan.balogh@ericsson.com>
Co-authored-by: Zoltán Balogh <zoltan.balogh@ericsson.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agotunneling: Calculate and update packet l4_offset in tunnel push.
Sugesh Chandran [Wed, 19 Jul 2017 13:46:02 +0000 (14:46 +0100)]
tunneling: Calculate and update packet l4_offset in tunnel push.

The following tunnel combine patch series avoids the packets recirculation
after the tunnel push. So it is necessary to populate all relevant packet meta
data fields for the following combined action-set.

Consider a chained tunnel test case shown below,

PKT-IN --> TUNNEL_PUSH --> MOD_PKT_HDR --> TUNNEL_POP

In this eg: the last tunnel_pop operation uses the l4_offset in the packet to
validate the packets. So it must be calculated and updated in the packet before
executing the action. Since there is no recirculation now on, this calculation
is doing as part of tunnel_push.

Signed-off-by: Sugesh Chandran <sugesh.chandran@intel.com>
Signed-off-by: Zoltán Balogh <zoltan.balogh@ericsson.com>
Co-authored-by: Zoltán Balogh <zoltan.balogh@ericsson.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agoxlate: Clear tunnel mask along with other fields while combine actions.
Sugesh Chandran [Wed, 19 Jul 2017 13:46:01 +0000 (14:46 +0100)]
xlate: Clear tunnel mask along with other fields while combine actions.

The tunnel mask in the translation state should be cleared along with other
context fields. It is necessary in 'apply_nested_clone_actions' as it will be
used to combine post tunnel output actions with tunnel push. This will assure
right openflow state while executing the translation.

Signed-off-by: Sugesh Chandran <sugesh.chandran@intel.com>
Signed-off-by: Zoltán Balogh <zoltan.balogh@ericsson.com>
Co-authored-by: Zoltán Balogh <zoltan.balogh@ericsson.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agosystem-layer3-tunnels: Add basic GRE ping test case
Eric Garver [Mon, 10 Jul 2017 19:40:00 +0000 (15:40 -0400)]
system-layer3-tunnels: Add basic GRE ping test case

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agosystem-common-macros: Add macro to check for L3 GRE support
Eric Garver [Mon, 10 Jul 2017 19:39:59 +0000 (15:39 -0400)]
system-common-macros: Add macro to check for L3 GRE support

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agosystem-layer3-tunnels: Add basic VXLAN-GPE ping test case
Eric Garver [Mon, 10 Jul 2017 19:39:58 +0000 (15:39 -0400)]
system-layer3-tunnels: Add basic VXLAN-GPE ping test case

This also adds a new autotest file specifically for layer3 tunnels.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agosystem-common-macros: Add macro to check for VXLAN-GPE support
Eric Garver [Mon, 10 Jul 2017 19:39:57 +0000 (15:39 -0400)]
system-common-macros: Add macro to check for VXLAN-GPE support

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agosystem-common-macros: Add macro to check for ip-route encap support
Eric Garver [Mon, 10 Jul 2017 19:39:56 +0000 (15:39 -0400)]
system-common-macros: Add macro to check for ip-route encap support

This is used for native layer3 tunnels.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agosystem-common-macros: Allow passing config to ADD_OVS_TUNNEL
Eric Garver [Mon, 10 Jul 2017 19:39:55 +0000 (15:39 -0400)]
system-common-macros: Allow passing config to ADD_OVS_TUNNEL

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agodpif-netlink-rtnl: Support layer3 GRE
Eric Garver [Mon, 10 Jul 2017 19:39:54 +0000 (15:39 -0400)]
dpif-netlink-rtnl: Support layer3 GRE

Add support for creating layer3 GRE.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agodpif-netlink-rtnl: Support VXLAN-GPE
Eric Garver [Mon, 10 Jul 2017 19:39:53 +0000 (15:39 -0400)]
dpif-netlink-rtnl: Support VXLAN-GPE

Add support for creating VXLAN tunnels with GPE. This enables layer3
VXLAN tunnels with kernel datapath.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agodpif-netlink: For non-Ethernet, use Ethertype from packet_type.
Joe Stringer [Tue, 18 Jul 2017 22:32:44 +0000 (15:32 -0700)]
dpif-netlink: For non-Ethernet, use Ethertype from packet_type.

For non-Ethernet flows, when fixing up the netlink message we need make
sure to pass down a valid Ethertype. The kernel does not understand
packet_type so it's implicitly encoded by the absence of _ETHERNET and
exact match of _ETHERTYPE. Without this change match_validate in the
kernel complains when trying to match packets from L3 tunnels.
e.g.
  openvswitch: netlink: Unexpected mask (mask=110088, allowed=3d9804c)

The mask use to always be set in xlate_wc_init() and xlate_wc_finish(),
but that changed for non-Ethernet frames with the commit listed below.

Fixes: 3d4b2e6eb74e ("userspace: Add OXM field MFF_PACKET_TYPE")
Signed-off-by: Joe Stringer <joe@ovn.org>
Co-authored-by: Eric Garver <e@erig.me>
Acked-by: Eric Garver <e@erig.me>
6 years agodpif-netlink: Use netlink helpers for packet_type.
Joe Stringer [Tue, 18 Jul 2017 22:32:43 +0000 (15:32 -0700)]
dpif-netlink: Use netlink helpers for packet_type.

Rather than open-coding access to netlink attribute pointers in
put_exclude_packet_type(), make use of the netlink attribute helpers.
This simplifies the following bugfix.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Eric Garver <e@erig.me>
6 years agodatapath: enable VxLAN-gpe port creation in compat mode
Yang, Yi Y [Fri, 7 Jul 2017 03:02:13 +0000 (11:02 +0800)]
datapath: enable VxLAN-gpe port creation in compat mode

In compat mode, ovs can't create L3 VxLAN-gpe port in old
kernels if port creation failed by rtnetlink, this patch
enables old kernels to create L3 VxLAN-gpe port.

Signed-off-by: Yi Yang <yi.y.yang@intel.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agoodp-util: Document size of OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV4.
Justin Pettit [Wed, 19 Jul 2017 04:49:39 +0000 (21:49 -0700)]
odp-util: Document size of OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV4.

This attribute is exclusive of OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV6 so it
doesn't take up additional space (IPv6 is larger), but it's still worth
documenting.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
6 years agoovn: l3ha truncate log file in tests before action starts
majopela@redhat.com [Tue, 18 Jul 2017 14:55:03 +0000 (14:55 +0000)]
ovn: l3ha truncate log file in tests before action starts

An specific ovn/l3ha test looks for port releases in the MASTER
gateway when another gateway on the Gateway_Chassis list is gone.

But we didn't clean the log before taking out the chassis, so
any previous unrelated occurrence could make the test fail
while it was ok.

Signed-off-by: Miguel Angel Ajo <majopela@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agoovn: l3ha make packet checks more robust by filtering
majopela@redhat.com [Tue, 18 Jul 2017 14:55:02 +0000 (14:55 +0000)]
ovn: l3ha make packet checks more robust by filtering

We're now filtering out packets that we don't care about before
comparing with expected data.

Also, we're less strict on the number of gARPs we expect to
receive by using uniq filter, and looking for just one (or
none where it should be none).

Signed-off-by: Miguel Angel Ajo <majopela@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agoovn: l3ha, add timeout to each sync operation during tests
majopela@redhat.com [Tue, 18 Jul 2017 14:55:01 +0000 (14:55 +0000)]
ovn: l3ha, add timeout to each sync operation during tests

This makes tests easier to debug because the sync operation won't hang
up when an ovn-controller or ovn-northd is not responding for any
reason.

Signed-off-by: Miguel Angel Ajo <majopela@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agoovn: l3ha fix bundle action generation
majopela@redhat.com [Tue, 18 Jul 2017 14:55:00 +0000 (14:55 +0000)]
ovn: l3ha fix bundle action generation

The bundle pointer wasn't properly re-pointed each time
we added a new slave port to the openflow action.

Signed-off-by: Miguel Angel Ajo <majopela@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agoofproto-dpif-xlate: Fixes for propagating state of conntrack.
Justin Pettit [Wed, 12 Jul 2017 23:24:23 +0000 (16:24 -0700)]
ofproto-dpif-xlate: Fixes for propagating state of conntrack.

The "ct" action is not supposed to make the various ct match fields
available except for the pipeline instantiated through the "table"
argument to the "ct" action.  This commit fixes a few issues related to
that and updates the tests appropriately.

Fixes: 8e53fe8cf7a1 ("Add connection tracking mark support.")
Fixes: 9daf23484fb1 ("Add connection tracking label support.")
Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
6 years agoacinclude.m4: Avoid error from printf.
Ben Pfaff [Mon, 17 Jul 2017 17:12:44 +0000 (10:12 -0700)]
acinclude.m4: Avoid error from printf.

GNU (at least) printf interprets -I as an option, but we want to print it
literally, so use %s.

CC: YAMAMOTO Takashi <yamamoto@ovn.org>
Fixes: 27d41afaa446 ("acinclude.m4: Avoid echo -n")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
6 years agoconnmgr: Fix crash when in_band_create() fails.
Ben Pfaff [Mon, 17 Jul 2017 16:54:54 +0000 (09:54 -0700)]
connmgr: Fix crash when in_band_create() fails.

update_in_band_remotes() created an in-band manager and then tried to work
with it without first checking whether creation had succeeded.  If it
failed, this led to a segfault.

Reported-by: Numan Siddique <nusiddiq@redhat.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-July/335530.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
6 years agoSupport IPv6 link-local address scopes on Linux.
Ben Pfaff [Fri, 14 Jul 2017 21:33:46 +0000 (14:33 -0700)]
Support IPv6 link-local address scopes on Linux.

I hadn't even heard of this feature before, but it seems to be at least
semi-standard to support Linux link-local address scopes via a % suffix,
e.g. fe80::1234%eth0 for a link-local address scoped to eth0.  This commit
adds support.

I'd appreciate feedback from folks who understand this feature better than
me.

Reported-by: Ali Volkan Atli <Volkan.Atli@argela.com.tr>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Darrell Ball <dlu998@gmail.com>
Tested-by: Numan Siddique <nusiddiq@redhat.com>
Acked-by: Numan Siddique <nusiddiq@redhat.com>
6 years agosocket-util: Change ss_format_address() to take a dynamic string.
Ben Pfaff [Fri, 14 Jul 2017 21:33:45 +0000 (14:33 -0700)]
socket-util: Change ss_format_address() to take a dynamic string.

It's occasionally convenient to format into a fixed-size buffer, but
as the use cases, and the text to be formatted, get more sophisticated,
it becomes easier to deal with "struct ds *" than a buffer pointer and
length pair.  An upcoming commit will make ss_format_address() do more
work, and I think that this is the point at which it becomes easier to
take a dynamic string.  This commit makes the parameter type change
without yet changing what is formatted.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Tested-by: Numan Siddique <nusiddiq@redhat.com>
Acked-by: Numan Siddique <nusiddiq@redhat.com>
6 years agostream: Make [p]stream_init() take ownership of 'name' parameter.
Ben Pfaff [Fri, 14 Jul 2017 21:33:44 +0000 (14:33 -0700)]
stream: Make [p]stream_init() take ownership of 'name' parameter.

This will be a more sensible interface in an upcoming commit where many of
the callers are assembling dynamic name strings anyway.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Tested-by: Numan Siddique <nusiddiq@redhat.com>
Acked-by: Numan Siddique <nusiddiq@redhat.com>
6 years agoAUTHORS: Add Venkata Anil Kommaddi
Venkata Anil Kommaddi [Mon, 17 Jul 2017 10:33:08 +0000 (16:03 +0530)]
AUTHORS: Add Venkata Anil Kommaddi

Signed-off-by: Venkata Anil Kommaddi <vkommadi@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovn: l3ha ensure no master bouncing when ovn-controller is restarted
majopela@redhat.com [Thu, 13 Jul 2017 17:02:41 +0000 (17:02 +0000)]
ovn: l3ha ensure no master bouncing when ovn-controller is restarted

When ovn-controller is restarted, ovn-controller removes the old
Chassis entry from the SBDB and a new one is inserted.

This cleared the Gateway_Chassis chassis column in the SBDB and then
ovn-northd removed the empty-column Gateway_Chassis entry.
Such event made the other (non-restarted and master gateway chassis)
believe that he was a single (non-HA) gateway, turning off BFD and
releasing the port for a tiny time frame causing unnecesary downtime.

Signed-off-by: Miguel Angel Ajo <majopela@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agoovn: l3ha, gratuitous ARP for HA router
Venkata Anil Kommaddi [Thu, 13 Jul 2017 17:02:40 +0000 (17:02 +0000)]
ovn: l3ha, gratuitous ARP for HA router

This patch extends gratuitous ARP support for NAT addresses so that it
applies to centralized NAT rules on a HA router.
Gratuitous ARP packets for centralized NAT rules on a HA router
are only generated on the active gateway chassis.

Signed-off-by: Anil Venkata <vkommadi@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agoovn: l3ha, make is_chassis_active aware of gateway_chassis
majopela@redhat.com [Thu, 13 Jul 2017 17:02:39 +0000 (17:02 +0000)]
ovn: l3ha, make is_chassis_active aware of gateway_chassis

is_chassis_active now is only true for redirect-chassis ports
in the case of the specific lport being active on the
local chassis.

This will naturally make the ARP responder / redirection openflow
rules automatically inserted/removed when a router goes active/backup
in a way that BACKUP routers won't respond to ARP on gateway ports,
and they won't route packets that arrive on the wrong gateway
chassis (that can happen until all hypervisors converge in the
new MASTER thanks to the BFD monitoring of the tunnel endpoints).

Signed-off-by: Miguel Angel Ajo <majopela@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agoovn: l3ha, enable bfd between tunnel endpoints
Venkata Anil [Thu, 13 Jul 2017 17:02:38 +0000 (17:02 +0000)]
ovn: l3ha, enable bfd between tunnel endpoints

This patch enables bfd protocol between gateways and transport nodes,
all gateway nodes with any HA chassisredirect port will enable BFD
to all tunnel endpoints, while transport nodes will enable BFD
to all tunnel endpoints hosting an HA gateway chassisredirect port.

Signed-off-by: Venkata Anil <vkommadi@redhat.com>
Signed-off-by: Miguel Angel Ajo <majopela@redhat.com>
Co-Authored-by: Miguel Angel Ajo <majopela@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agoovn: l3ha, handling of multiple gateway chassis
majopela@redhat.com [Thu, 13 Jul 2017 17:02:37 +0000 (17:02 +0000)]
ovn: l3ha, handling of multiple gateway chassis

This patch handles multiple gateway_chassis within chassisredirect
ports. All the gateway_chassis within chassisredirect port
will implement the rules to de-encapsulate incoming packets
for such port (please note that later patches in the series
will make is_chassis_redirect conditionals aware of the
MASTER/BACKUP status of the chassis).

Hosts targeting a remote chassisredirect port will setup a
bundle(active_backup, ..) action to each tunnel port, in the given
priority order. Following patches will enable BFD to detect
when a remote gateway chassis is no longer reachable.

Co-authored-by: Venkata Anil Kommaddi <vkommadi@redhat.com>
Signed-off-by: Miguel Angel Ajo <majopela@redhat.com>
Signed-off-by: Venkata Anil Kommaddi <vkommadi@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agoovn: l3ha, ovn-northd gateway chassis propagation
majopela@redhat.com [Thu, 13 Jul 2017 17:02:36 +0000 (17:02 +0000)]
ovn: l3ha, ovn-northd gateway chassis propagation

The redirect-chassis option of logical router ports is now
translated to Gateway_Chassis entries for backwards compatibility.

Gateway_Chassis entries in nbdb are copied over to sbdb and
linked them to the Chassis entry.

Co-authored-by: Anil Venkata <vkommadi@redhat.com>
Signed-off-by: Miguel Angel Ajo <majopela@redhat.com>
Signed-off-by: Anil Venkata <vkommadi@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agoovn: l3ha, NBDB and SBDB changes and documentation
majopela@redhat.com [Thu, 13 Jul 2017 17:02:35 +0000 (17:02 +0000)]
ovn: l3ha, NBDB and SBDB changes and documentation

This commit introduces the north and south db changes necessary for
the l3ha router implementation.

It defines a new Table in both NBDB and SBDB.

The Gateway_Chassis table is created, with a tiny difference between
NBDB and SBDB, NBDB references the chassis via it's name (chassis_name)
and SBDB references the chassis via reference (chassis) to the Chassis table.

In NBDB a new column (gateway_chassis) is added to Logical_Router_Ports
with a list of Gateway_Chassis which can be empty.

In SBDB a new column (gateway_chassis) is added to Port_Binding with
the same list, this column will be used for ports of type chassis-redirect.

Bump minor version since we've added new backwards compatible features.

Co-authored-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Miguel Angel Ajo <majopela@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agoOpenFlow: Add support for "group delete" flow removed reason to 1.3.
Justin Pettit [Sat, 8 Jul 2017 04:19:28 +0000 (21:19 -0700)]
OpenFlow: Add support for "group delete" flow removed reason to 1.3.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agoacinclude.m4: Avoid echo -n
YAMAMOTO Takashi [Sat, 15 Jul 2017 13:53:25 +0000 (22:53 +0900)]
acinclude.m4: Avoid echo -n

-n option for echo is not portable.  Use printf instead.
This fixes OSX build on travis-ci.

Acked-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: YAMAMOTO Takashi <yamamoto@ovn.org>
6 years agoappveyor: Fix broken URL
Alin Serdean [Fri, 14 Jul 2017 11:33:23 +0000 (11:33 +0000)]
appveyor: Fix broken URL

The commit 2e72898bbab40f48cc3fe77ce0273bb9bb66e9ac bumped the OpenSSL
version, but got the URL wrong.

Use uppercase `L` instead of lowercase `l`.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agovlog: Make "vlog/set" without args set everything to "dbg".
Justin Pettit [Wed, 5 Jul 2017 06:34:34 +0000 (23:34 -0700)]
vlog: Make "vlog/set" without args set everything to "dbg".

The documentation stated that "ovs-appctl vlog/set" without any
arguments should set every module and destination to debug level.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agodpif-netdev: Initialize 'tun_md' member of match.
Justin Pettit [Tue, 4 Jul 2017 23:59:13 +0000 (16:59 -0700)]
dpif-netdev: Initialize 'tun_md' member of match.

Found by valgrind.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agopacket-type-aware.at: Avoid GNU extension
YAMAMOTO Takashi [Fri, 14 Jul 2017 16:27:19 +0000 (16:27 +0000)]
packet-type-aware.at: Avoid GNU extension

\t is GNU sed extension.

Signed-off-by: YAMAMOTO Takashi <yamamoto@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agoovn.at: Use a correct operator in a test expression
YAMAMOTO Takashi [Fri, 14 Jul 2017 15:28:06 +0000 (15:28 +0000)]
ovn.at: Use a correct operator in a test expression

== is a GNU extension.

Signed-off-by: YAMAMOTO Takashi <yamamoto@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agopmd.at: Avoid using GNU sed extension
YAMAMOTO Takashi [Fri, 14 Jul 2017 12:55:18 +0000 (12:55 +0000)]
pmd.at: Avoid using GNU sed extension

BRE alternative (\|) is an GNU sed extension. [1]
It isn't available in NetBSD sed.

[1] http://www.gnu.org/software/sed/manual/sed.html#Regular-Expressions
    regexp1\|regexp2
        Matches either regexp1 or regexp2. Use parentheses to use
        complex alternative regular expressions. The matching process
        tries each alternative in turn, from left to right, and the
        first one that succeeds is used. It is a GNU extension.

Signed-off-by: YAMAMOTO Takashi <yamamoto@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agoNetBSD: Stop recommending pkg_alternatives
YAMAMOTO Takashi [Fri, 14 Jul 2017 12:33:49 +0000 (12:33 +0000)]
NetBSD: Stop recommending pkg_alternatives

Because:

- It's no longer necessary

- It can cause problems for some utilities (e.g. ovs-pcap) after
  The recent change. [1]
  See also: http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=51152

[1] b49a959bac4731a6203cc6f846967d96e51180ab
(Use @PYTHON@ directly instead of "#! /usr/bin/env")

Signed-off-by: YAMAMOTO Takashi <yamamoto@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agointerface-reconfigure.at: Use $PYTHON explicitly
YAMAMOTO Takashi [Fri, 14 Jul 2017 13:38:44 +0000 (13:38 +0000)]
interface-reconfigure.at: Use $PYTHON explicitly

Workaround pkg_alternative issue for NetBSD:
    http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=51152

An alternative would be generating xenserver scripts from *.in,
but i'm not sure if it's appropriate for those scripts.

Signed-off-by: YAMAMOTO Takashi <yamamoto@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agoovn: add extra check on distributed gateway ports
majopela@redhat.com [Thu, 13 Jul 2017 17:02:34 +0000 (17:02 +0000)]
ovn: add extra check on distributed gateway ports

Check that removing the options:redirect-chassis in NBDB is
going to remove the cr-${port} in the SBDB.

This is introduced to avoid any regression of this behaviour
on the l3ha series.

Signed-off-by: Miguel Angel Ajo <majopela@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agotest-util: Avoid format truncation warning for snprintf() tests.
Ben Pfaff [Sat, 15 Jul 2017 01:26:48 +0000 (21:26 -0400)]
test-util: Avoid format truncation warning for snprintf() tests.

Reported-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agotests: Disable no-format-truncation warnings
Timothy Redaelli [Thu, 13 Jul 2017 14:29:33 +0000 (16:29 +0200)]
tests: Disable no-format-truncation warnings

test_snprintf function (tests/test-util.c) tests snprintf with shorter length,
but this emit a warning on GCC 7.0 or later.

This commit disables that warning on tests only.

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agoxlate: Refactor translation of patch port output actions.
Sugesh Chandran [Tue, 4 Jul 2017 09:46:38 +0000 (10:46 +0100)]
xlate: Refactor translation of patch port output actions.

Outputting to a patch port is translated by its peer patch port actions.
Refactoring the translation part to use later in the patch series for the
tunnel push.

Signed-off-by: Sugesh Chandran <sugesh.chandran@intel.com>
Signed-off-by: Zoltán Balogh <zoltan.balogh@ericsson.com>
Co-authored-by: Zoltán Balogh <zoltan.balogh@ericsson.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agoofproto-dpif-xlate: drop L3 packets on L2 legacy port
Zoltán Balogh [Fri, 14 Jul 2017 19:24:29 +0000 (21:24 +0200)]
ofproto-dpif-xlate: drop L3 packets on L2 legacy port

This commit drops packet during xlate if it is a L3 packet and output
port packet_type is legacy_l2. New PTAP unit test is added.

Signed-off-by: Zoltán Balogh <zoltan.balogh@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agosparse: Add missing protoype for sendmmsg.
Ben Pfaff [Fri, 14 Jul 2017 21:20:07 +0000 (14:20 -0700)]
sparse: Add missing protoype for sendmmsg.

Reported-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Fixes: 00f5565c7eed ("socket-util: Fix recursion issue in sendmmsg")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
6 years agoFree port bindings when deleting cached ports.
Mark Michelson [Fri, 14 Jul 2017 19:27:24 +0000 (14:27 -0500)]
Free port bindings when deleting cached ports.

Running test "ovn-controller-vtep binding 2" with address sanitizer
enabled resulted in a failure due to a memory leak. The cached switch
port's bindings were not being freed when the port was freed. The
fix is to destroy the bindings hash table when the switch port is
freed.

Signed-off-by: Mark Michelson <mmichels@redhat.com>
Reported-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agodp-packet: Remove misleading comment for refill init function.
Ilya Maximets [Fri, 14 Jul 2017 08:11:38 +0000 (11:11 +0300)]
dp-packet: Remove misleading comment for refill init function.

Function 'dp_packet_batch_refill_init' doesn't return anything.
Looks like this comment came from one of the intermediate versions
of the API enhancement patch. Additionally comment style changed
to be consistent with other comments in the same file.

CC: Andy Zhou <azhou@ovn.org>
Fixes: 72c84bc2db23 ("dp-packet: Enhance packet batch APIs.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
6 years agoofproto-dpif: Detect support for ct_tuple6.
Joe Stringer [Fri, 2 Jun 2017 16:38:47 +0000 (09:38 -0700)]
ofproto-dpif: Detect support for ct_tuple6.

Support for extracting original direction 5 tuple fields from the
connection tracking module may differ on some platforms between the IPv4
original tuple fields vs. IPv6. Detect IPv6 original tuple support
separately and reflect this support up to the OpenFlow layer.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agosystem-traffic: datapath: Add geneve6 test case.
Eric Garver [Wed, 7 Jun 2017 23:54:27 +0000 (19:54 -0400)]
system-traffic: datapath: Add geneve6 test case.

Basic ping test case for GENEVEv6.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agosystem-traffic: datapath: Add vxlan6 test case.
Eric Garver [Wed, 7 Jun 2017 23:54:26 +0000 (19:54 -0400)]
system-traffic: datapath: Add vxlan6 test case.

Basic ping test case for VXLANv6.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agosystem-common-macros: Add macros to create IPv6 tunnels
Eric Garver [Wed, 7 Jun 2017 23:54:25 +0000 (19:54 -0400)]
system-common-macros: Add macros to create IPv6 tunnels

Add simple macros to wrap existing tunnel create macros, but lowers the
MTU enough to allow IPv6 underlay.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agosystem-common-macros: Add ip_addr_flags argument to ADD_VETH()
Eric Garver [Wed, 7 Jun 2017 23:54:24 +0000 (19:54 -0400)]
system-common-macros: Add ip_addr_flags argument to ADD_VETH()

Allow passing flags while creating the IP address on a VETH. This can be
used to pass "nodad" to allow IPv6 address to come up faster.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agosystem-traffic: 802.1ad: Add double VLAN match test case
Eric Garver [Thu, 1 Jun 2017 17:59:27 +0000 (13:59 -0400)]
system-traffic: 802.1ad: Add double VLAN match test case

Test case to match outer, pop outer, then match inner VLAN.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
6 years agosocket-util: Fix recursion issue in sendmmsg
Zhenyu Gao [Fri, 14 Jul 2017 15:06:50 +0000 (15:06 +0000)]
socket-util: Fix recursion issue in sendmmsg

The wrap_sendmmsg has infinite recursion issue.
Fix it by undef sendmmsg.

Signed-off-by: Zhenyu Gao <sysugaozhenyu@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agorstp: Show root bridge info.
Ben Pfaff [Thu, 13 Jul 2017 23:05:04 +0000 (16:05 -0700)]
rstp: Show root bridge info.

"ovs-appctl rstp/show" didn't show much for root bridges.  This fixes the
problem.

Reported-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoAUTHORS: Add ZhiPeng Lu.
Ben Pfaff [Fri, 14 Jul 2017 00:18:53 +0000 (17:18 -0700)]
AUTHORS: Add ZhiPeng Lu.

Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agodb-ctl-base: Fix reference-following feature in get_row_by_id().
ZhiPeng Lu [Tue, 11 Jul 2017 00:47:10 +0000 (08:47 +0800)]
db-ctl-base: Fix reference-following feature in get_row_by_id().

If a particular column is supposed to be reached by following a reference
from a UUID column, then that really needs to happen; if there's no
reference, then we're probably starting from a row in the wrong table.

This fixes an assertion failure in command "ovs-vsctl list netflow br0",
if bridge br0 without any netflows.
$ovs-vsctl list netflow br0
ovs-vsctl: lib/ovsdb-idl.c:2407: assertion column_idx < class->n_columns failed
in ovsdb_idl_read()
Aborted

Fixes: 3f5b5f7b4115 ("db-ctl-base: Always support all tables in schema.")
Signed-off-by: Zhipeng Lu <lu.zhipeng@zte.com.cn>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoappveyor: Bump OpenSSL version
Alin Serdean [Thu, 13 Jul 2017 22:30:35 +0000 (22:30 +0000)]
appveyor: Bump OpenSSL version

The URL https://slproweb.com/download/Win32OpenSSL-1_0_2k.exe is
no longer valid.

Bump the version of OpenSSL to 1_0_2l.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoid-pool: Fix allocation overflow and the leak of the first ID.
Zhou Yangchao [Sun, 12 Mar 2017 03:57:37 +0000 (11:57 +0800)]
id-pool: Fix allocation overflow and the leak of the first ID.

The range of IDs should be [base, base + n_ids),
but id_pool_alloc_id() allocated the range of IDs is [base, base + n_ids].
And id_pool_free_id() cannot free the ID value base correctly.

Signed-off-by: Yangchao Zhou <zhouyates@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agosubmitting-patches: Update test and documentation recommendations.
Ben Pfaff [Thu, 13 Jul 2017 22:41:43 +0000 (15:41 -0700)]
submitting-patches: Update test and documentation recommendations.

Rationale:

- "make distcheck" is not as necessary anymore because we have a build-time
  check that fails if files in the repository are not distributed.

- xenserver has not been important for years, so remove the specific
  callout.

- We already have an informal custom of adding tests for new feaures and
  bug fixes, so codify it.

- Add note about updating NEWS.

Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agodpif-netdev: Fix few comments.
Ilya Maximets [Thu, 6 Jul 2017 11:12:00 +0000 (14:12 +0300)]
dpif-netdev: Fix few comments.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agosocket-util: Avoid using sendmsg on Windows
Alin Serdean [Thu, 13 Jul 2017 20:54:08 +0000 (20:54 +0000)]
socket-util: Avoid using sendmsg on Windows

Sendmsg is not used under Windows.

While it does have a sort of equivalent called `WSASendMsg`
(https://msdn.microsoft.com/en-us/library/windows/desktop/ms741692(v=vs.85).aspx)
it uses a different structure `WSAMSG` instead of the normal msghdr which
in turn will have to be mapped properly (this goes further to iovec/wsabuf in the
structure itself).

Fixes broken build on Windows.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Shashank Ram <rams@vmware.com>
6 years agoofproto-dpif-ipfix: add Exporting Process Reliability Statistics
Przemyslaw Szczerbik [Wed, 5 Jul 2017 13:54:18 +0000 (14:54 +0100)]
ofproto-dpif-ipfix: add Exporting Process Reliability Statistics

This patch adds support for The Exporting Process Reliability Statistics
Option Template, which is defined in RFC 5101, Section 4.3. For now, this
Option Template includes only exporting process ID scope field and a
single counter - notSentPacketTotalCount.

Currently, Data Records that contain exporting process statistics are
transmitted at regular intervals, immediately after sending (Options) Template
Records. This behavior could be changed later on to allow the interval of
sending exporting process statistics to be configurable as RFC recommends it.
According to RFC 5101, Section 10.3.6. the frequency of the (Options) Template
transmissions MUST be configurable. OvS doesn't comply to this requirement.
Therefore, it seems to be a good idea to make both intervals configurable at
the same time.

Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoUserspace Datapath: Add missed lock annotations.
Darrell Ball [Thu, 6 Jul 2017 04:32:21 +0000 (21:32 -0700)]
Userspace Datapath: Add missed lock annotations.

Fixes: a489b16854b5 ("conntrack: New userspace connection tracker.")
Fixes: 286de2729955 ("dpdk: Userspace Datapath: Introduce NAT Support.")
Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoUserspace Datapath: Remove 'nat' from lock name.
Darrell Ball [Thu, 6 Jul 2017 04:32:20 +0000 (21:32 -0700)]
Userspace Datapath: Remove 'nat' from lock name.

The 'nat' portion of 'nat_resources_lock' is dropped as
this lock will be used by ALGs in a subsequent patch.

Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoUserspace Datapath: Change 'related' to 'icmp_related'.
Darrell Ball [Thu, 6 Jul 2017 04:32:19 +0000 (21:32 -0700)]
Userspace Datapath: Change 'related' to 'icmp_related'.

The conntrack context flag 'related' is changed to 'icmp_related'
to disambiguate usage w.r.t. ALGs which are added in a subsequent
patch.

Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agonetdev: fix missing shifts of VXLAN_EXT_GPE
Eric Garver [Fri, 30 Jun 2017 20:27:45 +0000 (16:27 -0400)]
netdev: fix missing shifts of VXLAN_EXT_GPE

Contrary to the comment by the enum value, these are actually regular
enum values that need shifted. VXLAN_EXT_GBP for example is used as a
netlink value for vports.

Fixes: 875ab13020b1 ("userspace: Handling of versatile tunnel ports")
Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoctags: include symbols with locking annotations.
Flavio Leitner [Tue, 27 Jun 2017 00:55:50 +0000 (21:55 -0300)]
ctags: include symbols with locking annotations.

OVS uses extensively clang annotations for thread safety
checks. The ctags tool can't parse them, so they are not
included in the tag file.

This patch improves the configure script to generate a list
of identifiers from the header compiler.h to be ignored by
ctags.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Aaron Conole <aconole@redhat.com>
6 years agonx-match: Don't append "ct_nw_proto" nx_match if mask not set.
Justin Pettit [Wed, 12 Jul 2017 22:43:45 +0000 (15:43 -0700)]
nx-match: Don't append "ct_nw_proto" nx_match if mask not set.

The function nx_put_raw() shouldn't append "ct_nw_proto" to nx_match if
the corresponding mask isn't set.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agoprocess: Consolidate process related APIs.
Bhanuprakash Bodireddy [Tue, 20 Jun 2017 09:29:47 +0000 (10:29 +0100)]
process: Consolidate process related APIs.

As part of retrieving system statistics, process status APIs along with
helper functions were implemented. Some of them are very generic and can
be reused by other subsystems.

Move the APIs in system-stats.c to process.c and util.c and make them
available. This patch doesn't change any functionality.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agobridge: Filter all zero mac when use ovs-vsctl to set mac
zhongbaisong [Thu, 29 Jun 2017 09:16:51 +0000 (17:16 +0800)]
bridge: Filter all zero mac when use ovs-vsctl to set mac

Signed-off-by: zhongbaisong <zhongbaisong@huawei.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoutil: Make PADDED_MEMBERS work more than once per struct.
Ben Pfaff [Tue, 11 Jul 2017 04:55:56 +0000 (21:55 -0700)]
util: Make PADDED_MEMBERS work more than once per struct.

Until now, if the PADDED_MEMBERS macro was used more than once in a struct,
it caused Clang and GCC warnings because of multiple definition of a member
named "pad".  This commit fixes the problem by giving each of these a
unique name.

MSVC, Clang, and GCC all support the __COUNTER__ macro, although it is not
standardized.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Bhanuprakash Bodireddy <Bhanuprakash.bodireddy@intel.com>
6 years agosocket-util: Support sendmmsg() regardless of platform.
Ben Pfaff [Thu, 13 Jul 2017 00:38:33 +0000 (17:38 -0700)]
socket-util: Support sendmmsg() regardless of platform.

This will have its first user in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotest-conntrack: Restore packet batching to pcap test.
Ben Pfaff [Wed, 12 Jul 2017 04:15:21 +0000 (21:15 -0700)]
test-conntrack: Restore packet batching to pcap test.

The test accepted but then ignored the batch count argument.

Reported-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Fixes: 72c84bc2db23 ("dp-packet: Enhance packet batch APIs.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
6 years agoofproto/trace: Add --ct-next option to ofproto/trace
Yi-Hung Wei [Tue, 27 Jun 2017 18:11:34 +0000 (11:11 -0700)]
ofproto/trace: Add --ct-next option to ofproto/trace

Previous patch enables ofproto/trace to automatically trace a flow
that involves multiple recirculation on conntrack. However, it always
sets the ct_state to trk|est when it processes recirculated conntrack flows.
With this patch, users can customize the expected next ct_state in the
aforementioned use case.

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoofproto/trace: Add support for tracing conntrack recirculation
Yi-Hung Wei [Tue, 27 Jun 2017 18:11:33 +0000 (11:11 -0700)]
ofproto/trace: Add support for tracing conntrack recirculation

Previously, a user need to run ofproto/trace multiple times to derive the
final datapath actions if a flow hit conntrack actions that involves
recirculation. To improve the usability of ofproto/trace, in this patch,
we keep track of the conntrack actions, and automatically run the
recirculation process so that a user only need to execute the ofproto/trace
command once. Currently, this patch sets the default ct_state as
trk and new in the automatic recirculation process. A following patch
will provide an option to customize ct_state.

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoopenvswitch-switch.postinst: Remove upstart files.
Gurucharan Shetty [Mon, 26 Jun 2017 10:34:58 +0000 (03:34 -0700)]
openvswitch-switch.postinst: Remove upstart files.

For a while, ubuntu used upstart scripts as an alternative
for sysv scripts. For e.g popular releases like ubuntu12.04
and ubuntu14.04 have upstart infrastructure. From Ubuntu16.04,
they have moved to systemd.

Ubuntu maintainers have a fork of openvswitch packages with
upstart scripts. When a user installs openvswitch-switch
package on a ubuntu 14.04 with 'apt-get install openvswitch-switch',
two upstart files are added to /etc/init directory.

Now, when the same user builds debian packages from this repo
and then installs them, the older upstart files don't get
deleted. What this means is that a command like
'invoke-rc.d openvswitch-switch restart' calls initctl scripts
instead of sysv script that this repo provides. In our sysv
scripts we have logic to carefully upgrade kernel module and
save openflow flows. This breaks the intent of the package from
this repo.

This commit deletes any stale upstart files that have remained
in the system.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agoopenvswitch-switch.postinst: Replace tabs by spaces
Gurucharan Shetty [Mon, 26 Jun 2017 10:33:00 +0000 (03:33 -0700)]
openvswitch-switch.postinst: Replace tabs by spaces

There was some inconsistency with some tabs and some spaces
used.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agoconntrack: Move ct_state parsing to lib/flow.c
Yi-Hung Wei [Tue, 27 Jun 2017 18:11:32 +0000 (11:11 -0700)]
conntrack: Move ct_state parsing to lib/flow.c

This patch moves conntrack state parsing function from ovn-trace.c to
lib/flow.c, because it will be used by ofproto/trace unixctl command
later on. It also updates the ct_state checking logic, since we no longer
assume CS_TRACKED is enable by default.

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoAUTHORS: Add zhaozhanxu.
Ben Pfaff [Wed, 12 Jul 2017 16:51:59 +0000 (09:51 -0700)]
AUTHORS: Add zhaozhanxu.

Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotnl-ports: Fix loss of tunneling upon removal of a single tunnel port.
zhaozhanxu [Mon, 26 Jun 2017 10:29:22 +0000 (18:29 +0800)]
tnl-ports: Fix loss of tunneling upon removal of a single tunnel port.

When OVS had multiple tunnel ports of a single kind, and any one of them
was removed, the remaining ports could no longer receive traffic.  This
fixes the problem.

Signed-off-by: zhaozhanxu <zhaozhanxu@163.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agocheckpatch: Suggest ovs_assert() to author.
Bhanuprakash Bodireddy [Sun, 18 Jun 2017 20:48:09 +0000 (21:48 +0100)]
checkpatch: Suggest ovs_assert() to author.

Suggest the author to use the OVS wrapper of the assert function.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
6 years agonetdev: Fix crash when ifa_netmask is null.
Haifeng Lin [Tue, 4 Jul 2017 00:52:57 +0000 (08:52 +0800)]
netdev: Fix crash when ifa_netmask is null.

glibc sometimes doesn't initialize the ifa_netmask and ifa_addr fields, if
the ioctl to fetch them fails.  Check ifa_name also just for paranoia.

Signed-off-by: Haifeng Lin <haifeng.lin@huawei.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agonetdev-dpdk: Log Rx checksum offload not supported.
Kevin Traynor [Mon, 26 Jun 2017 21:51:51 +0000 (22:51 +0100)]
netdev-dpdk: Log Rx checksum offload not supported.

Rx checksum offload is enabled by default on DPDK NICs where
supported. Previously Rx checksum offload not supported was
logged only once. It meant that if multiple NICs did not
support Rx checksum offload, it was only reported for the
first NIC configured.

Fixes: 1a2bb11817a4 ("netdev-dpdk: Enable Rx checksum offloading feature on DPDK physical ports.")
Reported-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agonetdev-dpdk: Remove Rx checksum reconfigure.
Kevin Traynor [Mon, 26 Jun 2017 21:51:50 +0000 (22:51 +0100)]
netdev-dpdk: Remove Rx checksum reconfigure.

Rx checksum offload is enabled by default on DPDK physical NICs
where available, with reconfiguration through
options:rx-checksum-offload. However, changing rx-checksum-offload
did not result in a reconfiguration of the NIC and wrong status is
reported for it.

As there seems to be diminishing reasons why a user would want
to disable Rx checksum offload, just remove the broken reconfiguration
option.

Fixes: 1a2bb11817a4 ("netdev-dpdk: Enable Rx checksum offloading feature on DPDK physical ports.")
Reported-by: Kevin Traynor <ktraynor@redhat.com>
Suggested-by: Sugesh Chandran <sugesh.chandran@intel.com>
Acked-by: Darrell Ball <dlu998@gmail.com>
Tested-by: Sugesh Chandran <sugesh.chandran@intel.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>