summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* workext-320Ben Pfaff2014-07-2831-4382/+4140
|
* work on ofproto_table_configBen Pfaff2014-07-286-20/+16
|
* Fix up table-features encoding and decoding.Ben Pfaff2014-07-282-25/+55
|
* ofp-util: Fix decoding multiple tables in ofputil_decode_table_features().Ben Pfaff2014-07-281-3/+5
| | | | | | | | Table features replies can be packed back-to-back within a single multipart reply. The code here didn't properly parse properties when this occurred. This fixes the problem. Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofproto: Implement OpenFlow 1.3+ table features request.Ben Pfaff2014-07-286-8/+176
| | | | Signed-off-by: Ben Pfaff <blp@nicira.com>
* Better abstract table stats, using OpenFlow 1.3+ table features.Ben Pfaff2014-07-289-616/+848
| | | | | | | | | | | | | | | | | | Until now, the OpenFlow "table stats" have not been well abstracted. They have mostly used the raw ofp12_table_stats structure and translated to and from that. That works OK for simple purposes, but it falls apart for the "table features" introduced in OpenFlow 1.3, which are a superset of the previous table stats but broken apart differently. This commit refactors the internals to split "table stats" and "table features" in the way done in OpenFlow 1.3 and use both of these structures in the cases where previous versions of the protocol had just table stats. The refactoring in this commit makes it much easier to implement the OpenFlow 1.3 "table features request", which thus far Open vSwitch has omitted. Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofp-actions: New functions for bitmaps of instructions.Ben Pfaff2014-07-282-0/+64
|
* ofproto: Correctly report table miss configuration in table stats.Ben Pfaff2014-07-282-2/+5
| | | | | | | OFPTC11_TABLE_MISS_MASK isn't a valid value at all. We should report the value actually in use, as this commit does. Signed-off-by: Ben Pfaff <blp@nicira.com>
* openflow: Fix definitions of OFPIT11_ALL and OFPIT13_ALL.Ben Pfaff2014-07-282-8/+8
| | | | | | These were meant to be bitmaps but in fact were just bitwise-ored numbers. Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofp-actions: Better abstract sets of actions.Ben Pfaff2014-07-2810-433/+488
| | | | Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofp-util: Remove prototypes for unimplemented functions.Ben Pfaff2014-07-281-3/+0
| | | | Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofp-parse: Make string conversion functions available outside this file.Ben Pfaff2014-07-282-8/+19
| | | | | | An upcoming commit will use them from ofp-actions. Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovs-ofctl: Un-document "apply_actions" because it does not exist.Ben Pfaff2014-07-281-3/+0
| | | | | | | "apply_actions" is assumed, any other instruction has to be specified explicitly. Signed-off-by: Ben Pfaff <blp@nicira.com>
* connmgr: Only send role status messages to OpenFlow 1.4+ controllers.Ben Pfaff2014-07-284-41/+139
| | | | | | | | | | | | Only OpenFlow 1.4 and later support role status messages, but this code tried to send them to all controllers, which caused an assertion failure. Also, add tests to check that role status messages work, and that they don't cause trouble with OF1.2. Reported-by: Anup Khadka <khadka.py@gmail.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* connmgr: Demote service controllers too in ofconn_set_role().Ben Pfaff2014-07-281-3/+3
| | | | | | | | | Service controllers can set their roles, so it's necessary to demote them to slaves if another controller becomes master. Unfortunately the 'controllers' hmap only contains primary controllers, so this was omitted. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* ovs-ofctl: Add --unixctl command line option.Ben Pfaff2014-07-283-1/+15
| | | | | | | | This matches the option offered by some other Open vSwitch daemons. I intend to use it in tests in an upcoming commit. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* datapath-windows: Kernel module for HyperV.Saurabh Shah2014-07-2863-99/+18014
| | | | | | | | | | | | | | | | | | The kernel switch extension has support for bridged back forwarding & tunneling over VXLAN. There is no Netlink integration as it is still being worked out. Co-Authored-By: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Ankur Sharma <ankursharma@vmware.com> Co-Authored-By: Eitan Eliahu <eliahue@vmware.com> Signed-off-by: Eitan Eliahu <eliahue@vmware.com> Co-Authored-By: Guolin Yang <gyang@vmware.com> Signed-off-by: Guolin Yang <gyang@vmware.com> Co-Authored-By: Linda Sun <lsun@vmware.com> Signed-off-by: Linda Sun <lsun@vmware.com> Co-Authored-By: Nithin Raju <nithin@vmware.com> Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Saurabh Shah <ssaurabh@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* meta-flow: Add 64-bit registers.Ben Pfaff2014-07-2810-3/+145
| | | | | | | | | These 64-bit registers are intended to conform with the OpenFlow 1.5 draft specification. EXT-244. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* ofproto-dpif-upcall: Fix sparse warnings.Ben Pfaff2014-07-281-2/+2
| | | | | | | | | | | | Fixes these warnings from "sparse": ../ofproto/ofproto-dpif-upcall.c:761:1: warning: symbol 'free_upcall' was not declared. Should it be static? ../ofproto/ofproto-dpif-upcall.c:849:1: warning: symbol 'convert_upcall' was not declared. Should it be static? Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* Fix two memory leaks.yinpeijun2014-07-283-0/+3
| | | | | | | Found by coverity. Signed-off-by: yinpeijun <yinpeijun@huawei.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Remove assumption that there are 64 or fewer fields.Ben Pfaff2014-07-265-48/+47
| | | | | | | An upcoming commit will increase the number of fields beyond 64. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* bitmap: Add new functions.Ben Pfaff2014-07-262-0/+50
| | | | | | | These will be used in an upcoming commit. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* meta-flow: Simplify handling of a variable number of registers.Ben Pfaff2014-07-262-61/+10
| | | | | | | | | | | | | At the time that Open vSwitch implemented registers, there was a high cost to adding additional fields, so I wrote the code so that the number of registers could be reduced at compile time. Now, fields are cheaper (though not free) and in the meantime I have never heard of anyone reducing the number of registers. Since I intend to add more code that would require awkward "#if"s like this, I think that this is a good time to simplify it by requiring FLOW_N_REGS to be fixed. This commit does that. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* datapath: Fix buffer overrun in mask array realloc.Pravin B Shelar2014-07-251-1/+2
| | | | | | | | mask realloc copies elements from old array to new array. When shrinking array it can go beyond allocated memory. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
* dpif-netdev: Polling threads directly call ofproto upcall functions.Ryan Wilson2014-07-258-384/+368
| | | | | | | | | | | | | | | Typically, kernel datapath threads send upcalls to userspace where handler threads process the upcalls. For TAP and DPDK devices, the datapath threads operate in userspace, so there is no need for separate handler threads. This patch allows userspace datapath threads to directly call the ofproto upcall functions, eliminating the need for handler threads for datapaths of type 'netdev'. Signed-off-by: Ryan Wilson <wryan@nicira.com> Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* datapath: Add NULL check for mask pointer.Pravin B Shelar2014-07-251-37/+14
| | | | | | | | | | | | | | There is race in datapath when last mask in mask array deleted can result in NULL pointer dereference in datapath. datapath lookup does not check mask pointer if its index is less than mask-array count. That is safe because delete operation moves last valid pointer to the deleted element. But this does not work if we are deleting last element in array. Following patch adds NULL check for the mask pointer. This patch also avoids accessing ma->count without any locks. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
* cfm: Reduce "long delay" message from WARN to INFO, to match BFD behavior.Ben Pfaff2014-07-251-1/+1
| | | | | | | | | | | | | | These messages can cause the testsuite to fail on a busy build machine since the testsuite treats WARN or ERR log messages as failures. BFD uses an INFO message instead of WARN, so this just changes CFM to match. Alternatively, the testsuite could ignore "long delay" messages (it ignores some other categories of messages). In that case I'd expect that we'd want to change BFD to match CFM since I don't know of a reason why they should log differently. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* datapath: reorder action netlink attribute definition for upstreamingAndy Zhou2014-07-241-3/+4
| | | | | | | | | | | | | | | | | Keeping the order of netlink attribute definition in the order of upstreaming is the best way to keep all released user space program forward compatible with upstreamed kernel modules. Adjust action netlink attribute order to match with the current upstreaming plan. Recirc and hash actions are introduced in branch 2.3, which will be fixed by the patch. The MPLS actions have been released since branch-2.1 but there is no kernel implementation of them prior to branch 2.3. Thus the ordering change should not affect them. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* netdev-provider: Clarify comment where 'get_next_hop' function looks.Ben Pfaff2014-07-241-6/+6
| | | | | | | | Some readers thought it was looking in an ofproto- or netdev-specific table. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Flavio Leitner <fbl@redhat.com>
* datapath/flow_netlink: Avoid wildcarding tunnel key with disabled megaflowsDaniele Di Proietto2014-07-231-0/+19
| | | | | | | | | | | | | | If the userspace wants to match on a flow with some tunnel attributesset to 0, it simply omits them in the netlink attributes stream. Since our wildcarding logic (when megaflows are disabled) is based on the attributes in the netlink stream, we set our mask incorrectly. This commit adds a check to detect if the userspace wants to match on a tunnel, in which case we simply unwildcard the whole tun_key Reported-by: Andy Zhou <azhou@nicira.com> Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Signed-off-by: Andy Zhou <azhou@nicira.com>
* datapath: flow_netlink: Fix a bug.Alex Wang2014-07-231-1/+2
| | | | | | | | | | | | | | | | | | | | Commit 62974663fe (datapath/flow_netlink: Create right mask with disabled megaflows) introduced the bug which caused ovs_nla_get_match() returns immediately after parsing the flow mask for OVS_KEY_ATTR_ENCAP. Consequently, when vlan encapsulated packets are present, the corresponding datapath flows will have incorrect mask like below. And the incorrect flows could affect other non-vlan packets. ~/ovs# ovs-dpctl dump-flows in_port(3/0xffff0000),eth_type(0x8100),encap(), packets:0, bytes:0, used:never, actions:2 This commit fixes the bug by checking and handling the return value of the parsing function correctly. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* dpif-netdev: Initialize upcall->packet when queuing to userspace.Ben Pfaff2014-07-221-2/+3
| | | | | | | | | | | | | Commit db73f7166a6 (netdev-dpdk: Fix race condition with DPDK mempools in non pmd threads) switched to a new way of setting up 'upcall->packet', but only initialized two of the fields in the packet. This could cause core dumps and other strange behavior. In particular it caused failures in several unit tests on XenServer. This commit fixes the problem by initializing the entire ofpbuf. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* dpif-netdev: Reduce netdev_flow_key sizeDaniele Di Proietto2014-07-221-1/+1
| | | | | | | | struct 'miniflow' already contains MINI_N_INLINE values, therefore we can save few bytes in netdev_flow_key. Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* netdev-dpdk: Increase tx queue size and rx batch sizeDaniele Di Proietto2014-07-221-2/+2
| | | | | | | | These values has been found to give the best throughput in simple cases (1 flow 64 bytes UDP packets). Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* stp: Add more logging points for debug.Alex Wang2014-07-223-0/+33
| | | | | | | | This commit adds more logging points in stp module for debugging. Also, it makes the log print out the port name. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* netlink-notifier: Exit loop if nl_sock_recv() returns an errorDaniele Di Proietto2014-07-221-1/+4
| | | | | | | | | | | | | | An error from nl_sock_recv() could mean that there are some issues with the netlink socket (EBADF, ENOTSOCK, ...). Calling nl_sock_recv() in this case is harmful: nln_run() will never return and since we are calling it from the main thread, vswitchd becomes unresponsive. Also, with this commit we avoid calling the notifier callback in case of error (except for ENOBUFS, which means that there could be too many notifications) Suggested-by: Alex Wang <alexw@nicira.com> Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Acked-by: Ben Pfaff <blp@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
* configure: Don't check for malloc hooks that we no longer use.Ben Pfaff2014-07-222-21/+0
| | | | | | | | | Commit 825da1c6d1c7 (leak-checker: Remove because it cannot be made thread-safe.) removed the only uses of these hooks but neglected to remove the test for them. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* ovsdb-server: Document RFC 7047 extensions to ovsdb <error>s.Ben Pfaff2014-07-221-0/+16
| | | | | | Reported-by: Madhu Venugopal <vmadhu@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* ovs-ctl: Add comment to explain why we only save ofports for pre-1.10.Ben Pfaff2014-07-221-2/+5
| | | | | | | | | We've had a couple of questions about this lately, including one suggestion that we should always save the OpenFlow port numbers. This explains why the behavior is as it is. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* debian: Avoid -Wformat-zero-length warnings.Ben Pfaff2014-07-221-0/+7
| | | | | | | | | | Debian puts an extra "-Wformat" in the CFLAGS following OVS's own "-Wformat -Wno-format-zero-length", which therefore overrides -Wno-format-zero-length, so this commit adds an extra -Wno-format-zero-length to avoid those false positives. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* Use xstrdup() instead of strdup(), xmalloc() instead of malloc().Ben Pfaff2014-07-225-8/+8
| | | | | Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* datapath: Refactor get_dp() function into multiple access APIs.Andy Zhou2014-07-221-10/+20
| | | | | | | | Avoid recursive read_rcu_lock() by using the lighter weight get_dp_rcu() API. Add proper locking assertions to get_dp(). Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* tests: Wait for ofctl_monitor.log in ofproto-dpif controller.Ben Pfaff2014-07-211-0/+1
| | | | | | | Fixes a race in the test case. Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* classifier: Refactor cls_cursor_advance() to make it easier to follow.Ben Pfaff2014-07-211-28/+21
| | | | | Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* cmap, classifier: Avoid unsafe aliasing in iterators.Ben Pfaff2014-07-219-161/+115
| | | | | | | | | | | | | | | | CMAP_FOR_EACH and CLS_FOR_EACH and their variants tried to use void ** as a "pointer to any kind of pointer". That is a violation of the aliasing rules in ISO C which technically yields undefined behavior. With GCC 4.1, it causes both warnings and actual misbehavior. One option would to add -fno-strict-aliasing to the compiler flags, but that would only help with GCC; who knows whether this can be worked around with other compilers. Instead, this commit rewrites the iterators to avoid disallowed pointer aliasing. VMware-BZ: #1287651 Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* vswitchd/bridge: Fix setting default prefix fields.Jarno Rajahalme2014-07-211-21/+24
| | | | | | | | | | | | The check for the need of default values was in the wrong place, causing no prefix tracking to be used when database had no configuration for a flow table. Missing configuration means that defaults should be used. To limit clutter on the log, we now log the prefix tracking configuration when it is explicitly set in the database. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs-atomic: Avoid evaluating arguments multiple times.Jarno Rajahalme2014-07-211-4/+4
| | | | | | | | | ovs-atomic-gcc4+ did expand arguments again, if locked set/get was called. Also fix atomic_is_lock_free(). Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* lib/ovs-rcu: evaluate argument of ovsrcu_get only once.Jarno Rajahalme2014-07-211-3/+4
| | | | | | | | | | | | | As ovsrcu_get() looks like a function call, it is reasonable for the callers to expect that the arguments are evaluated only once. CONST_CAST expands its 'POINTER' argument multiple times, and the exact effect of this turned out to be compiler dependent. Fix this by expanding the macro argument before CONST_CAST, and removing unnecessary CONST_CASTs. VMware-BZ: #1287651 Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* netdev-dpdk: Fix race condition with DPDK mempools in non pmd threadsDaniele Di Proietto2014-07-207-41/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DPDK mempools rely on rte_lcore_id() to implement a thread-local cache. Our non pmd threads had rte_lcore_id() == 0. This allowed concurrent access to the "thread-local" cache, causing crashes. This commit resolves the issue with the following changes: - Every non pmd thread has the same lcore_id (0, for management reasons), which is not shared with any pmd thread (lcore_id for pmd threads now start from 1) - DPDK mbufs must be allocated/freed in pmd threads. When there is the need to use mempools in non pmd threads, like in dpdk_do_tx_copy(), a mutex must be held. - The previous change does not allow us anymore to pass DPDK mbufs to handler threads: therefore this commit partially revert 143859ec63d45e. Now packets are copied for upcall processing. We can remove the extra memcpy by processing upcalls in the pmd thread itself. With the introduction of the extra locking, the packet throughput will be lower in the following cases: - When using internal (tap) devices with DPDK devices on the same datapath. Anyway, to support internal devices efficiently, we needed DPDK KNI devices, which will be proper pmd devices and will not need this locking. - When packets are processed in the slow path by non pmd threads. This overhead can be avoided by handling the upcalls directly in pmd threads (a change that has already been proposed by Ryan Wilson) Also, the following two fixes have been introduced: - In dpdk_free_buf() use rte_pktmbuf_free_seg() instead of rte_mempool_put(). This allows OVS to run properly with CONFIG_RTE_LIBRTE_MBUF_DEBUG DPDK option - Do not bulk free mbufs in a transmission queue. They may belong to different mempools Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* netlink-socket: Do not make flow_dump block on netlink socket.Alex Wang2014-07-181-2/+8
| | | | | | | | | | | | | | Commit 93295354 (netlink-socket: Simplify multithreaded dumping to match Linux reality.) makes the call to recvmsg() block if no messages are available. This can cause revalidator threads hanging for long time or even deadlock when main thread tries to stop the revalidator threads. This commit fixes the issue by enabling the MSG_DONTWAIT flag in the call to recvmsg(). Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>