summaryrefslogtreecommitdiff
path: root/build-aux
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* ovs-fields.7: Use a more general approach to groff encodings.Ben Pfaff2017-03-081-8/+0
| | | | | | | | It turns out that, since groff 1.20 around 2009, groff comes with a preprocessor named "preconv" that can fix encoding issues. Use it instead of the existing hack. Signed-off-by: Ben Pfaff <blp@ovn.org>
* meta-flow: Remove cmap dependency.Yi-Hung Wei2017-02-211-1/+1
| | | | | | | | | | | | | | Previous patch 04f48a68 ("ofp-actions: Fix variable length meta-flow OXMs.") introduced dependency of an internal library (cmap.h) to ovs public interface (meta-flow.h) that may cause potential building problem. In this patch, we remove cmap from struct mf_field, and provide a wrapper struct vl_mff_map that resolve the dependency problem. Fixes: 04f48a68c428 ("ofp-actions: Fix variable length meta-flow OXMs.") Suggested-by: Joe Stringer <joe@ovn.org> Suggested-by: Daniele Di Proietto <diproiettod@vmware.com> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Joe Stringer <joe@ovn.org>
* ofp-actions: Fix variable length meta-flow OXMs.Yi-Hung Wei2017-02-012-17/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if a flow action that involves a tunnel metadata meta-flow field is dumped from vswitchd, the replied field length in the OXM header is filled with the maximum possible field length, instead of the length configured in the tunnel TLV mapping table. To solve this issue, this patch introduces the following changes. In order to maintain the correct length of variable length mf_fields (i.e. tun_metadata), this patch creates a per-switch based map (struct vl_mff_map) that hosts the variable length mf_fields. This map is updated when a controller adds/deletes tlv-mapping entries to/from a switch. Although the per-swtch based vl_mff_map only hosts tun_metadata for now, it is able to support new variable length mf_fields in the future. With this commit, when a switch decodes a flow action with mf_field, the switch firstly looks up the global mf_fields map to identify the mf_field type. For the variable length mf_fields, the switch uses the vl_mff_map to get the configured mf_field entries. By lookig up vl_mff_map, the switch can check if the added flow action access beyond the configured size of a variable length mf_field, and the switch reports an ofperr if the controller adds a flow with unmapped variable length mf_field. Later on, when a controller request flows from the switch, with the per-switch based mf_fields, the switch will encode the OXM header with correct length for variable length mf_fields. To use the vl_mff_map for decoding flow actions, extract-ofp-actions is updated to pass the vl_mff_map to the required action decoding functions. Also, a new error code is introduced to identify a flow with an invalid variable length mf_field. Moreover, a testcase is added to prevent future regressions. Committer notes: - Factor out common code - Style fixups - Rename OFPERR_NXFMFC_INVALID_VL_MFF -> OFPERR_NXFMFC_INVALID_TLV_FIELD VMWare-BZ: #1768370 Reported-by: Harold Lim <haroldl@vmware.com> Suggested-by: Joe Stringer <joe@ovn.org> Suggested-by: Jarno Rajahalme <jarno@ovn.org> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Joe Stringer <joe@ovn.org>
* extract-ofp-fields: Define .TQ directive in nroff output.Ben Pfaff2017-01-251-0/+6
| | | | | | | | | | This missing directive caused groff warnings and probably some erroneous output too. Fixes: 96fee5e0a2a0 ("ovs-fields: New manpage to document Open vSwitch and OpenFlow fields.") Reported-by: Daniele Di Proietto <diproiettod@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Daniele Di Proietto <diproiettod@ovn.org>
* ovs-fields: Eliminate non-ASCII characters from groff input.Ben Pfaff2017-01-251-0/+2
| | | | | | | | | | It's difficult to make groff portably accept non-ASCII characters. It's easier to replace them by groff escapes for the same characters, which this commit does. Fixes: 96fee5e0a2a0 ("ovs-fields: New manpage to document Open vSwitch and OpenFlow fields.") Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
* ovs-fields: New manpage to document Open vSwitch and OpenFlow fields.Ben Pfaff2017-01-251-41/+324
| | | | | | | | | There is still plenty of opportunity for improvement, but this new ovs-fields(7) manpage is much more comprehensive than ovs-ofctl(8) could be. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* xml2nroff: Port to python3.Joe Stringer2017-01-062-7/+10
| | | | | Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* odp: Use struct in6_addr for IPv6 addresses.Jarno Rajahalme2017-01-041-1/+5
| | | | | | | | | Code is simplified when the ODP keys use the same type as the struct flow for the IPv6 addresses. As the change is facilitated by extract-odp-netlink-h, this change only affects the userspace. We already do the same for the ethernet addresses. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* dist-docs: Make "make dist-docs" work again.Ben Pfaff2016-12-131-2/+2
| | | | | | | | CC: Stephen Finucane <stephen@that.guru> Fixes: c431227e3350 ("doc: Remove documentation from distdoc target") Reported-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Lance Richardson <lrichard@redhat.com>
* doc: Remove documentation from distdoc targetStephen Finucane2016-12-121-49/+1
| | | | | | | | Basic Sphinx integration is now complete. Remove the documentation aspects of the 'dist-docs' target in favor of the htmldocs target. Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Ben Pfaff <blp@ovn.org>
* doc: Remove final markdown referencesStephen Finucane2016-11-071-24/+2
| | | | | | | | | There are some leftover Markdown references and Markdown-related tooling. Seeing as there are no Markdown files left, we can kill it all with fire. Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Russell Bryant <russell@ovn.org>
* dist-docs: Add support for rSTStephen Finucane2016-10-181-3/+20
| | | | | | | | | | | | This will eventually go away once Sphinx starts doing all this work for us. For now, however, let's make sure we don't break the OVS website. This introduces a new dependency for the dist-docs script - 'rst2html'. This tool is packaged on Ubuntu, Fedora (via 'python-docutils'), etc. and can be installed from pip using the 'docsutils' package. Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Russell Bryant <russell@ovn.org>
* Windows: Add conntrack netfilter netlink definitions to kernel and userspaceSairam Venugopal2016-07-011-0/+1
| | | | | | | | | | | | Include netfilter-conntrack header definitions. This will be used by Windows userspace for adding debugging support in Conntrack. Few of these files are intentionally left blank to avoid removing #includes in userspace. New file - OvsDpInterfaceCtExt.h has been defined similar to OvsDpInterfaceExt.h to be reused by userspace and kernel. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* cksum: Refine schema cksum validationRodriguez Betancourt, Esteban2016-04-222-1/+6
| | | | | | | | | | | | | | | | | Calculates the cksum removing the cksum line using a more strict regex than the used previously. It fixes a problem when calculating the cksum of a schema that has fields with the substring cksum (e.g.: a checksum column), lines that the previous cksum calculation incorrectly removes before running cksum. Also, the tool calculate-schema-cksum is introduced. This tool calculates the cksum of a schema file. It could be used in other programs, instead of calculating the cksum in an eventually different way than the expected by cksum-schema-check and other tools. Signed-off-by: Esteban Rodriguez Betancourt <estebarb@hpe.com> Signed-off-by: Ben Pfaff <blp@ovn.org>