summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Add opterr and optopt to Windows headersAlin Gabriel Serdean2018-08-011-1/+1
| | | | | | | | | | | Until now we only had optind defined in the header. Since we are using the BSD getopt variant add opterr and optopt. Fixes: 3ec06ea9c668 ("ovn-nbctl: Initial support for daemon mode.") Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* lib/tc: Support matching on ip tunnel tos and ttlOr Gerlitz2018-08-011-1/+6
| | | | | | | | | Support matching on tos and ttl of ip tunnels for the TC data-path. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
* lib/tc: Support setting tos and ttl for TC IP tunnelsOr Gerlitz2018-08-011-2/+8
| | | | | | | | Allow to set the tos and ttl for TC tunnels. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
* lib/tc: Support matching on ip tosOr Gerlitz2018-08-011-0/+1
| | | | | | | | | Add the missing code to match on ip tos when dealing with the TC data-path. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
* ofp-actions: Split ofpacts_check__() into many functions.Ben Pfaff2018-07-311-6/+14
| | | | | | | | | | | ofpacts_check__() was a huge switch statement with special cases for many different kinds of actions. This made it unwieldy and put the special cases far away from the rest of the code related to a given action. This commit refactors the code to avoid the problem. Signed-off-by: Ben Pfaff <blp@ovn.org> Tested-by: Yifeng Sun <pkusunyifeng@gmail.com> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
* ovn: Add rate-limiting for ACL logs.Justin Pettit2018-07-301-0/+1
| | | | | Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ofproto: Add support for specifying a meter in controller actions.Justin Pettit2018-07-301-0/+8
| | | | | Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* Add support to offload QinQ double VLAN headers matchJianbo Liu2018-07-251-1/+5
| | | | | | | | | | Currently the inner VLAN header is ignored when using the TC data-path. As TC flower supports QinQ, now we can offload the rules to match on both outer and inner VLAN headers. Signed-off-by: Jianbo Liu <jianbol@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
* flow: Refactor some of VLAN helper functionsJianbo Liu2018-07-251-2/+2
| | | | | | | | | | By default, these function are to change the first vlan vid and pcp in the flow. Add a parameter as index for vlans if we want to handle the second ones. Signed-off-by: Jianbo Liu <jianbol@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
* sparse: Add support for DPDK.Ben Pfaff2018-07-2410-0/+2772
| | | | | | | 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>
* sparse: Make IN6_IS_ADDR_MC_LINKLOCAL and IN6_ARE_ADDR_EQUAL pickier.Ben Pfaff2018-07-111-8/+19
| | | | | | | | | | | | On GNU systems these macros work with arbitrary pointers, but the relevant standards only require IN6_IS_ADDR_MC_LINKLOCAL to work with in6_addr (and don't specify IN6_ARE_ADDR_EQUAL at all). Make the "sparse" implementations correspondingly pickier so that we catch any introduced problems more quickly. CC: Aaron Conole <aconole@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* ofp-print: Move significant formatting code into more specific .c files.Ben Pfaff2018-06-189-10/+72
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* treewide: Convert leading tabs to spaces.Ben Pfaff2018-06-111-2/+2
| | | | | | | | | It's always been OVS coding style to use spaces rather than tabs for indentation, but some tabs have snuck in over time. This commit converts them to spaces. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* ofp-bundle: Minor style fixes for header.Ben Pfaff2018-06-111-11/+13
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* vlog: exit with error if explicitly specified logfile cannot be openedDan Williams2018-05-251-2/+8
| | | | | | | | | It seems like if the user wanted a specific logfile but that request cannot be fulfilled, OVS/OVN shouldn't just continue as if nothing really happened (besides logging a warning). Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Embrace anonymous unions.Ben Pfaff2018-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several OVS structs contain embedded named unions, like this: struct { ... union { ... } u; }; C11 standardized a feature that many compilers already implemented anyway, where an embedded union may be unnamed, like this: struct { ... union { ... }; }; This is more convenient because it allows the programmer to omit "u." in many places. OVS already used this feature in several places. This commit embraces it in several others. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org> Tested-by: Alin Gabriel Serdean <aserdean@ovn.org> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
* ovs-fields: Correct ideas about which OXM classes are official.Ben Pfaff2018-05-251-15/+15
| | | | | | | | | | 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>
* userspace: add erspan tunnel support.William Tu2018-05-214-3/+75
| | | | | | | | | | | | ERSPAN is a tunneling protocol based on GRE tunnel. The patch add erspan tunnel support for ovs-vswitchd with userspace datapath. Configuring erspan tunnel is similar to gre tunnel, but with additional erspan's parameters. Matching a flow on erspan's metadata is also supported, see ovs-fields for more details. Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofp-print: Handle statistics more systematically.Ben Pfaff2018-05-171-0/+2
| | | | | | | | | | ofp_to_string__() is supposed to call ofp_print_stats() for all kinds of statistics, but it was only doing so haphazardly. This commit makes it systematic and in the process adds it to at least one case where it was missing (and fixes up a test case). Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* ofp-group: Move formatting code for groups into ofp-group.Ben Pfaff2018-05-171-1/+18
| | | | | | | This does a better job of putting related code together. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* Add OpenFlow extensions for group support in OpenFlow 1.0.Ben Pfaff2018-05-173-35/+57
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* Add support for OpenFlow 1.5 statistics (OXS).SatyaValli2018-05-164-7/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch provides implementation Existing flow entry statistics are redefined as standard OXS(OpenFlow Extensible Statistics) fields for displaying the arbitrary flow stats. To support this implementation below messages are newly added OFPRAW_OFPT15_FLOW_REMOVED, OFPRAW_OFPST15_AGGREGATE_REQUEST, OFPRAW_OFPST15_FLOW_REPLY, OFPRAW_OFPST15_AGGREGATE_REPLY, The current commit adds support for the new feature in flow statistics multipart messages, aggregate multipart messages and OXS support for flow removal message, individual flow description messages. Signed-off-by: Satya Valli <satyavalli.rama@tcs.com> Co-authored-by: Lavanya Harivelam <harivelam.lavanya@tcs.com> Signed-off-by: Lavanya Harivelam <harivelam.lavanya@tcs.com> Co-authored-by: Surya Muttamsetty <muttamsetty.surya@tcs.com> Signed-off-by: Surya Muttamsetty <muttamsetty.surya@tcs.com> Co-authored-by: Manasa Cherukupally <manasa.cherukupally@tcs.com> Signed-off-by: Manasa Cherukupally <manasa.cherukupally@tcs.com> Co-authored-by: Pavani Panthagada <p.pavani1@tcs.com> Signed-off-by: Pavani Panthagada <p.pavani1@tcs.com> [blp@ovn.org simplified and rewrote much of the code] Co-authored-by: Ben Pfaff <blp@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* sparse: Support newer GCC/glibc versions.Ben Pfaff2018-05-143-0/+66
| | | | | | | This fixes some "sparse" errors I encountered after upgrading. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* ovn: Set proper Neighbour Adv flag when replying for NS request for router IPNuman Siddique2018-05-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | Presently when a VM's IPv6 stack sends a Neighbor Solicitation request for its router IP, (mostly when the ND cache entry for the router is in STALE state) ovn-controller responds with a Neighbor Adv packet (using the action nd_na). But it doesn't set 'ND_RSO_ROUTER' in the RSO flags (please see RFC4861 page 23). Because of which, the VM deletes the default route. The default route gets added again when the next RA is received (but would again gets deleted if its sends NS request). And this results in disruption of IPv6 traffic. This patch addresses this issue by adding a new action 'nd_na_router' which is same as 'nd_na' but it sets the 'ND_RSO_ROUTER' in the RSO flags. ovn-northd uses this action. A new action is added instead of modifying the existing 'nd_na' action. This is because - We cannot set the RSO flags in the "nd_na { ..actions .. }" - It would be ugly to have something like nd_na { router_flags, ...actions .. } Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1567735 Signed-off-by: Numan Siddique <nusiddiq@redhat.com> Acked-by: Mark Michelson <mmichels@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* xlate: Move tnl_neigh_snoop() to terminate_native_tunnel()Zoltan Balogh2018-04-181-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently OVS snoops any ARP or ND packets in any bridge and populates the tunnel neighbor cache with the retreived data. For instance, when an ARP reply originated by a tenant is received in an overlay bridge, the ARP packet is snooped and tunnel neighbor cache is filled with tenant address information. This is at best useless as tunnel endpoints can only reside on an underlay bridge. The real problem starts if different tenants on the overlay bridge have overlapping IP addresses such that they keep overwriting each other's pseudo tunnel neighbor entries. These frequent updates are treated as configuration changes and trigger revalidation each time, thus causing a lot of useless revalidation load on the system. To keep the ARP neighbor cache clean, this patch moves tunnel neighbor snooping from the generic function do_xlate_actions() to the specific funtion terminate_native_tunnel() in compose_output_action(). Thus, only ARP and Neighbor Advertisement packets addressing a local tunnel endpoint (on the LOCAL port of the underlay bridge) are snooped. In order to achieve this, IP addresses of the bridge ports are retrieved and then stored in xbridge by calling xlate_xbridge_set(). The destination address extracted from the ARP or Neighbor Advertisement packet is then matched against the known xbridge addresses in is_neighbor_reply_correct() to filter the snooped packets further. Signed-off-by: Zoltan Balogh <zoltan.balogh.eth@gmail.com> Co-authored-by: Jan Scheurich <jan.scheurich@ericsson.com> Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn: Recirculate packets after a unSNAT.Gurucharan Shetty2018-04-131-3/+0
| | | | | | | | | | | | | | | | | | | commit f6fabcc6245 (ofproto-dpif: Mark packets as "untracked" after call to ct().) changed the behavior after a call to ct(). The +trk bit would automatically be unset if packet is sent to ct() and not forked. This caused a bug in the OVN gateway pipeline when there is SNAT rule as well as load-balancing rule. In the OVN gateway pipeline for the gateway router, we had an optimization where the packets sent to unSNAT need not go through a recirculation. But since doing this now means that the +trk bit gets unset, the DNAT rules for load-balancing a new packet in the next table won't get hit. This commit removes the optimization for unSNAT packets so that there is always a recirculation. Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* ovn: Support port groups in ACLsHan Zhou2018-04-132-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables using port group names in ACL match conditions. Users can create a port group in northbound DB Port_Group table, and then use the name of the port group in ACL match conditions for "inport" or "outport". It can help reduce the number of ACLs for CMS clients such as OpenStack Neutron, for the use cases where a group of logical ports share same ACL rules except the "inport"/"outport" part. Without this patch, the clients have to create N (N = number of lports) ACLs, and this patch helps achieve the same goal with only one ACL. E.g.: to-lport 1000 "outport == @port_group1 && ip4.src == {IP1, IP2, ...}" allow-related There was a similar attempt by Zong Kai Li in 2016 [1]. This patch takes a slightly different approach by using weak refs instead of strings, which requires a new table instead of reusing the address set table. This way it will also benefit for a follow up patch that enables generating address sets automatically from port groups to avoid a lot a trouble from client perspective [2]. An extra benefit of this patch is that it could enable conjunctive match effectively. As reported at [3], this patch was tested together with the conjunctive match enhancement patch [4], and huge performance improvement (more than 10x faster) was seen because of this. [1] https://mail.openvswitch.org/pipermail/ovs-dev/2016-August/077118.html [2] https://mail.openvswitch.org/pipermail/ovs-discuss/2018-February/046260.html [3] https://mail.openvswitch.org/pipermail/ovs-dev/2018-March/344873.html [4] https://patchwork.ozlabs.org/patch/874433/ Reported-by: Daniel Alvarez Sanchez <dalvarez@redhat.com> Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018-February/046166.html Tested-by: Mark Michelson <mmichels@redhat.com> Reviewed-by: Mark Michelson <mmichels@redhat.com> Reviewed-by: Daniel Alvarez <dalvarez@redhat.com> Signed-off-by: Han Zhou <hzhou8@ebay.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* OVN: add icmp6{} action supportLorenzo Bianconi2018-04-101-2/+3
| | | | | | | | | | | | | | icmp6 action is used to replace the IPv6 packet been processed with an ICMPv6 packet initialized based on incoming IPv6 one. Ethernet and IPv6 fields not listed are not changed: - ip.proto = 58 (ICMPv6) - ip.ttl = 255 - icmp6.type = 1 (destination unreachable) - icmp6.code = 1 (communication administratively prohibited) Prerequisite: ip6 Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* OVN: add tcp_reset{} action supportLorenzo Bianconi2018-04-041-0/+7
| | | | | | | | | | | | | | | | | | | | tcp_reset action transforms the current TCP segment according to the following pseudocode: if (tcp.ack) { tcp.seq = tcp.ack; } else { tcp.ack = tcp.seq + length(tcp.payload); tcp.seq = 0; } tcp.flags = RST; Then, the action drops all TCP options and payload data, and updates the TCP checksum. IP ttl is set to 255. Prerequisite: tcp Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* json: Avoid extra memory allocation and string copy parsing object members.Ben Pfaff2018-03-312-0/+2
| | | | | | | | | Until now, every time the JSON parser added an object member, it made an extra copy of the member name and then freed the original copy. This is wasteful, so this commit eliminates the extra copy. Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
* ofp-flow: Reduce memory consumption for ofputil_flow_mod, using minimatch.Ben Pfaff2018-03-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Until now, struct ofputil_flow_mod, which represents an OpenFlow flow table modification request, has incorporated a struct match, which made the overall ofputil_flow_mod about 2.5 kB. This is OK for a small number of flows, but absurdly inflates memory requirements when there are hundreds of thousands of flows. This commit fixes the problem by changing struct match to struct minimatch inside ofputil_flow_mod, which reduces its size to about 100 bytes plus the actual size of the flow match (usually a few dozen bytes). This affects memory usage of ovs-ofctl (when it adds a large number of flows) more than ovs-vswitchd. Reported-by: Michael Ben-Ami <mbenami@digitalocean.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Armando Migliaccio <armamig@gmail.com> Tested-by: Armando Migliaccio <armamig@gmail.com> Reviewed-by: Jan Scheurich <jan.scheurich@ericsson.com> Tested-by: Jan Scheurich <jan.scheurich@ericsson.com> Tested-by: Yifeng Sun <pkusunyifeng@gmail.com> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
* flow, match, classifier: Add new functions for miniflow and minimatch.Ben Pfaff2018-03-311-0/+4
| | | | | | | | | | | The miniflow and minimatch APIs lack several of the features of the flow and match APIs. This commit adds a few of the missing functions. These functions will be used for the first time in an upcoming commit. Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com> Reviewed-by: Armando Migliaccio <armamig@gmail.com>
* match: Add 'tun_md' member to struct minimatch.Ben Pfaff2018-03-312-0/+6
| | | | | | | | | | | | struct match has had a 'tun_md' member for a long time, but struct minimatch has never had one. This doesn't matter for the purposes for which minimatch is currently used, but it means that a minimatch is not completely substitutable for a match and therefore blocks some new uses. This patch adds the member. Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com> Reviewed-by: Armando Migliaccio <armamig@gmail.com>
* netdev-tc-offloads: Add support for IP fragmentationRoi Dayan2018-03-211-2/+3
| | | | | | | | | Add support for frag no, first and later. Signed-off-by: Roi Dayan <roid@mellanox.com> Reviewed-by: Shahar Klein <shahark@mellanox.com> Reviewed-by: Paul Blakey <paulb@mellanox.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
* ofp-print: Move much of the printing code into message-specific files.Ben Pfaff2018-03-1411-36/+114
| | | | | | | | | | | Until now, the ofp-print code has had a lot of logic specific to individual messages. This code is better put with the other code specific to those messages, so this commit starts to migrate it. There is more work of a similar type to do, but this is a reasonable start. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* ofp-match: Make some public functions static.Ben Pfaff2018-03-141-5/+0
| | | | | | | These were only used inside ofp-match itself. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* ofp-packet: Better abstract packet-in format.Ben Pfaff2018-03-143-31/+27
| | | | | | | | | | This commit relieves the caller of code that deals with the format of packet-in messages from some of the burden of understanding the packet format. It also renames the constants to appear to be at a higher level of abstraction. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* ofp-protocol: Better abstract changing the protocol used for flow matches.Ben Pfaff2018-03-144-69/+15
| | | | | | | | | | | The previous interface here required the client to understand, to some extent, the low-level NXFF_* values and the encoding format for the NXT_SET_FLOW_FORMAT and NXT_SET_FLOW_MOD_TABLE_ID messages. This commit changes the interface so that the client only has to understand the ofputil_protocol type used elsewhere and none of the encoding otherwise. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* OVN: add icmp4{} action supportLorenzo Bianconi2018-03-091-0/+7
| | | | | | | | | | | | | | | | icmp4 action is used to replace the IPv4 packet been processed with an ICMPv4 packet initialized based on incoming IPv4 one. Ethernet and IPv4 fields not listed are not changed: - ip.proto = 1 (ICMPv4) - ip.frag = 0 (not a fragment) - ip.ttl = 255 - icmp4.type = 3 (destination unreachable) - icmp4.code = 1 (host unreachable) Prerequisite: ip4 Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-By: Mark Michelson <mmichels@redhat.com>
* ofp-util: Use consistent naming convention.Ben Pfaff2018-02-281-2/+2
| | | | | | | | Most of the tree now uses "encode" as the verb for making an OpenFlow message, so adopt it here in this very old code as well. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* ofp-errors: Add remaining OF1.4 and OF1.5 errors.Ben Pfaff2018-02-131-15/+73
| | | | | | | | | | | Also implements the backports of relevant errors to OF1.3 as specified in ONF extension pack 1 for OF1.3. ONF-JIRA: EXT-237 ONF-JIRA: EXT-230 ONF-JIRA: EXT-264 Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: William Tu <u9012063@gmail.com>
* Implement OF1.3 extension for OF1.4 role status feature.Ben Pfaff2018-02-131-1/+4
| | | | | | | | | | ONF extension pack 1 for OpenFlow 1.3 defines how to implement the OpenFlow 1.4 "role status" message in OpenFlow 1.3. This commit implements that feature. ONF-JIRA: EXT-191 Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: William Tu <u9012063@gmail.com>
* ofp-util, ofp-parse: Break up into many separate modules.Ben Pfaff2018-02-1321-1597/+2142
| | | | | | | | | | | | 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-util: Remove prototypes for unimplemented functions.Ben Pfaff2018-02-131-12/+0
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
* ovs-vswitchd: Avoid or suppress memory leak warning for glibc aio.Ben Pfaff2018-02-011-0/+1
| | | | | | | | | | | | The asynchronous IO library in glibc starts threads that show up as memory leaks in valgrind. This commit attempts to avoid the warnings by flushing all the asynchronous I/O to the log file before exiting. This only does part of the job for glibc since it keeps the threads around for some undefined idle time before killing them, so in addition this commit adds a valgrind suppression to stop displaying these warnings in any case. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: William Tu <u9012063@gmai.com>
* util: Document and rely on ovs_assert() always evaluating its argument.Ben Pfaff2018-02-011-2/+5
| | | | | | | | | | The ovs_assert() macro always evaluates its argument, even when NDEBUG is defined so that failure is ignored. This behavior wasn't documented, and thus a lot of code didn't rely on it. This commit documents the behavior and simplifies bits of code that heretofore didn't rely on it. Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
* Support accepting and displaying table names in OVS tools.Ben Pfaff2018-02-014-8/+34
| | | | | | | | | | | | | | | | | | | | | | | | OpenFlow has little-known support for naming tables. Open vSwitch has supported table names for ages, but it has never used or displayed them outside of commands dedicated to table manipulation. This commit adds support for table names in ovs-ofctl. When a table has a name, it displays that name in flows and actions, so that, for example, the following: table=1, arp, actions=resubmit(,2) might become: table=ingress_acl, arp, actions=resubmit(,mac_learning) given appropriately named tables. For backward compatibility, only interactive ovs-ofctl commands by default display table names; to display them in scripts, use the new --names option. This feature was inspired by a talk that Kei Nohguchi presented at Open vSwitch 2017 Fall Conference. CC: Kei Nohguchi <kei@nohguchi.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Mark Michelson <mmichels@redhat.com> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
* ofp-util: New data structure for mapping between table names and numbers.Ben Pfaff2018-01-311-4/+29
| | | | | | | | | This shares the infrastructure for mapping port names and numbers. It will be used in an upcoming commit. Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com> Acked-by: Mark Michelson <mmichels@redhat.com>
* ofp-actions: Make formatting and parsing functions take a struct argument.Ben Pfaff2018-01-311-9/+23
| | | | | | | | | | 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>
* openvswitch/types.h: Drop the member name in initializer macroShashank Ram2018-01-251-3/+2
| | | | | | | | | | | | | | | | | | | MSVC++ compiler does not allow initializing a struct while explicitly initializing a member in the struct. Not allowed: static const struct eth_addr a = {{ .ea= { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}}; Alowed: static const struct eth_addr b = {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}}; *An extra curly brace is required for GCC in case the struct contains a union. Signed-off-by: Shashank Ram <rams@vmware.com> Tested-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>