summaryrefslogtreecommitdiff
path: root/lib/dpctl.c
Commit message (Collapse)AuthorAgeFilesLines
* netdev-dpdk: Allow changing NON_PMD_CORE_ID for testing purpose.Alex Wang2015-02-101-1/+1
| | | | | | | | | | | | For testing purpose, developers may want to change the NON_PMD_CORE_ID and use a different core for non-pmd threads. Since the netdev-dpdk module is hard-coded to assert the non-pmd threads using core 0, such change will cause abortion of OVS. This commit fixes the assertion and allows changing NON_PMD_CORE_ID. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* dpif-netdev: Add per-pmd flow-table/classifier.Alex Wang2014-12-301-13/+113
| | | | | | | | | | | | | | | | | | | | | This commit changes the per dpif-netdev datapath flow-table/ classifier to per pmd-thread. As direct benefit, datapath and flow statistics no longer need to be protected by mutex or be declared as per-thread variable, since they are only written by the owning pmd thread. As side effects, the flow-dump output of userspace datapath can contain overlapping flows. To reduce confusion, the dump from different pmd thread will be separated by a title line. In addition, the flow operations via 'ovs-appctl dpctl/*' are modified so that if the given flow in_port corresponds to a dpdk interface, the operation will be conducted to all pmd threads recv from that interface (expect for flow-get which will always be applied to non-pmd threads). Signed-off-by: Alex Wang <alexw@nicira.com> Tested-by: Mark D. Gray <mark.d.gray@intel.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* dpctl: Add 'get-flow' command.Joe Stringer2014-12-191-15/+81
| | | | | | | | | | This allows users to fetch a flow by giving a particular UFID. Usage: 'ovs-dpctl get-flow ufid:<ufid>' Usage: 'ovs-appctl dpctl/get-flow ufid:<ufid>' Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
* dpctl: Add support for using UFID to add/del flows.Joe Stringer2014-12-151-4/+37
| | | | | | | | Parse "ufid:<foo>" at the beginning of a flow specification and use it for flow manipulation if present. Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* dpif: Minimize memory copy for revalidation.Joe Stringer2014-12-021-1/+1
| | | | | | | | | | | | | | | | | | One of the limiting factors on the number of flows that can be supported in the datapath is the overhead of assembling flow dump messages in the datapath. This patch modifies the dpif to allow revalidators to skip dumping the key, mask and actions from the datapath, by making use of the unique flow identifiers introduced in earlier patches. For each flow dump, the dpif user specifies whether to skip these attributes, allowing the common case to only dump a pair of 128-bit ID and flow stats. With datapath support, this increases the number of flows that a revalidator can handle per second by 50% or more. Support in dpif-netdev and dpif-netlink is added in this patch; kernel support is left for future patches. Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* dpif: Index flows using unique identifiers.Joe Stringer2014-12-021-2/+10
| | | | | | | | | | | | | | | | | | | | | | | This patch modifies the dpif interface to allow flows to be manipulated using a 128-bit identifier. This allows revalidator threads to perform datapath operations faster, as they do not need to serialise the entire flow key for operations like flow_get and flow_delete. In conjunction with a future patch to simplify the dump interface, this provides a significant performance benefit for revalidation. When handlers assemble flow_put operations, they specify a unique identifier (UFID) for each flow as it is passed down to the datapath to be stored with the flow. The UFID is currently provided to handlers by the dpif during upcall processing. When revalidators assemble flow_get or flow_del operations, they may specify the UFID for the flow along with the key. The dpif will decide whether to send only the UFID to the datapath, or both the UFID and flow key. The former is preferred for newer datapaths that support UFID, while the latter is used for backwards compatibility. Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* dpctl: Implement 'list-commands' function.Alex Wang2014-10-281-26/+55
| | | | | | | | | This commit implements the 'list-commands' command for ovs-dpctl and ovs-appctl dpctl/* commands. The function will print the usage string for each subcommand. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* dpctl: add ovs-appctl dpctl/* commands to talk to dpif-netdevDaniele Di Proietto2014-08-041-0/+1422
This commit introduces multiple appctl commands (dpctl/*) They are needed to interact with userspace datapaths (dpif-netdev), because the ovs-dpctl command runs in a separate process and cannot see the userspace datapaths inside vswitchd. This change moves most of the code of utilities/ovs-dpctl.c in lib/dpctl.c. Both the ovs-dpctl command and the ovs-appctl dpctl/* commands make calls to lib/dpctl.c functions, to interact with datapaths. The code from utilities/ovs-dpctl.c has been moved to lib/dpctl.c and has been changed for different reasons: - An exit() call in the old code made perfectly sense. Now (since the code can be run inside vswitchd) it would terminate the daemon. Same reasoning can be applied to ovs_fatal_*() calls. - The lib/dpctl.c code _should_ not leak memory. - All the print* have been replaced with a function pointer provided by the caller, since this code can be run in the ovs-dpctl process (in which case we need to print to stdout) or in response to a unixctl request (and in this case we need to send everything through a socket, using JSON encapsulation). The syntax is ovs-appctl dpctl/(COMMAND) [OPTIONS] [PARAMETERS] while the ovs-dpctl syntax (which _should_ remain the same after this change) is ovs-dpctl [OPTIONS] (COMMAND) [PARAMETERS] Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> [blp@nicira.com made stylistic and documentation changes] Signed-off-by: Ben Pfaff <blp@nicira.com>