summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* ofproto: Probe for sample nesting level.Andy Zhou2017-03-101-1/+1
| | | | | | | | | | | Add logics to detect the max level of nesting allowed by the sample action implemented in the datapath. Future patch allows xlate code to generate different odp actions based on this information. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* dpif: Refactor dpif_probe_feature()Andy Zhou2017-03-102-3/+8
| | | | | | | | Allow actions to be part of the probe. No functional changes. Future patch will make use this new API. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* dpdk: Redirect DPDK log to OVS logging subsystem.Ilya Maximets2017-03-091-0/+48
| | | | | | | | | | | This should be helpful for have all the logs in one place. 'ovs-appctl vlog' commands for 'dpdk' module can be used to configure the log level. Lower bound for DPDK logging (--log-level) still can be passed through 'dpdk-extra' field. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
* netdev-dpdk: Fix mempool segfault.Ian Stokes2017-03-091-7/+12
| | | | | | | | | | | | | | | | | | The dpdk_mp_get() function can return a NULL pointer which leads to a segfault when a mempool cannot be created. The lack of a return value check for the function netdev_dpdk_mempool_configure() when called in netdev_dpdk_reconfigure() can result in a segfault also as a NULL pointer for the mempool will be passed to rte_eth_rx_queue_setup(). Fix this by adding appropriate NULL pointer and return value checks to dpdk_mp_get(), netdev_dpdk_reconfigure() and dpdk_vhost_reconfigure_helper(). Signed-off-by: Ian Stokes <ian.stokes@intel.com> Fixes: 2ae3d542 ("netdev-dpdk: Refactor dpdk_mp_get().") Fixes: 0072e931 ("netdev-dpdk: add support for jumbo frames") CC: Daniele Di Proietto <diproiettod@vmware.com> CC: Mark Kavanagh <mark.b.kavanagh@intel.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
* Revert "ovs-fields.7: Use a more general approach to groff encodings."Ben Pfaff2017-03-091-1/+1
| | | | | | | | 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>
* lib: Indicate if netlink message had labels.Jarno Rajahalme2017-03-092-0/+2
| | | | | | | | | | Conntrack update events include labels only if they have changed. Record the presence of labels in the netlink message to OVS internal representation, so that the user may keep the old labels when an update does not modify them. Fixes: 6830a0c0e6bf ("netlink-conntrack: New module.") Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* dpdk: Use VLOG_INFO_ONCE instead of open-coding it.Ben Pfaff2017-03-081-6/+2
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* conntrack: Force commit.Jarno Rajahalme2017-03-085-12/+63
| | | | | | Userspace support for force commit. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* datapath: Add force commit.Jarno Rajahalme2017-03-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upstream patch: commit dd41d33f0b033885211a5d6f3ee19e73238aa9ee Author: Jarno Rajahalme <jarno@ovn.org> Date: Thu Feb 9 11:22:00 2017 -0800 openvswitch: Add force commit. Stateful network admission policy may allow connections to one direction and reject connections initiated in the other direction. After policy change it is possible that for a new connection an overlapping conntrack entry already exists, where the original direction of the existing connection is opposed to the new connection's initial packet. Most importantly, conntrack state relating to the current packet gets the "reply" designation based on whether the original direction tuple or the reply direction tuple matched. If this "directionality" is wrong w.r.t. to the stateful network admission policy it may happen that packets in neither direction are correctly admitted. This patch adds a new "force commit" option to the OVS conntrack action that checks the original direction of an existing conntrack entry. If that direction is opposed to the current packet, the existing conntrack entry is deleted and a new one is subsequently created in the correct direction. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Pravin B Shelar <pshelar@ovn.org> Acked-by: Joe Stringer <joe@ovn.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* actions: Add resubmit with conntrack tuple.Jarno Rajahalme2017-03-081-19/+63
| | | | | | | | | | Add resubmit option to use the conntrack original direction tuple swapped with the corresponding packet header fields during the lookup. This could allow the same ACL table be used for admitting return and/or related traffic as is used for admitting the original direction traffic. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* odp: Support conntrack orig tuple key.Jarno Rajahalme2017-03-0811-80/+719
| | | | | | Userspace support for datapath original direction conntrack tuple. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* ofp-util: Ignore unknown fields in ofputil_decode_packet_in2().Jarno Rajahalme2017-03-083-13/+21
| | | | | | | | | | The decoder of packet_in messages should not fail on encountering unknown metadata fields. This allows the switch to add new features without breaking controllers. The controllers should, however, copy the metadata fields from the packet_int to packet_out so that the switch gets back the full metadata. OVN is already doing this. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* flow: Make room after ct_state.Jarno Rajahalme2017-03-083-6/+7
| | | | | | | 'ct_state' currently only needs 8 bits, so we can make room for a new CT field introduced in the next patch. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* datapath: Add original direction conntrack tuple to sw_flow_key.Jarno Rajahalme2017-03-082-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upstream commit: commit 9dd7f8907c3705dc7a7a375d1c6e30b06e6daffc Author: Jarno Rajahalme <jarno@ovn.org> Date: Thu Feb 9 11:21:59 2017 -0800 openvswitch: Add original direction conntrack tuple to sw_flow_key. Add the fields of the conntrack original direction 5-tuple to struct sw_flow_key. The new fields are initially marked as non-existent, and are populated whenever a conntrack action is executed and either finds or generates a conntrack entry. This means that these fields exist for all packets that were not rejected by conntrack as untrackable. The original tuple fields in the sw_flow_key are filled from the original direction tuple of the conntrack entry relating to the current packet, or from the original direction tuple of the master conntrack entry, if the current conntrack entry has a master. Generally, expected connections of connections having an assigned helper (e.g., FTP), have a master conntrack entry. The main purpose of the new conntrack original tuple fields is to allow matching on them for policy decision purposes, with the premise that the admissibility of tracked connections reply packets (as well as original direction packets), and both direction packets of any related connections may be based on ACL rules applying to the master connection's original direction 5-tuple. This also makes it easier to make policy decisions when the actual packet headers might have been transformed by NAT, as the original direction 5-tuple represents the packet headers before any such transformation. When using the original direction 5-tuple the admissibility of return and/or related packets need not be based on the mere existence of a conntrack entry, allowing separation of admission policy from the established conntrack state. While existence of a conntrack entry is required for admission of the return or related packets, policy changes can render connections that were initially admitted to be rejected or dropped afterwards. If the admission of the return and related packets was based on mere conntrack state (e.g., connection being in an established state), a policy change that would make the connection rejected or dropped would need to find and delete all conntrack entries affected by such a change. When using the original direction 5-tuple matching the affected conntrack entries can be allowed to time out instead, as the established state of the connection would not need to be the basis for packet admission any more. It should be noted that the directionality of related connections may be the same or different than that of the master connection, and neither the original direction 5-tuple nor the conntrack state bits carry this information. If needed, the directionality of the master connection can be stored in master's conntrack mark or labels, which are automatically inherited by the expected related connections. The fact that neither ARP nor ND packets are trackable by conntrack allows mutual exclusion between ARP/ND and the new conntrack original tuple fields. Hence, the IP addresses are overlaid in union with ARP and ND fields. This allows the sw_flow_key to not grow much due to this patch, but it also means that we must be careful to never use the new key fields with ARP or ND packets. ARP is easy to distinguish and keep mutually exclusive based on the ethernet type, but ND being an ICMPv6 protocol requires a bit more attention. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org> Acked-by: Pravin B Shelar <pshelar@ovn.org> Signed-off-by: David S. Miller <davem@davemloft.net> This patch squashes in minimal amount of OVS userspace code to not break the build. Later patches contain the full userspace support. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* lib: Check match and action prerequisities with 'match'.Jarno Rajahalme2017-03-0812-60/+87
| | | | | | | | | | | | | | | 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>
* netlink: Simplify nl_msg_start_nested().Jarno Rajahalme2017-03-081-1/+1
| | | | | | | Since there is no data to copy nl_msg_put_unspec_uninit() may be used directly, rather than via nl_msg_put_unspec(). Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* id-pool: Allocate the lowest available ids.Ilya Maximets2017-03-082-1/+4
| | | | | | | | | | | | This simple change makes id-pool to always allocate the lowest possible id from the pool. No any other code affected because, actually, there is no users of 'id_pool_free_id' in OVS. This behaviour of id-pool will be used in the next patch. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofp-actions: Fix translation of set_field for nw_ecnEric Garver2017-03-081-2/+4
| | | | | | | | | | | | | | | | | | | | | | When using set_field for nw_ecn with OF1.0 or OF1.1, you get an error instead of a proper translation. This use to work before 4b684612d900 ("ofp-actions: Translate mod_nw_ecn action to OF1.1 properly.") because it would fallback to using NXM. e.g. [root@rhel7 ~]# ovs-ofctl -O OpenFlow10 add-flow br0 'ip actions=set_field:2->nw_ecn' OFPT_ERROR (xid=0x4): OFPBAC_BAD_ARGUMENT NXT_FLOW_MOD (xid=0x4): ... $ ovs-ofctl -O OpenFlow11 add-flow br0 'ip actions=set_field:2->nw_ecn' ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow11) Fixes: 4b684612d900 ("ofp-actions: Translate mod_nw_ecn action to OF1.1 properly.") Signed-off-by: Eric Garver <e@erig.me> Signed-off-by: Ben Pfaff <blp@ovn.org>
* dpdk: Export packet_set_ipv6_addr() for DPDK.Darrell Ball2017-03-082-1/+5
| | | | | | | | | | The NAT changes in this series need both packet_set_ipv4_addr() and packet_set_ipv6_addr() exporting, however, the ipv4 api was exported with an unrelated patch. Signed-off-by: Darrell Ball <dlu998@gmail.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-fields.7: Use a more general approach to groff encodings.Ben Pfaff2017-03-081-1/+1
| | | | | | | | 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>
* dpif-netdev: Simple DROP meter implementation.Jarno Rajahalme2017-03-081-18/+362
| | | | | | | | | | | | | Meters may be used by any flow, so some kind of locking must be used. In this version we have an adaptive mutex for each meter, which may not be optimal for DPDK. However, this should serve as a basis for further improvement. A batch of packets is first tried as a whole, and only if some of the meter bands are hit, we need to process the packets individually. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Signed-off-by: Andy Zhou <azhou@ovn.org>
* ofproto: Meter translation.Jarno Rajahalme2017-03-082-8/+40
| | | | | | | Translate OpenFlow METER instructions to datapath meter actions. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Signed-off-by: Andy Zhou <azhou@ovn.org>
* dpif: Meter framework.Jarno Rajahalme2017-03-087-2/+236
| | | | | | | | Add DPIF-level infrastructure for meters. Allow meter_set to modify the meter configuration (e.g. set the burst size if unspecified). Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Signed-off-by: Andy Zhou <azhou@ovn.org>
* odp-execute: Apply clone action on batch of packets instead of one by one.Sugesh Chandran2017-03-071-12/+12
| | | | | | | | | | Clone action is optimized by cloning a batch of packets together instead of executing independently on every packet in a batch. Signed-off-by: Sugesh Chandran <sugesh.chandran@intel.com> Signed-off-by: Zoltán Balogh <zoltan.balogh@ericsson.com> Co-authored-by: Zoltán Balogh <zoltan.balogh@ericsson.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* windows: Fix uninitialized variable in netlink-socketAlin Serdean2017-03-071-1/+2
| | | | | | | | | | | The variable `request_nlmsg` was used without being initialized. This patch assigns a value to it before being used. Found by inspection. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* windows: add include to stream-windows.cAlin Serdean2017-03-071-1/+2
| | | | | | | | | fatal_signal_unlink_file_now is used but the header for it is missing in the include section. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* windows: add function definition to poll-loop.hAlin Serdean2017-03-071-1/+2
| | | | | | | | | poll_wevent_wait_at is used in the #define but the function definition is missing. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* windows: fix calls in netlink-socketAlin Serdean2017-03-071-24/+26
| | | | | | | | | | | | | | Add nl_sock_transact forward declaration, since it is used before being on implemented. This applies only on Windows. Move nl_sock_subscribe_packet__ function before it is used. It makes more sense to move it rather than adding a forward declaration since it is used by the two functions defined above it. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* windows: add forward declaration to dpif-netlinkAlin Serdean2017-03-071-0/+3
| | | | | | | | | | dpif_netlink_port_query__ is used before it is defined on Windows. Add a forward declaration to it. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* windows: Remove dead code in daemon-windowsAlin Serdean2017-03-071-2/+1
| | | | | | | | Found by inspection. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* lib: Refactor nested netlink APIs.Andy Zhou2017-03-062-4/+18
| | | | | | | Future patches will make use of those changes. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* conntrack: Fix checks for TCP, UDP, and IPv6 header sizes.Ben Pfaff2017-03-061-5/+11
| | | | | | | | | | Otherwise a malformed packet could cause a read up to about 40 bytes past the end of the packet. The packet would still likely be dropped because of checksum verification. Reported-by: Bhargava Shastry <bshastry@sec.t-labs.tu-berlin.de> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
* tun-metadata: Fix memory leak in tun_metadata_table_mod().Yi-Hung Wei2017-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | In testcase "tunnel - Geneve metadata", valgrind reports a memory leak with the following call stack. xcalloc (util.c:95) tun_metadata_alloc (tun-metadata.c:89) tun_metadata_table_mod (tun-metadata.c:151) handle_tlv_table_mod (ofproto.c:7782) handle_openflow__ (ofproto.c:7961) handle_openflow (ofproto.c:8023) ofconn_run (connmgr.c:1427) connmgr_run (connmgr.c:363) ofproto_run (ofproto.c:1813) bridge_run__ (bridge.c:2899) bridge_run (bridge.c:2956) main (ovs-vswitchd.c:111) Reported-by: William Tu <u9012063@gmail.com> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Joe Stringer <joe@ovn.org>
* lacp: Fix formatting typo.nickcooper-zhangtonghao2017-03-031-2/+2
| | | | | Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech> Signed-off-by: Ben Pfaff <blp@ovn.org>
* mcast-snooping: Flush ports mdb when VLAN configuration changed.nickcooper-zhangtonghao2017-03-032-0/+32
| | | | | | | | | | If VLAN configuration(e.g. id, mode) change occurs, the IGMP snooping-learned multicast groups from this port on the VLAN are deleted. This avoids a MCAST_ENTRY_DEFAULT_IDLE_TIME delay before mdb is updated again. Hardware switches (e.g. cisco) also do that. Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath: add Ethernet push and pop actionsYang, Yi Y2017-03-024-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upstream commit: commit 91820da6ae85904d95ed53bf3a83f9ec44a6b80a Author: Jiri Benc <jbenc@redhat.com> Date: Thu Nov 10 16:28:23 2016 +0100 openvswitch: add Ethernet push and pop actions It's not allowed to push Ethernet header in front of another Ethernet header. It's not allowed to pop Ethernet header if there's a vlan tag. This preserves the invariant that L3 packet never has a vlan tag. Based on previous versions by Lorand Jakab and Simon Horman. 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> Acked-by: Pravin B Shelar <pshelar@ovn.org> Signed-off-by: David S. Miller <davem@davemloft.net> [Committer notes] Fix build with the upstream commit by folding in the required switch case enum handlers. Signed-off-by: Yi Yang <yi.y.yang@intel.com> Signed-off-by: Joe Stringer <joe@ovn.org>
* windows: Broken internal netdevsAlin Serdean2017-02-221-1/+4
| | | | | | | | | | | | | Commit fa07525f9cf3fa698ebc23ea09da477d3d881a87 fixed error logging for for regular netdevs, however it overlooked "internal" netdevs. This patch allows "internal" netdev objects to be created and passed to dpif_port_add(). Reported-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Nithin Raju <Nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* meta-flow: Remove cmap dependency.Yi-Hung Wei2017-02-216-22/+77
| | | | | | | | | | | | | | 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>
* netdev-dpdk: Fix rx_error stat for dpdk ports.Ian Stokes2017-02-161-2/+1
| | | | | | | | | | | | | | | | | | | "rx_error" stat for a DPDK interface was calculated with the assumption that dropped packets due to hardware buffer overload were counted as errors in DPDK and the rte ierror stat included rte imissed packets i.e. rx_errors = rte_stats.ierrors - rte_stats.imissed This results in negative statistic values as imissed packets are no longer counted as part of ierror since DPDK v.16.04. Fix this by setting rx_errors equal to ierrors only. Fixes: 9e3ddd45 (netdev-dpdk: Add some missing statistics.) CC: Timo Puha <timox.puha@intel.com>) Reported-by: Stepan Andrushko <stepanx.andrushko@intel.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
* dpif-netdev: Conditional EMC insertCiara Loftus2017-02-161-4/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | Unconditional insertion of EMC entries results in EMC thrashing at high numbers of parallel flows. When this occurs, the performance of the EMC often falls below that of the dpcls classifier, rendering the EMC practically useless. Instead of unconditionally inserting entries into the EMC when a miss occurs, use a 1% probability of insertion. This ensures that the most frequent flows have the highest chance of creating an entry in the EMC, and the probability of thrashing the EMC is also greatly reduced. The probability of insertion is configurable, via the other_config:emc-insert-inv-prob option. This value sets the average probability of insertion to 1/emc-insert-inv-prob. For example the following command changes the insertion probability to (on average) 1 in every 20 packets ie. 1/20 ie. 5%. ovs-vsctl set Open_vSwitch . other_config:emc-insert-inv-prob=20 Signed-off-by: Ciara Loftus <ciara.loftus@intel.com> Signed-off-by: Georg Schmuecking <georg.schmuecking@ericsson.com> Co-authored-by: Georg Schmuecking <georg.schmuecking@ericsson.com> Acked-by: Kevin Traynor <ktraynor@redhat.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
* dpdk: Fixes memory leak in dpdk_init__().nickcooper-zhangtonghao2017-02-101-3/+3
| | | | | | | | | | | | | | If users configure the 'vhost-sock-dir' for dpdk, the memory allocated by xstrdup(ovs_rundir()) is not freed. This patch allows the process_vhost_flags to xstrdup() for val or default_val according to configuration and the caller must free new_val when it is no longer needed. Fixes: 01961bbdd34a ("dpdk: New module with some code from netdev-dpdk.") CC: Daniele Di Proietto <diproiettod@vmware.com> Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech> Reviewed-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
* ovs-router: fix memory leak reported by valgrind.William Tu2017-02-081-0/+2
| | | | | | | | | | | | | | Valgrind testcase 772: appctl - route/lookup6 reports the following definitely lost: xmalloc (util.c:112) miniflow_alloc (flow.c:2500) minimatch_init (match.c:1387) rt_entry_delete (ovs-router.c:274) ovs_router_del (ovs-router.c:384) process_command (unixctl.c:313) Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Andy Zhou <azhou@ovn.org>
* uuid: New macro UUID_ZERO for an all-zero expression or initializer.Ben Pfaff2017-02-082-1/+4
| | | | | | | This is convenient in expressions, e.g. "uuid = x ? *x : UUID_ZERO;". Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* jsonrpc: Fix capitalization of parameter name.Ben Pfaff2017-02-081-1/+1
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* smap: Improve comment on SMAP_CONST1, SMAP_CONST2 macros.Ben Pfaff2017-02-081-3/+5
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* windows: netdev report error if query failedAlin Serdean2017-02-081-1/+1
| | | | | | | | | | | | | | The netdev Windows construct uses query_netdev to see if a port exists in the datapath, in the case an error occurred in the reply message we returned 0, meaning netdev_open was successful. This patch fixes fixes that problem. Reported-at: https://github.com/openvswitch/ovs-issues/issues/125 Reported-by: Shashank Ram <rams@vmware.com> Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-By: Shashank Ram <rams@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* odp: Fix sample action in userspaceAndy Zhou2017-02-031-1/+9
| | | | | | | | | | | User space implementation of the sample action is not consistent with kernel datapath. In kernel datapath, the side effects of actions within the sample actions are not visible to the subsequent actions. Current user space handling does not follow the same logic. This patch makes them consistent. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* netdev: Reject empty names in netdev_open().Ben Pfaff2017-02-031-1/+9
| | | | | | | | | | | | | | The empty string is not a valid name for a network device. I would have expected that each of the netdev provider implementations would reject an empty string, but there was a special case for Linux tap devices where they instead caused unexpected behavior. This commit should fix the problem for those devices and every other kind. Reported-by: Gabor Locsei <gabor.locsei@ericsson.com> Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2017-February/043613.html Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Girish Moodalbail <girish.moodalbail@oracle.com> Acked-by: Andy Zhou <azhou@ovn.org>
* dpif-netdev: Pass Openvswitch other_config smap to dpif.Daniele Di Proietto2017-02-035-17/+16
| | | | | | | | | | | | | | | | | Currently we parse the 'other_config' column in Openvswitch table in bridge.c. We extract the values (just 'pmd-cpu-mask' for now) and we pass them down to the datapath, via different layers. If we want to pass other values to dpif-netdev.c (like we recently discussed) we would have to touch ofproto.c, ofproto-dpif.c and dpif.c. This patch sends the entire other_config column to dpif-netdev, so that dpif-netdev can extract the values it's interested in. No functional change. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org>
* odp: Add datapath clone action parser.Andy Zhou2017-02-011-13/+46
| | | | | | | | | When adding userspace datapath clone action, the corresponding odp actions parser and unit tests were missing. This patch adds them. Reported-by: Ben Pfaff <blp@ovn.org> Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>