summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-dpif-trace.c
Commit message (Collapse)AuthorAgeFilesLines
* xlate: auto ofproto trace when recursion too deepWilliam Tu2018-03-051-6/+1
| | | | | | | | | | | | | | Usually ofproto/trace is used to debug the flow translation error. When translation error such as recursion too deep or too many resubmit, the issue might happen momentary; flows causing the recursion expire when users try to debug it. This patch enables the ofproto trace automatically when recursion is too deep or too many resubmit, by invoking the translation again, and log the ofproto trace as warnings. Since the log will be huge, rate limit to one per minute. VMWare-BZ: #2054659 Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofp-util, ofp-parse: Break up into many separate modules.Ben Pfaff2018-02-131-1/+0
| | | | | | | | | | | | ofp-util had been far too large and monolithic for a long time. This commit breaks it up into units that make some logical sense. It also moves the pieces of ofp-parse that were specific to each unit into the relevant unit. Most of this commit is just moving code around. Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
* ofp-actions: Make formatting and parsing functions take a struct argument.Ben Pfaff2018-01-311-2/+6
| | | | | | | | | | An upcoming commit will add another parameter for parsing and formatting actions. It is much easier to add these parameters if they are encapsulated in a struct, so this commit first makes that change. Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com> Acked-by: Mark Michelson <mmichels@redhat.com>
* flow: Add some L7 payload data to most L4 protocols that accept it.Ben Pfaff2018-01-271-1/+33
| | | | | | | | | | | | | | This makes traffic generated by flow_compose() look slightly more realistic. It requires lots of updates to tests, but at least the tests themselves should be slightly more realistic too. At the same time, add --l7 and --l7-len options to ofproto/trace to allow users to specify the amount or contents of payloads that they want. Suggested-by: Brad Cowie <brad@cowie.nz> Signed-off-by: Ben Pfaff <blp@ovn.org> Tested-by: Yifeng Sun <pkusunyifeng@gmail.com> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
* ofproto-dpif-trace: Generalize syntax for ofproto/trace.Ben Pfaff2018-01-261-97/+97
| | | | | | | | | | | | | | ofproto/trace takes a bunch of options that have weird placement and syntax. This commit changes the syntax so that the options can be placed anywhere and consistently use a double-dash option prefix. For compatibility, the previous syntax is also supported. An upcoming commit will add new options and this change allows that upcoming commit to be less confusing. Signed-off-by: Ben Pfaff <blp@ovn.org> Tested-by: Yifeng Sun <pkusunyifeng@gmail.com> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
* ofproto-dpif: Add ability to look up an ofproto by UUID.Justin Pettit2018-01-101-1/+1
| | | | | | | This will have callers in the future. Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ofproto/trace: Fix memory leak in oftrace_push_ct_state()Yi-Hung Wei2017-11-021-1/+3
| | | | | | | | Free the allocated memory in the pop function. Fixes: 0f2f05bbcf743 ("ofproto/trace: Add --ct-next option to ofproto/trace") Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofproto/trace: Propagate ct_zone in recirculationYi-Hung Wei2017-10-311-1/+3
| | | | | | | | | | This patch propagates ct_zone when ofproto/trace automatically runs through the recirculation process. Fixes: e6bc8e749381 ("ofproto/trace: Add support for tracing conntrack recirculation") Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Greg Rose <gvrose8192@gmail.com>
* flow: Refactor flow_compose() API.Andy Zhou2017-07-271-1/+1
| | | | | | | | | | | | | | Currently, flow_compose_size() is only supposed to be called after flow_compose(). I find this API to be unintuitive. Change flow_compose() API to take the 'size' argument, and returns 'true' if the packet can be created, 'false' otherwise. This change also improves error detection and reporting when 'size' is unreasonably small. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Ilya Maximets <i.maximets@samsung.com>
* ofproto/trace: Add --ct-next option to ofproto/traceYi-Hung Wei2017-07-121-15/+115
| | | | | | | | | | | Previous patch enables ofproto/trace to automatically trace a flow that involves multiple recirculation on conntrack. However, it always sets the ct_state to trk|est when it processes recirculated conntrack flows. With this patch, users can customize the expected next ct_state in the aforementioned use case. Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofproto/trace: Add support for tracing conntrack recirculationYi-Hung Wei2017-07-121-14/+77
| | | | | | | | | | | | | | Previously, a user need to run ofproto/trace multiple times to derive the final datapath actions if a flow hit conntrack actions that involves recirculation. To improve the usability of ofproto/trace, in this patch, we keep track of the conntrack actions, and automatically run the recirculation process so that a user only need to execute the ofproto/trace command once. Currently, this patch sets the default ct_state as trk and new in the automatic recirculation process. A following patch will provide an option to customize ct_state. Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* odp-util: Use port names in output in more places.Ben Pfaff2017-06-231-1/+1
| | | | | | | | | Until now, ODP output only showed port names for in_port matches. This commit shows them in other places port numbers appear. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jan Scheurich <jan.scheurich@ericsson.com> Tested-by: Jan Scheurich <jan.scheurich@ericsson.com>
* Support accepting and displaying port names in OVS tools.Ben Pfaff2017-05-311-5/+13
| | | | | | | | | | | | | | Until now, most ovs-ofctl commands have not accepted names for ports, only numbers, and have not been able to display port names either. It's a lot easier for users if they can use and see meaningful names instead of arbitrary numbers. This commit adds that support. For backward compatibility, only interactive ovs-ofctl commands by default display port names; to display them in scripts, use the new --names option. Signed-off-by: Ben Pfaff <blp@ovn.org> Tested-by: Aaron Conole <aconole@redhat.com>
* lib: Check match and action prerequisities with 'match'.Jarno Rajahalme2017-03-081-6/+7
| | | | | | | | | | | | | | | Supply the match mask to prerequisities checking when available. This allows checking for zero-valued matches. Non-zero valued matches imply the presense of corresponding mask bits, but for zero valued matches we must explicitly check the mask, too. This is required now only for conntrack validity checking due to the conntrack state having and 'invalid' bit, but not 'valid' bit. One way to match an valid conntrack state is to match on the 'tracked' bit being one and 'invalid' bit being zero. The latter requires the corresponding mask bit be verified. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* ofproto: Fix thread safety annotation.Jarno Rajahalme2017-03-081-0/+2
| | | | | | | | ofproto_check_ofpacts() requires ofproto_mutex, but the header did not tell that so the trace did not take the mutex. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Signed-off-by: Andy Zhou <azhou@ovn.org>
* ofproto-dpif: Make ofproto/trace output easier to read.Ben Pfaff2017-01-121-167/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | "ovs-appctl ofproto/trace" is invaluable for debugging, but as the users of Open vSwitch have evolved it has failed to keep up with the times. It's pretty easy to design OpenFlow tables and pipelines that resubmit dozens of times. Each resubmit causes an additional tab of indentation, so the output wraps around, sometimes again and again, and makes the output close to unreadable. ovn-trace pioneered better formatting for tracing in OVN logical datapaths, mostly by not increasing indentation for tail recursion, which in practice gets rid of almost all indentation. This commit experiments with redoing ofproto/trace the same way. Try looking at, for example, the testsuite output for test 2282 "ovn -- 3 HVs, 3 LRs connected via LS, source IP based routes". Without this commit, it indents 61 levels (488 spaces!). With this commit, it indents 1 level (4 spaces) and it's possible to actually understand what's going on almost at a glance. To see this for yourself, try the following command either with or without this commit (but be sure to keep the change to ovn.at that adds an ofproto/trace to the test): make check TESTSUITEFLAGS='-d 2282' && less tests/testsuite.dir/2282/testsuite.log Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Lance Richardson <lrichard@redhat.com> Acked-by: Justin Pettit <jpettit@ovn.org>
* ofproto-dpif: Break trace functionality into a separate source file.Ben Pfaff2017-01-051-0/+555
An upcoming commit will rewrite much of the ofproto/trace functionality. As the mechanism behind this grows and evolves, it makes sense to move it into its own file, especially since ofproto-dpif.c is too big anyway. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Lance Richardson <lrichard@redhat.com> Acked-by: Justin Pettit <jpettit@ovn.org>