summaryrefslogtreecommitdiff
path: root/utilities
Commit message (Collapse)AuthorAgeFilesLines
* New action "ct_clear".Ben Pfaff2017-01-101-0/+6
| | | | | | | | | | | | | | This is being introduced specifically to allow a user of the "clone" action to clear the connection tracking state, but it's implemented as a separate action as a matter of clean design and in case another use case arises later. Reported-by: Mickey Spiegel <mickeys.dev@gmail.com> Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-January/326981.html Fixes: 7ae62a676d3a ("ofp-actions: Add clone action.") Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Mickey Spiegel <mickeys.dev@gmail.com> Tested-by: Dong Jun <dongj@dtdream.com>
* ofproto-dpif-xlate: Make "clone" save action set and stack.Ben Pfaff2017-01-101-1/+2
| | | | | | | | | | | | This is a design decision but it seems conceptually cleaner than having them leak through into the clone. Reported-by: Mickey Spiegel <mickeys.dev@gmail.com> Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-January/326981.html Fixes: 7ae62a676d3a ("ofp-actions: Add clone action.") Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Mickey Spiegel <mickeys.dev@gmail.com> Tested-by: Dong Jun <dongj@dtdream.com>
* ovs-ofctl: Document the "clone" action.Ben Pfaff2017-01-051-0/+8
| | | | | | | | This was overlooked when "clone" was introduced. Fixes: 7ae62a676d3a ("ofp-actions: Add clone action.") Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
* ovs-ofctl.8: Document automatic helper assignment.Joe Stringer2017-01-051-0/+10
| | | | | | | | | | | | Due to upstream Linux feature "automatic helper assignment", up until recently when using ct() action with FTP traffic, it has not been necessary to specify the ALG parameter. However, automatic helper assignment was disabled in Linux 4.7 or later, in upstream commit 3bb398d925ec ("netfilter: nf_ct_helper: disable automatic helper assignment"). Document the need for this. Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* ovs-sim: Quote "$@".Justin Pettit2017-01-051-1/+1
| | | | | | | Quote "$@" so that arguments aren't split when being called. Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ofproto: Fix crash on flow monitor request with tun_metadata.Daniele Di Proietto2017-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nx_put_match() needs a non-NULL tunnel metadata table, otherwise it will crash if a flow matches on tunnel metadata. This wasn't handled in ofputil_append_flow_update(), causing a crash when the controller sent a flow monitor request. To fix the problem, this commit changes ofputil_append_flow_update() to behave like ofputil_append_flow_stats_reply(). Since ofputil_append_flow_update() now needs to temporarily modify the match, this commits also embeds 'struct match' into 'struct ofputil_flow_update', to be safer. This is more similar to 'struct ofputil_flow_stats'. A regression test is added and a comment is updated in ovs-ofctl.c #0 0x000055699bd82fa0 in memcpy_from_metadata (dst=0x7ffc770930d0, src=0x7ffc77093698, loc=0x18) at ../lib/tun-metadata.c:451 #1 0x000055699bd83c2e in metadata_loc_from_match_read (map=0x0, match=0x7ffc77093410, idx=0, mask=0x7ffc77093658, is_masked=0x7ffc77093287) at ../lib/tun-metadata.c:848 #2 0x000055699bd83d9b in tun_metadata_to_nx_match (b=0x55699d3f0300, oxm=0, match=0x7ffc77093410) at ../lib/tun-metadata.c:871 #3 0x000055699bce523d in nx_put_raw (b=0x55699d3f0300, oxm=0, match=0x7ffc77093410, cookie=0, cookie_mask=0) at ../lib/nx-match.c:1052 #4 0x000055699bce5580 in nx_put_match (b=0x55699d3f0300, match=0x7ffc77093410, cookie=0, cookie_mask=0) at ../lib/nx-match.c:1116 #5 0x000055699bd3926f in ofputil_append_flow_update (update=0x7ffc770940b0, replies=0x7ffc77094e00) at ../lib/ofp-util.c:6805 #6 0x000055699bc4b5a9 in ofproto_compose_flow_refresh_update (rule=0x55699d405b40, flags=(NXFMF_INITIAL | NXFMF_ACTIONS), msgs=0x7ffc77094e00) at ../ofproto/ofproto.c:5915 #7 0x000055699bc4b5f6 in ofmonitor_compose_refresh_updates (rules=0x7ffc77094e10, msgs=0x7ffc77094e00) at ../ofproto/ofproto.c:5929 #8 0x000055699bc4bafc in handle_flow_monitor_request (ofconn=0x55699d404090, oh=0x55699d404220) at ../ofproto/ofproto.c:6082 #9 0x000055699bc4f46d in handle_openflow__ (ofconn=0x55699d404090, msg=0x55699d404910) at ../ofproto/ofproto.c:7912 #10 0x000055699bc4f5df in handle_openflow (ofconn=0x55699d404090, ofp_msg=0x55699d404910) at ../ofproto/ofproto.c:8002 #11 0x000055699bc88154 in ofconn_run (ofconn=0x55699d404090, handle_openflow=0x55699bc4f5bc <handle_openflow>) at ../ofproto/connmgr.c:1427 #12 0x000055699bc85934 in connmgr_run (mgr=0x55699d3adb90, handle_openflow=0x55699bc4f5bc <handle_openflow>) at ../ofproto/connmgr.c:363 #13 0x000055699bc422c9 in ofproto_run (p=0x55699d3c85e0) at ../ofproto/ofproto.c:1798 #14 0x000055699bc31ec6 in bridge_run__ () at ../vswitchd/bridge.c:2881 #15 0x000055699bc320a6 in bridge_run () at ../vswitchd/bridge.c:2938 #16 0x000055699bc3784e in main (argc=10, argv=0x7ffc770952c8) at ../vswitchd/ovs-vswitchd.c:111 Fixes: 8d8ab6c2d574 ("tun-metadata: Manage tunnel TLV mapping table on a per-bridge basis.") Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ofp-parse: Allow match field names in actions and brackets in matches.Jarno Rajahalme2017-01-041-19/+26
| | | | | | | | | | | | | | | | | | | | | | | | Allow using match field names in addition to the canonical register names in actions (including 'load', 'move', 'push', 'pop', 'output', 'multipath', 'bundle_load', and 'learn'). Allow also leaving out the trailing '[]' to indicate full field. These changes allow simpler syntax similar to 'set_field' to be used also elsewhere. Correspondingly, allow the '[start..end]' syntax to be used in matches in addition to the more explicit 'value/mask' notation. For example, to match on the value 2 of the bits 14..15 of NXM_NX_REG0, the match could include: ... reg0[14..15]=2 ... instead of ... reg0=0x8000/0xc000 ... Note that only contiguous masks can be specified with the bracket notation. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* lib: Add support for tftp ct helper.Joe Stringer2017-01-031-4/+11
| | | | | | | | | The kernel datapath provides support for TFTP helpers, so add support for this ALG to the commandline and OpenFlow encoding/decoding. Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ovn-trace: New --ovs option to also print OpenFlow flows.Ben Pfaff2016-12-281-119/+33
| | | | | | | | | | | Sometimes seeing the OpenFlow flows that back a given logical flow can provide additional insight. This commit adds a new --ovs option to ovn-trace that makes it connect to Open vSwitch over OpenFlow and retrieve and print the OpenFlow flows behind each logical flow encountered during a trace. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* table: correct documented default format in man pagesLance Richardson2016-12-221-1/+0
| | | | | | | | | | | | | | | | | There are currently five users of the table formatting library, all of which default to "list" except for ovsdb-client which defaults to "table". The library current default is "table", and the table.man man page fragment only considers ovs-vsctl to use something other than "table" as a default.As a result, the man pages for ovn-sbctl and vtep-ctl are currently incorrect (these options aren't documented in the ovn-nbctl man page, which will need to be addressed in a future patch). Fix by making the library default format "list" and handling ovsdb-client as the exception. Signed-off-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-vsctl: Print error when add-port fails.Daniele Di Proietto2016-12-211-8/+15
| | | | | | | | | | | | | | | | | | | When the add-port command fails, vsctl reports the failure and just suggests to check the logs for more details. ovs-vswitchd fills the error column in the Interface table with a description of the error, so it might be helpful to print that. This is useful especially for dpdk devices, because the port naming change could use a better error reporting. I'm planning another patch to make sure that ovs-vswitch writes appropriates information in the error column, after the dpdk port naming changes are merged. CC: Ben Pfaff <blp@ovn.org> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org>
* doc: Move WHY-OVSStephen Finucane2016-12-122-3/+3
| | | | | | | | This is moved separately due to the sheer number of references to this file in the codebase. Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Ben Pfaff <blp@ovn.org>
* doc: Populate 'topics' sectionStephen Finucane2016-12-121-1/+1
| | | | | | | | | | | There are many docs that don't need to kept at the top level, along with many more hidden in random folders. Move them all. This also allows us to add the '-W' flag to Sphinx, ensuring unindexed docs result in build failures. Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Ben Pfaff <blp@ovn.org>
* doc: Further populate the 'howto' sectionStephen Finucane2016-12-121-3/+3
| | | | | | | | | There are a couple of references to these for various build systems. The website is going to be our "one true resource" for all docs, so simply remove these references. Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Ben Pfaff <blp@ovn.org>
* doc: Populate 'install', 'howto' sectionsStephen Finucane2016-12-124-118/+4
| | | | | | | | | This is a dumb move of all 'INSTALL*' docs, with very little refactoring (mostly updating links and making the titles a little more consistent. Additional refactoring will be done in subsequent changes. Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Ben Pfaff <blp@ovn.org>
* treewide: Fix recent flake8-check.Joe Stringer2016-12-082-0/+4
| | | | | | | | | Without this patch, I see errors like this on master: ../ofproto/ipfix-gen-entities:115:1: E305 expected 2 blank lines after class or function definition, found 1 Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
* python: Add double newline after fuction or class (E305).Daniele Di Proietto2016-12-022-0/+21
| | | | | | | | pycodestyle >= 2.1.0 reports E305 otherwise, and the flake8-check step fails. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org>
* trivial: Don't mix tabs and spaces in ovs-simStephen Finucane2016-11-301-50/+50
| | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Russell Bryant <russell@ovn.org>
* ofp-actions: Add "ingress" and "egress" options to "sample" action.Ben Pfaff2016-11-301-5/+13
| | | | | | | | | | | | | | | | | | | | Before Open vSwitch 2.5.90, IPFIX reports from Open vSwitch didn't include whether the packet was ingressing or egressing the switch. Starting in OVS 2.5.90, this information was available but only accurate if the action included a port number that indicated a tunnel. Conflating these two does not always make sense (not every packet involves a tunnel!), so this patch makes it possible for the sample action to simply say whether it's for ingress or egress. This is difficult to test, since the "tests" directory of OVS does not have a proper IPFIX listener. This passes those tests, plus a couple that just verify that the actions are properly parsed and formatted. Benli did test it end-to-end in a VMware use case. Requested-by: Benli Ye <daniely@vmware.com> Tested-by: Benli Ye <daniely@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Simon Horman <simon.horman@netronome.com>
* checkpatch: Add file-parsing modeAaron Conole2016-11-281-9/+30
| | | | | | | | This adds a new argument and feature, 'check-file', which will allow checkpatch to run against files instead of only against patches. Signed-off-by: Aaron Conole <aconole@bytheb.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* checkpatch: fix the if and whitespace checksAaron Conole2016-11-281-5/+6
| | | | | | | | | | | | | | | | | The regex for the if/for/while bracket tests fails to distinguish non-space text. This means text such as do_something_if() would match incorrectly. Additionally, the ends-with-bracket test doesn't allow for the common coding paradigm: if (condition) { /* Text about conditional. */ } So fix that as well. Signed-off-by: Aaron Conole <aconole@bytheb.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* checkpatch: Fix signoff errorAaron Conole2016-11-281-1/+1
| | | | | | | | | | | | | When no 'Signed-off-by' tags are found, the output will look like: E: No signatures found. E: Too many signoffs; are you missing Co-authored-by lines? Warnings: 0, Errors: 2 However, there should really only be one error reported in this case. Signed-off-by: Aaron Conole <aconole@bytheb.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* checkpatch: Print file line numbersAaron Conole2016-11-281-0/+15
| | | | | | | | | | | | | | The line numbers being printed were the line numbers for the patchfile. This is sometimes okay to fix simple things (trailing or leading whitespace, missing signoffs, etc). But more complicated fixes, or those fixes which require a bit more care, aren't helped by this. So, we use the implied file line number. This can be useful with future work to 'mock' apply and build a real contextual scanner for checking multi-line changes. Signed-off-by: Aaron Conole <aconole@bytheb.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* checkpatch: convert some of the warningsAaron Conole2016-11-281-5/+4
| | | | | | | | These coding issues are not just things that shouldn't be done. They are styles which should never be submitted. Signed-off-by: Aaron Conole <aconole@bytheb.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* checkpatch: Print the line in question distinctlyAaron Conole2016-11-281-1/+5
| | | | | | | | This makes it easier to distinguish between the line, and the warning/error message. Signed-off-by: Aaron Conole <aconole@bytheb.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* checkpatch: Announce the file where errors occurAaron Conole2016-11-281-0/+13
| | | | | | | This makes finding the warning and error marks much easier. Signed-off-by: Aaron Conole <aconole@bytheb.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* utilities: Use FQDN for external_ids:hostname in Openvswitch tableBabu Shanmugam2016-11-261-1/+1
| | | | | | | | | | | Openstack compute manager uses FQDN to check for the hypervisors to which the ports are bound. Without this fix, no instances can be launched as the hypervisor's hostname mismatches. Signed-off-by: Babu Shanmugam <bschanmu@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-tcpdump: Do not import unused "select" module.Ben Pfaff2016-11-231-1/+0
| | | | | | | | Fixes the following flake8 warning: utilities/ovs-tcpdump.in:21:1: F401 'select' imported but unused Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* ovs-tcpdump: Fix error handling when parsing parameter.nickcooper-zhangtonghao2016-11-221-1/+3
| | | | | | Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* ovs-tcpdump: destroy_mirror should really destroy the mirror.nickcooper-zhangtonghao2016-11-221-2/+3
| | | | | | Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* ovs-tcpdump: should't halt when dumping traffic.nickcooper-zhangtonghao2016-11-221-3/+0
| | | | | | | | | when sys.stdin is passed to tcpdump via pipe, it will cause tcpdump to halt. Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* ovs-tcpdump: Remove the newline from readline().nickcooper-zhangtonghao2016-11-221-1/+1
| | | | | | | | | | When using ovs-tcpdump, we always get the white line. Remove newline from readline() and ovs-tcpdump will format the output as tcpdump tool. Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* ovs-ofctl: Fix memory leak in bundle_print_errors().Yi-Hung Wei2016-11-221-0/+1
| | | | | | | | | | | | | | | | | | | | In testcase "ofproto - bundle group mod with mod and add_or_mod command", valgrind reports a memory leak with the following call stack. xmalloc (util.c:112) ofpbuf_resize__ (ofpbuf.c:246) ofpbuf_push_uninit (ofpbuf.c:436) ofpbuf_push (ofpbuf.c:459) ofperr_decode_msg (ofp-errors.c:332) bundle_print_errors (ovs-ofctl.c:692) bundle_transact.constprop.25 (ovs-ofctl.c:728) bundle_group_mod__ (ovs-ofctl.c:2663) ofctl_group_mod__ (ovs-ofctl.c:2681) ofctl_group_mod (ovs-ofctl.c:2736) ovs_cmdl_run_command__ (command-line.c:115) main (ovs-ofctl.c:151) Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-ofctl: Fix memory leak in ofctl_packet_out().Yi-Hung Wei2016-11-221-0/+1
| | | | | | | | | | | | | | | | | | | In testcase "bfd - bfd decay", valgrind reports a memory leak with the following call stack. xmalloc (util.c:112) vconn_stream_new (vconn-stream.c:60) vconn_stream_open (vconn-stream.c:85) vconn_open (vconn.c:248) open_vconn_socket (ovs-ofctl.c:517) open_vconn__ (ovs-ofctl.c:553) open_vconn (ovs-ofctl.c:587) open_vconn_for_flow_mod (ovs-ofctl.c:1416) ofctl_packet_out (ovs-ofctl.c:2148) ovs_cmdl_run_command__ (command-line.c:115) main (ovs-ofctl.c:151) Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Add support for specifying SSL connection parameters to ovsdbEthan Rahn2016-11-103-3/+6
| | | | | Signed-off-by: Ethan Rahn <erahn@arista.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* doc: Remove final markdown referencesStephen Finucane2016-11-071-1/+1
| | | | | | | | | 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>
* doc: Convert ovs-command-bashcomp.INSTALL to rSTStephen Finucane2016-11-033-90/+113
| | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Russell Bryant <russell@ovn.org>
* doc: Convert README-native-tunneling to rSTStephen Finucane2016-10-281-1/+1
| | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Russell Bryant <russell@ovn.org>
* doc: Convert WHY-OVS to rSTStephen Finucane2016-10-262-3/+3
| | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Russell Bryant <russell@ovn.org>
* doc: Convert README to rSTStephen Finucane2016-10-211-1/+1
| | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Russell Bryant <russell@ovn.org>
* ovsdb-idlc: Eliminate <prefix>_init() function from generated code.Ben Pfaff2016-10-191-1/+0
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* ovs-ctl: Handle start up errors.Markos Chandras2016-10-041-8/+11
| | | | | | | | | | Make sure we take the return values into consideration so we can break early in case of failures. This makes the ovs-ctl helper more accurate in reporting the real status of its managing processes. Signed-off-by: Markos Chandras <mchandras@suse.de> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* ovs-lib: Signal start_daemon failures.Markos Chandras2016-10-041-1/+1
| | | | | | | | | Make sure we communicate failures to the caller when start_daemon fails to start a process as the caller may not be able to proceed after this. Signed-off-by: Markos Chandras <mchandras@suse.de> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* openvswitch: Allow external IPsec tunnel management.Pravin B Shelar2016-09-272-3/+3
| | | | | | | | | | | | | | | | | | OVS GRE IPsec tunnel support has multiple issues, Therefore it was deprecated in OVS 2.6. Following patch removes support for GRE IPsec and allows external IPsec tunnel management for any type of tunnel not just GRE. e.g. user can encrypt Geneve or VxLan traffic. It can be done by using openflow pipeline to set skb-mark and using IPsec keying daemons to implement IPsec tunnels. This packet can be matched for the skb-mark to encrypt selective tunnel traffic. VMware-BZ: 1710701 Signed-off-by: Pravin B Shelar <pshelar@ovn.org> Acked-by: Ansis Atteka <aatteka@ovn.org>
* Add OpenFlow command to flush conntrack table entries.Justin Pettit2016-09-232-0/+31
| | | | | Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovs-lib: Fix SELinux contexts for created dirs.Joe Stringer2016-09-231-4/+12
| | | | | | | | | | | | | | | | | | | | | | | ovs-lib creates several directories directly from the script, but doesn't make any attempt to ensure that the correct SELinux context is applied to these directories. As a result, the created directories end up with type var_run_t rather than openvswitch_var_run_t. During reboot using a tmpfs for /var/run, startup scripts will invoke ovs-lib to create these directories with the wrong context. If SELinux is enabled, OVS will fail to start as it cannot write to this directory. Fix the issue by sprinkling "restorecon" in each of the places where directories are created. In practice, many of these should otherwise be handled by packaging scripts but if they exist then we should ensure the correct SELinux context is set. On systems where 'restorecon' is unavailable, this should be a no-op. VMware-BZ: #1732672 Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Ansis Atteka <aatteka@ovn.org>
* tun-metadata: Manage tunnel TLV mapping table on a per-bridge basis.Jesse Gross2016-09-192-37/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using tunnel TLVs (at the moment, this means Geneve options), a controller must first map the class and type onto an appropriate OXM field so that it can be used in OVS flow operations. This table is managed using OpenFlow extensions. The original code that added support for TLVs made the mapping table global as a simplification. However, this is not really logically correct as the OpenFlow management commands are operating on a per-bridge basis. This removes the original limitation to make the table per-bridge. One nice result of this change is that it is generally clearer whether the tunnel metadata is in datapath or OpenFlow format. Rather than allowing ad-hoc format changes and trying to handle both formats in the tunnel metadata functions, the format is more clearly separated by function. Datapaths (both kernel and userspace) use datapath format and it is not changed during the upcall process. At the beginning of action translation, tunnel metadata is converted to OpenFlow format and flows and wildcards are translated back at the end of the process. As an additional benefit, this change improves performance in some flow setup situations by keeping the tunnel metadata in the original packet format in more cases. This helps when copies need to be made as the amount of data touched is only what is present in the packet rather than the maximum amount of metadata supported. Co-authored-by: Madhu Challa <challa@noironetworks.com> Signed-off-by: Madhu Challa <challa@noironetworks.com> Signed-off-by: Jesse Gross <jesse@kernel.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovs-ofctl.8.in: Fix minor formatting issues.Justin Pettit2016-09-191-3/+3
| | | | | Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* xlate: Use dp_hash for select groups.Jarno Rajahalme2016-09-161-3/+35
| | | | | | | | | | | Add a new select group selection method "dp_hash", which uses minimal number of bits from the datapath calculated packet hash to inform the select group bucket selection. This makes the datapath flows more generic resulting in less upcalls to userspace, but adds recirculation prior to group selection. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ofp-parse: Harden checking with group selection_method.Jarno Rajahalme2016-09-161-8/+8
| | | | | | | | Only allow fields when "selection_method=hash". Only allow selection_method_param when a non-nil selection_method is given. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>