summaryrefslogtreecommitdiff
path: root/build-aux
Commit message (Collapse)AuthorAgeFilesLines
* python: Include aliases in ofp_fields.py.Adrian Moreno2022-12-211-0/+15
| | | | | | | | | | | | | | We currently auto-generate a dictionary of field names and decoders. However, sometimes fields can be specified by their cannonical NXM or OXM names. Modify gen_ofp_field_decoders to also generate a dictionary of aliases so it's easy to map OXM/NXM names to their fields and decoding information. Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Acked-by: Mike Pattrick <mkp@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* Add support for OpenSSL 3.0 functions.Timothy Redaelli2022-10-071-0/+2
| | | | | | | | | | | | In OpenSSL 3.0 some functions were deprecated and replaced. This commit adds some #ifdef to build without warning on both OpenSSL 1.x and OpenSSL 3.x. For OpenSSL 3.x, the default built-in DH parameters are used (as suggested by SSL_CTX_set_dh_auto manpage). Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* dhparams: Fix .c file generation with OpenSSL >= 3.0.Timothy Redaelli2022-10-071-8/+71
| | | | | | | | | | | | | | | Since OpenSSL upstream commit 1696b8909bbe ("Remove -C from dhparam,dsaparam,ecparam") "openssl dhparam" doesn't support -C anymore. This commit changes generate-dhparams-c to generate dhparams.c by parsing "openssl dhparam -in "$1" -text -noout" output directly. The generated file won't be used on OpenSSL >= 3.0, but it's still needed to be generated if OVS is built on OpenSSL < 3.0. Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* xenserver: Remove xenserver.Greg Rose2022-08-151-1/+0
| | | | | | | | | | | | | Remove the current xenserver implementation - it is obsolete and since 3.0 we do not support kernel module builds [1]. 1. https://mail.openvswitch.org/pipermail/ovs-dev/2022-July/395789.html [i.maximets] Can be added back if people willing to maintain it will be found. Signed-off-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* build-aux: Generate ofp field decoders.Adrian Moreno2022-07-152-2/+71
| | | | | | | | | Based on meta-field information extracted by extract_ofp_fields, autogenerate the right decoder to be used. Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* build-aux: Split extract-ofp-fields.Adrian Moreno2022-07-151-514/+192
| | | | | | | | | | | In order to be able to reuse the core extraction logic, split the command in two parts. The core extraction logic is moved to python/build while the command that writes the different files out of the extracted field info is kept in build-aux. Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* make: Remove the Linux datapath.Greg Rose2022-07-151-1/+0
| | | | | | | | | | | | | | | | Update the necessary make and configure files to remove the Linux datapath and then remove the datapath. Move datapath/linux/compat/include/linux/openvswitch.h to include/linux/openvswitch.h because it is needed to generate header files used by the userspace switch. Also remove references to the Linux datapath from auxiliary files and utilities since it is no longer supported. Signed-off-by: Greg Rose <gvrose8192@gmail.com> Reviewed-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* debian: Update packaging source from Debian/Ubuntu.Frode Nordahl2022-07-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | * Update upstream OVS debian packaging to be on par with package source in Debian/Ubuntu: - Provide a openvswitch-switch-dpdk package that integrates with the dpdk package in the distributions so that end users can opt into a DPDK-enabled Open vSwitch binary. - Provide systemd service files. - Provide openvswitch-source package for reproducible integrated build of for example OVN. - Stop building shared library and subsequently remove libopenvswitch and libopenvswitch-dev binary packages. Co-authored-by: Luca Boccassi <bluca@debian.org> Signed-off-by: Luca Boccassi <bluca@debian.org> Co-authored-by: Christian Ehrhardt <christian.ehrhardt@canonical.com> Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com> Co-authored-by: James Page <james.page@ubuntu.com> Signed-off-by: James Page <james.page@ubuntu.com> Co-authored-by: Corey Bryant <corey.bryant@canonical.com> Signed-off-by: Corey Bryant <corey.bryant@canonical.com> Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* ovs-actions: Convert man page from xml to rST.Ilya Maximets2021-08-311-135/+1
| | | | | | | | | | | | | | | | | | | | | | This way it's easier to show it on a website as it will be updated automatically along with the rest of the documentation. Sphinx doesn't render everything perfectly, but it looks good enough in both man and html versions. rST is a bit easier to read and it takes less space. Conversion performed manually since I didn't found any good tool that can actually make the process any faster. Along the way I replaced versions like x.y.90 with x.y+1, because it doesn't seem correct to me to refer non-released versions of OVS in the docs. Fixed a couple of small mistakes like duplicated paragraph and reference to a different section by incorrect name. Also removed bits of xml->nroff conversion code that is not needed anymore. Signed-off-by: Ilya Maximets <i.maximets@ovn.org> Acked-by: Roi Dayan <roid@nvidia.com>
* stream-ssl: Remove unsafe 1024 bit dh paramsJaime Caamaño Ruiz2021-07-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using 1024 bit params for DH is considered unsafe [1]. Additionally, from [2]: "Modern servers that do not support export ciphersuites are advised to either use SSL_CTX_set_tmp_dh() or alternatively, use the callback but ignore keylength and is_export and simply supply at least 2048-bit parameters in the callback." Additionally, using 1024 bit dh params may block clients running on recent openssl version from connecting given the stricter default security requirements of those new openssl versions. The error message for these clients looks like: error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small:ssl/statem/statem_clnt.c:2150 As a workaround, this error can be suppressed tweaking the cipher list (--ssl-ciphers) to either 'HIGH:!aNULL:!MD5:@SECLEVEL=1' to reduce security requirements or 'HIGH:!aNULL:!MD5:!DH' to avoid using fixed param DH based ciphers. The first option is recommended though as it likely a fixed param DH cipher is the best possible option in that situation. [1] https://weakdh.org/ [2] https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_tmp_dh_callback.html Signed-off-by: Jaime Caamaño Ruiz <jcaamano@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* dist-docs: Include manpages generated from rST.Ilya Maximets2021-02-041-1/+1
| | | | | | | | | Some manpages are generated from rST, but these are not included in 'dist-docs' make target. Fixes: fd0837a76f4c ("doc: Convert ovs-vlan-test to rST") Acked-by: Ben Pfaff <blp@ovn.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* Eliminate "whitelist" and "blacklist" terms.Ben Pfaff2020-10-163-1/+1
| | | | | | | | There is one remaining use under datapath. That change should happen upstream in Linux first according to our usual policy. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
* Require Python 3 and remove support for Python 2.Ben Pfaff2019-09-279-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Python 2 reaches end-of-life on January 1, 2020, which is only a few months away. This means that OVS needs to stop depending on in the next release that should occur roughly that same time. Therefore, this commit removes all support for Python 2. It also makes Python 3 a mandatory build dependency. Some of the interesting consequences: - HAVE_PYTHON, HAVE_PYTHON2, and HAVE_PYTHON3 conditionals have been removed, since we now know that Python3 is available. - $PYTHON and $PYTHON2 are removed, and $PYTHON3 is always available. - Many tests for Python 2 support have been removed, and the ones that depended on Python 3 now run unconditionally. This allowed several macros in the testsuite to be removed, making the code clearer. This does make some of the changes to the testsuite files large due to indentation level changes. - #! lines for Python now use /usr/bin/python3 instead of /usr/bin/python. - Packaging depends on Python 3 packages. Acked-by: Numan Siddique <nusiddiq@redhat.com> Tested-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Recommend Sphinx from Python 3 in documentation and packaging.Ben Pfaff2019-09-201-1/+1
| | | | | Acked-by: Numan Siddique <nusididq@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* dist-docs: Fix bugs in text to HTML conversion.Ben Pfaff2019-07-081-5/+23
| | | | | | | | | | | | | | This fixes two bugs. First, & has a special meaning in the replacement text for a sed "s" command, so this escapes it. Second, this code misprocessed bold or underlined &<>: >^H> would become &gt;^H&gt; which would display as &gt&gt; in most browers. Finally, this improves the HTML output so that bold ABC becomes <b>ABC</b> instead of <b>A</b><b>B</b><b>C</b>. Reported-by: Nicolas Bouliane <nbouliane@digitalocean.com> Reported-at: https://twitter.com/nicboul/status/1126959264772259842 Signed-off-by: Ben Pfaff <blp@ovn.org>
* extract-ofp-fields: Improve error message.Ben Pfaff2019-04-121-1/+3
| | | | | | | Without this change, it's not obvious what needs to be edited. Acked-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Makefiles: Generate datapath ovs key fields macrosEli Britstein2019-03-251-0/+60
| | | | | | | | | Generate datapath ovs key fields offset and size array macros as a pre-step for bit-wise comparing fields, with no functional change. Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Eli Britstein <elibr@mellanox.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Remove support for OpenFlow 1.6 (draft).Ben Pfaff2019-02-052-4/+2
| | | | | | | | | ONF abandoned the OpenFlow specification, so that OpenFlow 1.6 will never be completed. It did not contain much in the way of useful features, so remove what support Open vSwitch already had. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* Support for match & set ICMPv6 reserved and options type fieldsVishal Deep Ajmera2019-02-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Currently OVS supports all ARP protocol fields as OXM match fields to implement the relevant ARP procedures for IPv4. This includes support for matching copying and setting ARP fields. In IPv6 ARP has been replaced by ICMPv6 neighbor discovery (ND) procedures, neighbor advertisement and neighbor solicitation. The support for ICMPv6 fields in OVS is not complete for the use cases equivalent to ARP in IPv4. OVS lacks support for matching, copying and setting the “ND option type” and “ND reserved” fields. Without these user cannot implement all ICMPv6 ND procedures for IPv6 support. This commit adds additional OXM fields to OVS for ICMPv6 “ND option type“ and ICMPv6 “ND reserved” using the OXM extension mechanism. This allows support for parsing these fields from an ICMPv6 packet header and extending the OpenFlow protocol with specifications for these new OXM fields for matching, copying and setting. Signed-off-by: Vishal Deep Ajmera <vishal.deep.ajmera@ericsson.com> Co-authored-by: Ashvin Lakshmikantha <ashvin.lakshmikantha@ericsson.com> Signed-off-by: Ashvin Lakshmikantha <ashvin.lakshmikantha@ericsson.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-actions: New document describing OVS actions in detail.Ben Pfaff2019-01-101-17/+184
| | | | | Acked-by: Mark Michelson <mmichels@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* dhparams: Fix .c file generation with OpenSSL >= 1.1.1-pre9Timothy Redaelli2018-09-071-0/+1
| | | | | | | | | | | | | | | Since OpenSSL upstream commit 201b305a2409 ("apps/dsaparam.c generates code that is intended to be pasted or included into an existing source file: the function is static, and the code doesn't include dsa.h. Match the generated C source style of dsaparam.") "openssl dhparam -C" generates the get_dh functions as static, but the functions are used inside stream-ssl.c and so the static keyword cannot be used. This commit removes the static keyword from the get_dh functions during dhparams.c file generation by restoring the current behaviour. Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* sparse: Add support for DPDK.Ben Pfaff2018-07-241-0/+1
| | | | | | | This allows netdev-dpdk.c to compile cleanly with sparse. Signed-off-by: Ben Pfaff <blp@ovn.org> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
* build: Add gitattribute file to build-auxAlin Gabriel Serdean2018-07-191-0/+1
| | | | | | | | | | | | | | The command: `make check-tabs` fails on Windows due to line ending conversions caused by the following setting: `git config --global core.autocrlf true` (the whitelist `build-aux/initial-tab-whitelist` becomes a blacklist) This patch adds a .gittatribute file to build-aux to force LF endings on Windows. Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org> Co-authored-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Aaron Conole <aconole@redhat.com> Acked-by: Ben Pfaff <blp@ovn.org>
* extract-ofp-errors: Fix undefined behavior shifting 'int' 16 places left.Ben Pfaff2018-07-051-2/+2
| | | | | | | | | | Shifting a 16-bit signed int 16 bits is technically undefined behavior. This fixes the problem. (In practice this should be harmless in this case.) Reported-at; https://oss-fuzz.com/v2/testcase-detail/4730143510626304 Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* Makefile: Add build-time check for files with initial tabs.Ben Pfaff2018-06-112-0/+17
| | | | | | | This should make it harder to reintroduce inappropriate indentation. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* dhparams: Add pregenerated .c file to the repository.Eneas U de Queiroz2018-06-062-0/+33
| | | | | | | | | | | | | | | The version of dhparams.c generated by any given version of OpenSSL or LibreSSL might work only with that version of the library. This can be inconvenient for cross-compiling if the "openssl" program on the build machine has a different version from the library on the host where OVS will run, since it could generate code that won't compile. This commit fixes the problem by generating dhparams.c that works on the currently important versions of OpenSSL and LibreSSL. Submitted-at: https://github.com/openvswitch/ovs/pull/235 Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-fields: Correct ideas about which OXM classes are official.Ben Pfaff2018-05-251-15/+21
| | | | | | | | | | The purpose of including an OpenFlow version in the notes in meta-flow.h and ovs-fields.7 is to explain what version of OpenFlow standardized a given field. NXOXM_* are not standardized so they should not have an OpenFlow version. This commit corrects it. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* ovsdb-server: Add support for a built-in _Server database.Ben Pfaff2018-03-242-1/+27
| | | | | | | | | | | | | | | | | | | | | The _Server database is valuable primarily because it provides database clients a way to find out the details of changes to databases, schemas, etc. in a granular, natural way. Until now, the only way that the server could notify clients about these kinds of changes was to close the session; when the client reconnects, it is expected to reassess the server's state. One way to provide this kind of granular information would be to add specific JSON-RPC requests to obtain notifications for different kinds of changes, but since ovsdb-server already provides granular and flexible notification support for databases, using a database for the purpose is convenient and avoids duplicating functionality. Initially this database only reports databases' names and schemas, but when clustering support is added in a later commit it will also report important aspects of clustering and cluster status. Thus, this database also reduces the need to add JSON-RPC calls to retrieve information about new features. Signed-off-by: Ben Pfaff <blp@ovn.org>
* extract-ofp-errors: Minor improvements.Ben Pfaff2018-02-131-2/+2
| | | | | | | | | This removes the requirement of exactly two spaces before the error description (now one or more is fine). It also makes an error message clearer. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: William Tu <u9012063@gmail.com>
* tests: Convert sodepends build tool from Perl to Python.Ben Pfaff2017-11-263-70/+68
| | | | | | | | Perl is unfashionable and Python is more widely available and understood, so this commit converts one of the OVS uses of Perl into Python. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* tests: Convert soexpand build tool from Perl to Python.Ben Pfaff2017-11-263-41/+61
| | | | | | | | Perl is unfashionable and Python is more widely available and understood, so this commit converts one of the OVS uses of Perl into Python. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* tests: Convert dpdkstrip utility from Perl to Python.Ben Pfaff2017-11-263-36/+50
| | | | | | | | Perl is unfashionable and Python is more widely available and understood, so this commit converts one of the OVS uses of Perl into Python. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* dpdkstrip: add a preprocessor tool for stripping dpdk blocksaaron conole2017-08-081-0/+35
| | | | | | | | | | | | | | Normally, in C code, pre-processing macros can be used to enable/disable specific functionality based on switches passed to configure. This works for DPDK using the --with-dpdk flag, which sets the DPDK_NETDEV define to the appropriate value. However, not all files are processed with the C pre-processor. For those files which are not, this commit adds a new pre-processor tool for .in files to either include or exclude those stanzas as appropriate. Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Russell Bryant <russell@ovn.org>
* userspace: Add support for NSH MD1 match fieldsJan Scheurich2017-08-072-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for NSH packet header fields to the OVS control plane and the userspace datapath. Initially we support the fields of the NSH base header as defined in https://www.ietf.org/id/draft-ietf-sfc-nsh-13.txt and the fixed context headers specified for metadata format MD1. The variable length MD2 format is parsed but the TLV context headers are not yet available for matching. The NSH fields are modelled as experimenter fields with the dedicated experimenter class 0x005ad650 proposed for NSH in ONF. The following fields are defined: NXOXM code ofctl name Size Comment ===================================================================== NXOXM_NSH_FLAGS nsh_flags 8 Bits 2-9 of 1st NSH word (0x005ad650,1) NXOXM_NSH_MDTYPE nsh_mdtype 8 Bits 16-23 (0x005ad650,2) NXOXM_NSH_NEXTPROTO nsh_np 8 Bits 24-31 (0x005ad650,3) NXOXM_NSH_SPI nsh_spi 24 Bits 0-23 of 2nd NSH word (0x005ad650,4) NXOXM_NSH_SI nsh_si 8 Bits 24-31 (0x005ad650,5) NXOXM_NSH_C1 nsh_c1 32 Maskable, nsh_mdtype==1 (0x005ad650,6) NXOXM_NSH_C2 nsh_c2 32 Maskable, nsh_mdtype==1 (0x005ad650,7) NXOXM_NSH_C3 nsh_c3 32 Maskable, nsh_mdtype==1 (0x005ad650,8) NXOXM_NSH_C4 nsh_c4 32 Maskable, nsh_mdtype==1 (0x005ad650,9) Co-authored-by: Johnson Li <johnson.li@intel.com> Signed-off-by: Yi Yang <yi.y.yang@intel.com> Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Python3 compatibility: math error compatibilityJason Wessel2017-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way math is handled with typing is completely different in python3. % python2<<EOF x=10 y=8 print((x + (y - 1)) / y * y) EOF 16 python3<<EOF x=10 y=8 print((x + (y - 1)) / y * y) EOF 17.0 So we need to force an integer for the round function as follows and maintain compatibility with python2. python3<<EOF x=10 y=8 print(int((x + (y - 1)) / y) * y) EOF 16 Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Python3 compatibility: iteritems to itemsJason Wessel2017-07-063-3/+3
| | | | | | | | Allow compability with python3 and python2 by changing iteritems() to items(). Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Python3 compatibility: exception cleanupJason Wessel2017-07-061-1/+1
| | | | | | | | The exception syntax which is compatible with python2 and python3 is to use the "as" form for "except:". Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Python3 compatibility: Convert print statementsJason Wessel2017-07-065-41/+41
| | | | | | | | This patch fixes up all the print statements to work with python3 or python2. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* userspace: Add OXM field MFF_PACKET_TYPEJan Scheurich2017-06-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | 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>
* userspace: Switching of L3 packets in L2 pipelineJan Scheurich2017-06-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ports have a new layer3 attribute if they send/receive L3 packets. The packet_type included in structs dp_packet and flow is considered in ofproto-dpif. The classical L2 match fields (dl_src, dl_dst, dl_type, and vlan_tci, vlan_vid, vlan_pcp) now have Ethernet as pre-requisite. A dummy ethernet header is pushed to L3 packets received from L3 ports before the the pipeline processing starts. The ethernet header is popped before sending a packet to a L3 port. For datapath ports that can receive L2 or L3 packets, the packet_type becomes part of the flow key for datapath flows and is handled appropriately in dpif-netdev. In the 'else' branch in flow_put_on_pmd() function, the additional check flow_equal(&match.flow, &netdev_flow->flow) was removed, as a) the dpcls lookup is sufficient to uniquely identify a flow and b) it caused false negatives because the flow in netdev->flow may not properly masked. In dpif_netdev_flow_put() we now use the same method for constructing the netdev_flow_key as the one used when adding the flow to the dplcs to make sure these always match. The function netdev_flow_key_from_flow() used so far was not only inefficient but sometimes caused mismatches and subsequent flow update failures. The kernel datapath does not support the packet_type match field. Instead it encodes the packet type implictly by the presence or absence of the Ethernet attribute in the flow key and mask. This patch filters the PACKET_TYPE attribute out of netlink flow key and mask to be sent to the kernel datapath. Signed-off-by: Lorand Jakab <lojakab@cisco.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: Yi Yang <yi.y.yang@intel.com> Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com> Co-authored-by: Zoltan Balogh <zoltan.balogh@ericsson.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* extract-ofp-errors: Avoid unintentional sign extension in generated code.Ben Pfaff2017-06-011-2/+4
| | | | | | | | | | | | | | | | | | | | | | | Code generated by this program includes constructs like this: switch (((uint64_t) vendor << 32) | (type << 16) | code) with variables uint32_t vendor, uint16_t type, uint16_t code. By C rules, "type << 16" has type "int", which means that it will be sign-extended to 64 bits when ORed with uint64_t. Thus, if 'type' has bit 15 set, then the overall result will have all of its top 32 bits set, which is not the desired result. This commit fixes the problem. No actual error types used in OVS or OpenFlow have bit 15 set, so this does not fix a user-visible problem. Found by Coverity. Reported-at: https://scan3.coverity.com/reports.htm#v16889/p10449/fileInstanceId=14762955&defectInstanceId=4304798&mergedDefectId=180406 Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* build-windows: cccl fail compilation on Wimplicit-function-declarationAlin Serdean2017-05-251-0/+8
| | | | | | | | | | | | | | | | | | Gcc compiler argument -Wall contains -Wimplicit-function-declaration which gives warnings when a function is used before declared. Map VStudio compiler error C4013 to it. More info on C4013: https://msdn.microsoft.com/en-us/library/d3ct4kz9.aspx At the moment we cannot switch to the equivalent -Werror because we need to solve other warnings. As a temporary solution issue an error when this warning is triggered. This will help development on the Windows side. Suggested-by: Ben Pfaff <blp@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* config: Define OVS_CT_EVENT_* mask macros.Jarno Rajahalme2017-04-281-2/+17
| | | | | | | | | | | Unconditionally define OVS_CT_EVENT_* macros for the datapath netlink interface so that we do not need to include platform dependent files. This fixes the build on non-Linux (and non-Windows) platforms. Also define a macro for the default set of events set by OVS userspace. Reported-by: Joe Stringer <joe@ovn.org> Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* xlate: Use OVS_CT_ATTR_EVENTMASK.Jarno Rajahalme2017-04-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Specify the event mask with CT commit including bits for CT features exposed at the OVS interface (mark and label changes in addition to basic creation and destruction of conntrack entries). Without this any listener of conntrack update events will typically (depending on system configuration) receive events for each L4 (e.g., TCP) state machine change, which can multiply the number of events received per connection. By including the new, related, and destroy events any listener of new conntrack events gets notified of new related and non-related connections, and any listener of destroy events will get notified of deleted (typically timed out) conntrack entries. By including the flags for mark and labels, any listener of conntrack update events gets notified whenever the connmark or conntrack labels are changed from the values reported within the new events. VMware-BZ: #1837218 Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* types: New struct eth_addr64 for EUI-64 identifiers.Ben Pfaff2017-04-071-0/+1
| | | | | | | This will see its first real user in the following commit. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* check-structs: struct eth_addr has alignment 2, not 1.Ben Pfaff2017-04-061-1/+1
| | | | | | | | | It consists of ovs_be16 elements, so it has 16-bit alignment. (This doesn't make a difference for any actual OpenFlow protocol elements.) Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* meta-flow: Remove metadata prerequisite on ether type.Jarno Rajahalme2017-03-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conntrack original direction tuple fields depend on the conntrack state and the type of the packet that was tracked. These dependencies were encoded as OpenFlow prerequisites in commit daf4d3c18da4 ("odp: Support conntrack orig tuple key."). However, having a prerequisite from a metadata field to a packet header turned out to be problematic, since sometimes we are decoding metadata fields alone, so that the packet type field is not available. The reason for the packet type dependency is that the IP addresses in the original direction tuple can be either IPv4 or IPv6 addresses, and it would be invalid to match on IPv4 original direction tuple addresses for an IPv6 packet and vica verca. Upon closer look, however, allowing this kind of mismatched match only causes the flow to never match anything, rather than causing more severe problems. This patch removes the formal prerequisite on the packet type, but replaces that with an explicit check for the mismatch on flow install. This way we can still return an error to the controller if it tries to install a mismatched flow. Reported-by: Dong Jun <dongj@dtdream.com> Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-March/330052.html Fixes: 7befb20d0f70 ("nx-match: Fix oxm decode.") Fixes: daf4d3c18da4 ("odp: Support conntrack orig tuple key.") Suggested-by: Numan Siddique <nusiddiq@redhat.com> Suggested-by: Ben Pfaff <blp@ovn.org> Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Tested-by: Numan Siddique <nusiddiq@redhat.com> Acked-by: Numan Siddique <nusiddiq@redhat.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ofproto: Add ref counting for variable length mf_fields.Yi-Hung Wei2017-03-151-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | Currently, a controller may potentially trigger a segmentation fault if it accidentally removes a TLV mapping that is still used by an active flow. To resolve this issue, in this patch, we maintain reference counting for each dynamically allocated variable length mf_fields, so that vswitchd can use this information to properly remove a TLV mapping, and to return an error if the controller tries to remove a TLV mapping that is still used by any active flow. To keep track of the usage of tun_metadata for each flow, two 'uint64_t' bitmaps are introduce for the flow match and flow action respectively. We use 'uint64_t' as a bitmap since the 64 geneve TLV tunnel metadata are the only available variable length mf_fields for now. We shall adopt general bitmap when more variable length mf_fields are introduced. The bitmaps are configured during the flow decoding process, and vswitchd use these bitmaps to increase or decrease the ref counting when the flow is created or deleted. VMWare-BZ: #1768370 Fixes: 04f48a68c428 ("ofp-actions: Fix variable length meta-flow OXMs.") Suggested-by: Jarno Rajahalme <jarno@ovn.org> Suggested-by: Joe Stringer <joe@ovn.org> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Joe Stringer <joe@ovn.org>
* Revert "ovs-fields.7: Use a more general approach to groff encodings."Ben Pfaff2017-03-091-0/+8
| | | | | | | | This reverts commit 3e45560fb03b433c00117ae691027db61d37367d, which failed on Windows and Mac OS because they use antique pre-2009 versions of groff. Fixes: 3e45560fb03b ("ovs-fields.7: Use a more general approach to groff encodings.") Signed-off-by: Ben Pfaff <blp@ovn.org>
* odp: Support conntrack orig tuple key.Jarno Rajahalme2017-03-081-0/+3
| | | | | | Userspace support for datapath original direction conntrack tuple. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>