Skip to content

Commit

Permalink
dpctl: add ovs-appctl dpctl/* commands to talk to dpif-netdev
Browse files Browse the repository at this point in the history
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 <[email protected]>
[[email protected] made stylistic and documentation changes]
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
ddiproietto authored and blp committed Aug 4, 2014
1 parent dc71c5d commit fceef20
Show file tree
Hide file tree
Showing 11 changed files with 1,684 additions and 1,224 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Post-v2.3.0
release. The protocol is documented at
http://tools.ietf.org/html/draft-gross-geneve-00
- The OVS database now reports controller rate limiting statistics.
- ovs-dpctl functionality is now available for datapaths integrated
into ovs-vswitchd, via ovs-appctl. Some existing ovs-appctl
commands are now redundant and will be removed in a future
release. See ovs-vswitchd(8) for details.
- OpenFlow:
* OpenFlow 1.5 (draft) extended registers are now supported.

Expand Down
3 changes: 3 additions & 0 deletions lib/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ lib_libopenvswitch_la_SOURCES = \
lib/dummy.h \
lib/dhparams.h \
lib/dirs.h \
lib/dpctl.c \
lib/dpctl.h \
lib/dpif-netdev.c \
lib/dpif-netdev.h \
lib/dpif-provider.h \
Expand Down Expand Up @@ -373,6 +375,7 @@ MAN_FRAGMENTS += \
lib/coverage-unixctl.man \
lib/daemon.man \
lib/daemon-syn.man \
lib/dpctl.man \
lib/memory-unixctl.man \
lib/ofp-version.man \
lib/ovs.tmac \
Expand Down
Loading

0 comments on commit fceef20

Please sign in to comment.