Jan Scheurich [Fri, 23 Jun 2017 16:48:34 +0000 (16:48 +0000)]
tests: Added unit tests in packet-type-aware.at
First and second unit tests perform basic verification.
The third one is a triangular bridge setup test case. It tests dataplane
in non-PTAP and ptap bridges in conjunction with L2 and L3 GRE tunnels.
It uses veth ports, therefore requires root privileges.
A simplified version of the third test is added to system userspace unit tests.
Ben Pfaff [Fri, 23 Jun 2017 16:47:59 +0000 (16:47 +0000)]
userspace: Handling of versatile tunnel ports
In netdev_gre_build_header(), GRE protocol and VXLAN next_potocol is set based
on packet_type of flow. If it's about an Ethernet packet, it is set to
ETP_TYPE_TEB. Otherwise, if the name space is OFPHTN_ETHERNET, it is set
according to the name space type.
Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Jan Scheurich [Fri, 23 Jun 2017 16:47:57 +0000 (16:47 +0000)]
userspace: Add OXM field MFF_PACKET_TYPE
Allow packet type namespace OFPHTN_ETHERTYPE as alternative pre-requisite
for matching L3 protocols (MPLS, IP, IPv6, ARP etc).
Change the meta-flow definition of packet_type field to use the new
custom format MFS_PACKET_TYPE representing "(NS,NS_TYPE)".
Parsing routine for MFS_PACKET_TYPE added to meta-flow.c. Formatting
routine for field packet_type extracted from match_format() and moved to
flow.c to be used from meta-flow.c for formatting MFS_PACKET_TYPE.
Updated the ovs-fields man page source meta-flow.xml with documentation
for packet-type-aware bridges and added documentation for field packet_type.
Added packet_type to the matching properties in tests/ofproto.at.
If dl_type is unwildcarded due to later packet modification, make sure it
is cleared again if the original packet_type was not PT_ETH.
Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Ben Pfaff [Fri, 23 Jun 2017 16:47:54 +0000 (16:47 +0000)]
nx-match: Add context argument to nxm_put__().
An upcoming commit will need to pass an extra piece of data from
nx_put_raw() into all of its direct and indirect calls to nxm_put__().
This commit prepares for that by switching from a "struct ofpbuf *"
parameter to a context structure that, currently, contains just a
struct ofpbuf *. The upcoming commit will add another member to the
context struct.
Anand Kumar [Fri, 23 Jun 2017 21:05:12 +0000 (14:05 -0700)]
datapath-windows: Include ICMP type and code fields to find a matching ct entry
In conntrack lookup, ICMP type and code fields were not being used to
determine a matching entry. As a result, ICMP4_ECHO_REQUEST packet could
be tracked as ICMP4_ECHO_REPLY packet and vice versa, which is invalid.
To fix this, add ICMP type and code fields for matching a conntrack entry.
Darrell Ball [Tue, 27 Jun 2017 02:42:01 +0000 (19:42 -0700)]
dpif: Fix cleanup of userspace datapath.
Hardware offload introduced extra tracking of netdev ports. This
included ovs-netdev, which is really for internal infra usage for
the userpace datapath. This breaks cleanup of the userspace
datapath. One effect is that all userspace datapath system tests
fail except for the first one run. There is no need to do this
extra tracking of tap devices for the hardware offload effort.
Hence, the approach taken is to filter both internal device
and tap device types for hardware offload. Internal devices are
'internal' from the kernel datapath perspective and tap devices
are 'internal' from the userpace datapath perspective.
Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Joe Stringer <joe@ovn.org>
Ben Pfaff [Sun, 18 Jun 2017 01:46:54 +0000 (09:46 +0800)]
ovs-dpctl: New --names option to use port names in flow dumps.
Until now, printing names in "ovs-dpctl dump-flows" was tied to the overall
output verbosity, which in practice meant that to see port names a user had
to see a distracting amount of verbosity. This decouples names from
verbosity.
I'd like to make showing names the default for interactive usage, but so
far names aren't accepted in input so that would frustrate cut-and-paste,
which is an important use of "ovs-dpctl dump-flows" output.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jan Scheurich <jan.scheurich@ericsson.com> Tested-by: Jan Scheurich <jan.scheurich@ericsson.com>
Shashank Ram [Thu, 15 Jun 2017 22:15:47 +0000 (15:15 -0700)]
datapath-windows: Add validations for IP_HEADER_LEN
Adds validations in OvsGetIp() to make sure the IHL is
within valid bounds. If IHL is invalid, then the packet
is dropped by the callers of this function.
Anand Kumar [Wed, 21 Jun 2017 20:33:55 +0000 (13:33 -0700)]
datapath-windows: Add support for UPDATE events in Conntrack
Introduce a new event type OVS_EVENT_CT_UPDATE to send a conntrack event
whenever a MARK and/or LABEL gets changed for an existing conntrack entry.
- Parse netlink conntrack attribute OVS_CT_ATTR_EVENTMASK, which is used
to set the mask of bits specifying which conntrack events (IPCT_*)
should be delivered via the Netfilter netlink multicast groups.
- Send update event only when OVS_CT_ATTR_EVENTMASK attribute has the mask
of bits set for IPCT_MARK and/or IPCT_LABEL.
Sairam Venugopal [Wed, 21 Jun 2017 17:08:57 +0000 (10:08 -0700)]
datapath-windows: Fix potential memory leak while creating conntrack entry
OvsCtAddEntry returns TRUE or FALSE depending on whether
OvsNatTranslateCtEntry was successful or not. In the case of an
unsuccesful NAT translation, this will fail to insert the newly created
entry to the Conntrack Table. This entry needs to be freed and the states
should be accordingly in the flowKey instead of returning out.
Consolidated the parentEntry lookup and assignment portion across
different protocols and some minor refactoring to make the code more
readable.
Tests Done: Enabled driver verifier and tested the following:
- TCP & ICMP traffic through Conntrack Module.
- Flushed Conntrack Entries while traffic was flowing.
- Uninstalled and re-installed the driver when traffic was in progress.
Joe Stringer [Wed, 21 Jun 2017 23:25:19 +0000 (16:25 -0700)]
distclean: Fix ovs-vtep and docker drivers.
Commit b49a959bac47 ("Use @PYTHON@ directly instead of "#! /usr/bin/env"")
broke distclean, as it doesn't clean up the generated python scripts
after building. Fix by adding the new script files to CLEANFILES.
Fixes: b49a959bac47 ("Use @PYTHON@ directly instead of "#! /usr/bin/env"") Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
Joe Stringer [Tue, 20 Jun 2017 22:17:33 +0000 (15:17 -0700)]
ofp-actions: Store raw type for NXAST_LEARN2.
Previously, if a controller wrote a flow with action NXAST_LEARN2, then
OVS would internally store an ofpact_learn structure with the raw type
set to NXAST_LEARN. When re-encoding, if the learn action happened to
have a limit or dst_ofs specified (which can only be specified for
NXAST_LEARN2), then it would re-encode using NXAST_LEARN2. However, if
these fields were both zero then OVS relies on the ofpact 'raw' type to
re-encode the action, so would end up encoding it as NXAST_LEARN in
subsequent serialization.
Fix this issue by storing the raw type when decoding learn actions.
VMWare-BZ: #1897275 Fixes: 4c71600d2256 ("ofp-actions: Add limit to learn action.") Reported-by: Harold Lim <haroldl@vmware.com> Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
Timothy Redaelli [Tue, 20 Jun 2017 17:53:55 +0000 (19:53 +0200)]
Use @PYTHON@ directly instead of "#! /usr/bin/env"
In some installed python scripts /usr/bin/env is unnecessarily used in
shebang, replace it directly with @PYTHON@.
This will also avoid implicit dependency to /usr/bin/env in RPM distributions
and it will correctly add implicit dependency to /usr/bin/python instead.
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Joe Stringer <joe@ovn.org>
Anand Kumar [Fri, 16 Jun 2017 17:06:26 +0000 (10:06 -0700)]
windows: Remove vlog_init() from service_start function
When --syslog-method is passed as a cmd line argument and
ovs daemons are started as a service, --syslog-method argument is not
honoured, as vlog module is initialized by service_start function
before parsing the command line arguments.
Easy way to fix this, is to remove vlog_init() from the service start
function and let the first log message to initialize the vlog module.
sorted_poll_list() returns the sorted list of rxqs mapped to PMD thread
along with the rxq count. Skip sorting the list if there are no rxqs
mapped to the PMD thread. This can be reproduced with manual pinning and
'dpif-netdev/pmd-rxq-show' command.
Also Clang reports that null argument is passed to qsort in this case.
Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Joe Stringer [Thu, 15 Jun 2017 23:36:49 +0000 (16:36 -0700)]
docs: Document that hw-offload is experimental.
Currently, the set of flows that may be offloaded is very small compared
to the overall capabilities of the OpenFlow support in OVS. In the
majority of cases, if a user attempts to enable this flag they are
unlikely to observe a performance increase, because for instance they
lack the correct hardware; lack the correct kernel version; or their
flow tables are too complex for the hardware to handle.
To moderate expectations around this feature, describe it as
experimental. Over time, we expect that the functionality and usefulness
of this feature will grow and we should be in a better shape to revisit
the status of this functionality after it has had some time to mature.
Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Simon Horman <simon.horman@netronome.com> Acked-by: Flavio Leitner <fbl@sysclose.org>
Greg Rose [Fri, 16 Jun 2017 23:37:09 +0000 (16:37 -0700)]
compat: Restrict __ro_after_init usage
The attribute __ro_after_init was introduced in Linux kernel 4.5. If
a data structure is given this attribute then after the driver module
loads the memory page where the data resides will be marked read only.
The compat code in cache.h always defines __ro_after_init if it is not
already defined so that it can be used as an attribute for the datapath
genl_family structure definitions. If __ro_after_init is defined then
it is used "as-is" where it will apply the read only attribute after
driver initialization.
This is incorrect usage for the Generic Netlink genl_family structure
definitions prior to Linux kernel 4.10. The genl_family structure
in those kernels includes a list header member that will be written
to when the generic netlink family is unregistered. This will cause
a subsequent page fault and kernel panic because at this time the
genl_family structure data has been marked read only in the page
descriptor.
A new compat macro is introduced in acinclude.m4 to detect when the
genl_family structure has the family_list list header as a member.
In this case HAVE_GENL_FAMILY_LIST is defined and if __ro_after_init
is also defined then it is undefined and redefined as empty. This
will prevent the genl_family data structure from being marked read
only in kernels 4.5 through 4.9 and thus prevent the page fault when
the generic netlink families in datapath.c are unregistered.
[Committer notes]
* Rolled a short explanation comment into the code.
Fixes: ba63fe260bd5 ("datapath: Allow compile against current net-next.") CC: Jarno Rajahalme <jarno@ovn.org> Signed-off-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Joe Stringer <joe@ovn.org>
Ilya Maximets [Thu, 15 Jun 2017 11:57:30 +0000 (14:57 +0300)]
checkpatch: Fix skipping of the most recent commit.
'range(n_patches, 0, -1)' generates list starting from 'n_patches'
and not including zero. This leads to checking of N most recent
commits starting from the second one.
New version will generate right list starting from 'n_patches - 1'
and including zero. So, the most recent commit (HEAD~0) will be
checked and desired behavior will be achieved.
Also, 'reversed' looks better than 'range(n_patches - 1, -1, -1)'
Fixes: a1fccabce2cb ("checkpatch: Support checking recent commits in the current repo.") Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Paul Blakey [Tue, 13 Jun 2017 15:03:51 +0000 (18:03 +0300)]
tests: Add system-offloads-testsuite
The new system-offloads-testsuite, which can be launched via
`make check-offloads`, tests offloading capabilities
to makes sure that certian flows are actually offloaded.
The tests run on virtual netdevices (VETH).
Signed-off-by: Paul Blakey <paulb@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Paul Blakey [Tue, 13 Jun 2017 15:03:46 +0000 (18:03 +0300)]
netdev-vport: Use common offloads interface
netdev vports are backed by actualy netdev at the kernel
level, so they can use the common netdev-tc offloads interface
for flow offloading (if enabled).
Signed-off-by: Paul Blakey <paulb@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Paul Blakey [Tue, 13 Jun 2017 15:03:44 +0000 (18:03 +0300)]
netdev-tc-offloads: Implement flow get using tc interface
Search the requested ufid for a offloaded flow, and if found,
dump and parse it back to required format.
Signed-off-by: Paul Blakey <paulb@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Paul Blakey [Tue, 13 Jun 2017 15:03:38 +0000 (18:03 +0300)]
dpif-netlink: Use netdev flow put api to insert a flow
Using the new netdev flow api operate will now try and
offload flows to the relevant netdev of the input port.
Other operate methods flows will come in later patches.
Signed-off-by: Paul Blakey <paulb@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Paul Blakey [Tue, 13 Jun 2017 15:03:35 +0000 (18:03 +0300)]
netdev-tc-offloads: Add ufid to tc/netdev map
Flows offloaded to tc are identified by priority
and handle pair while OVS flows are identified by ufid.
Added a hash map to convert between the two for later
retrieval and deleting of offloaded flows.
Signed-off-by: Paul Blakey <paulb@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Paul Blakey [Tue, 13 Jun 2017 15:03:31 +0000 (18:03 +0300)]
dpif: Save added ports in a port map for netdev flow api use
To use netdev flow offloading api, dpifs needs to iterate over
added ports. This addition inserts the added dpif ports in a hash map,
The map will also be used to translate dpif ports to netdevs.
Signed-off-by: Paul Blakey <paulb@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Paul Blakey [Tue, 13 Jun 2017 15:03:30 +0000 (18:03 +0300)]
other-config: Add tc-policy switch to control tc flower flag
Add a new configuration tc-policy option that controls tc
flower flag. Possible options are none, skip_sw, skip_hw.
The default is none which is to insert the rule both to sw and hw.
This option is only relevant if hw-offload is enabled.
Signed-off-by: Paul Blakey <paulb@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Santosh Shukla [Mon, 12 Jun 2017 14:38:18 +0000 (14:38 +0000)]
netdev-dpdk: round up mbuf_size to cache_line_size
Some pmd driver(e.g: vNIC thunderx PMD) want mbuf_size to be multiple of
cache_line_size. With out this fix, Netdev-dpdk initialization would
fail for those PMD.
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com> Acked-by: Mark Kavanagh <mark.b.kavanagh@intel.com> Tested-by: Mark Kavanagh <mark.b.kavanagh@intel.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Ian Stokes <ian.stokes@intel.com>
Ben Warren [Thu, 8 Jun 2017 20:47:02 +0000 (13:47 -0700)]
Debian: Rework libopenvswitch packages
The 'openvswitch-common' package did not work well with cross-compiling
since it required Python. This package is broken into two packages as
follows:
- libopenvwitch: contains library files (.a, .so)
- openvswitch-common: depends on libopenvswitch, contains command-line
tools such as ovs-ofctl, ovs-appctl etc.
In addition, this 'openvswitch-dev' library is renamed to
'libopenvswitch-dev' to align more closely with Debian policy. It
depends on libopenvswitch.
Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Ben Pfaff [Wed, 14 Jun 2017 16:07:45 +0000 (09:07 -0700)]
netlink: Introduce helpers for 128-bit integer attributes.
Use the helpers in appropriate places. In most cases, this fixes a
misaligned reference, since ovs_be128 and ovs_u128 require 8-byte alignment
but Netlink only guarantees 4-byte.
Ben Pfaff [Tue, 13 Jun 2017 23:04:29 +0000 (16:04 -0700)]
ovs-ofctl: Avoid read overrun in ofperr_decode_msg().
vconn_add_bundle_error() was keeping at most 64 bytes of an OpenFlow
error message, then it was passing it to ofperr_decode_msg(), which assumed
that the full message was available. This led to a buffer overread.
There's no good reason why it was only keeping the first 64 bytes, so this
commit changes it to keep the whole error message, sidestepping the
problem.
struct vconn_bundle_error only existed for this special case, so remove it
in favor of a chain of ofpbufs.
Paul Blakey [Tue, 13 Jun 2017 15:03:29 +0000 (18:03 +0300)]
other-config: Add hw-offload switch to control netdev flow offloading
Add a new configuration option - hw-offload that enables netdev
flow api. Enabling this option will allow offloading flows
using netdev implementation instead of the kernel datapath.
This configuration option defaults to false - disabled.
Signed-off-by: Paul Blakey <paulb@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Paul Blakey [Tue, 13 Jun 2017 15:03:28 +0000 (18:03 +0300)]
netdev: Adding a new netdev API to be used for offloading flows
Add a new API interface for offloading dpif flows to netdev.
The API consist on the following:
flow_put - offload a new flow
flow_get - query an offloaded flow
flow_del - delete an offloaded flow
flow_flush - flush all offloaded flows
flow_dump_* - dump all offloaded flows
In upcoming commits we will introduce an implementation of this
API for netdev-linux.
Signed-off-by: Paul Blakey <paulb@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Roi Dayan [Tue, 13 Jun 2017 15:03:27 +0000 (18:03 +0300)]
tc: Add tc flower functions
Add tc helper functions to query and manipulate the flower classifier.
Signed-off-by: Paul Blakey <paulb@mellanox.com> Co-authored-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Roi Dayan <roid@mellanox.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Paul Blakey [Tue, 13 Jun 2017 15:03:24 +0000 (18:03 +0300)]
tc: Introduce tc module
Add tc module to expose tc operations to be used by other modules.
Move some tc related functions from netdev-linux.c to tc.c
This patch doesn't change any functionality.
Signed-off-by: Paul Blakey <paulb@mellanox.com> Co-authored-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Roi Dayan <roid@mellanox.com> Acked-by: Joe Stringer <joe@ovn.org> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Roi Dayan [Tue, 13 Jun 2017 15:03:23 +0000 (18:03 +0300)]
netdev-linux: Refactor two tc functions
Refactor tc_make_request and tc_add_del_ingress_qdisc to accept
ifindex instead of netdev struct.
We later want to move those outside netdev-linux module to be
used by other modules.
This patch doesn't change any functionality.
Signed-off-by: Roi Dayan <roid@mellanox.com> Co-authored-by: Paul Blakey <paulb@mellanox.com> Signed-off-by: Paul Blakey <paulb@mellanox.com> Acked-by: Joe Stringer <joe@ovn.org> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Lance Richardson [Tue, 13 Jun 2017 17:51:06 +0000 (13:51 -0400)]
sandbox: disable ssl for backup ovn southbound db
Since the sandbox environment was changed to enable SSL usage for
OVN_Southbound connections, the backup southbound server emits
the log message "socket_util|ERR|6642: bind: Address already in use"
every 2.5 seconds.
Fix by configuring the backup db server to not use remote configuration
from the database (the unix: socket can still be used, as was the
case before SSL was enabled).
Fixes: 0ced2a5c5e47 ("sandbox: use ssl for ovn-controller to sb db connection") Signed-off-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Darrell Ball [Tue, 13 Jun 2017 14:46:29 +0000 (07:46 -0700)]
conntrack: Reset nat_info in un_nat conns.
Un-nat conns have no nat_info as do default conns.
However, un-nat conns are originally templated from the
corresponding default conns and therefore need to
have their nat_info explicitly nulled. This
otherwise exposes a double free if conntrack_destroy()
were to be used to destroy the connection tracker. This
would apply to cleaning the datapath after testing.
Fixes: 286de2729955 ("dpdk: Userspace Datapath: Introduce NAT Support.") Signed-off-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Greg Rose <gvrose8192@gmail.com>
Aaron Conole [Tue, 13 Jun 2017 18:26:03 +0000 (14:26 -0400)]
redhat: make the rpm aware of the lock file
Currently, the db lockfile will cause the openvswitch directory to
linger after uninstall because the rpm database isn't aware that it
should be treated as part of the system. This commit informs the rpmdb
properly as a 'ghost' so that when the package is uninstalled, it will
be removed automatically. This means that if no extra files exist in
/etc/openvswitch, the whole directory will be removed from /etc/.
When __SSE4_2__ && __x86_64__, it is declared as:
static inline uint32_t hash_finish(uint64_t hash, uint64_t final)
A recent commit added an unneeded prototype in the first form, which caused
an error due to the redeclaration of a different type when the second form
was actually used. This removes the prototype, fixing the problem.
It may not be a great idea to have two different forms for this function,
but it's long standing and so I don't want to change it immediately without
proper consideration.
Reported-by: "Fischetti, Antonio" <antonio.fischetti@intel.com> Fixes: 67702b79d845 ("hash: New helper functions for adding words in a buffer to a hash.") Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Darrell Ball <dlu998@gmail.com>
Ben Pfaff [Tue, 13 Jun 2017 04:51:14 +0000 (21:51 -0700)]
byte-order: Fix undefined behavior of BYTES_TO_BE32.
A left shift that would produce a result that is not representable
by the type of the expression's result has "undefined behavior"
according to the C language standard. Avoid this by casting values
that could set the upper bit to unsigned types.
Also document and convert a macro to a function.
While we're at it, delete the unused macro BE16S_TO_BE32.
Flavio Leitner [Fri, 9 Jun 2017 15:58:57 +0000 (12:58 -0300)]
testsuite: exit gracefully if it fails.
The daemon is killed leaving resources behind when a test fails.
This fixes to first signal the daemon to exit gracefully.
Fixes: 0f28164be02ac ("netdev-linux: make tap devices persistent") Suggested-by: Joe Stringer <joe@ovn.org> Co-authored-by: Ben Pfaff <blp@ovn.org> Signed-off-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
windows-datapath: Temporary workaround checksum issue with NAT
There is a known bug with NAT where checksum computation is wrong on
the RX path if offload is enabled. This patch works around the problem
by always computing a software checksum and should be reverted once
we figure out the root cause of checksum error.
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Ben Pfaff [Mon, 12 Jun 2017 15:35:48 +0000 (08:35 -0700)]
ofp-actions: Properly interpret "output:in_port".
It was being misinterpreted as output:NXM_OF_IN_PORT[]. This
interpretation is incorrect because of OpenFlow rules that say that only
the special form generated by output:in_port (or "in_port" on its own)
actually outputs to the input port. The interpretation here was a no-op.
Fixes: 21b2fa617126 ("ofp-parse: Allow match field names in actions and brackets in matches.") Reported-by: nickcooper-zhangtonghao <nic@opencloud.tech> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
Aaron Conole [Thu, 8 Jun 2017 20:41:32 +0000 (16:41 -0400)]
dpdk: Deprecate vhost-user server ports.
Since vhost-user server mode ports are the preferred mechanism for
interconnecting Open vSwitch with VMs when using DPDK, and since there
are currently no known use cases for vhost-user server mode ports apart
from version incompatibilities with QEMU, announce that server mode ports
are considered deprecated and will be removed in a future release.
Cc: Ciara Loftus <ciara.loftus@intel.com> Cc: Kevin Traynor <ktraynor@redhat.com> Suggested-by: Darrell Ball <dball@vmware.com> Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
This patch is useful to debug rstp subsystem and log the
port name instead of port number. This patch will also
be used to display rstp info for next patches.