2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 18:07:40 +00:00

30 Commits

Author SHA1 Message Date
Ethan Jackson
ef8a3d1497 socket-util: Remove DSCP_INVALID.
The DSCP_INVALID flag allowed callers to prevent socket-util from
modify the DSCP bits of newly created sockets.  However, the two
really important callers (implementations of the controller and
manager tables) never used it.  Furthermore, the other callers
would be fine always setting the DSCP bits to zero.  This patch
removes the DSCP_INVALID option in an effort to simplify the code.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-04-17 13:15:17 -07:00
Mehak Mahajan
f125905cdd Allow configuring DSCP on controller and manager connections.
The changes allow the user to specify a separate dscp value for the
controller connection and the manager connection. The value will take
effect on resetting the connections. If no value is specified a default
value of 192 is chosen for each of the connections.

Feature #10074
Requested-by: Rajiv Ramanathan <rramanathan@nicira.com>
Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
2012-03-23 18:13:08 -07:00
Ben Pfaff
324f0c59d2 unixctl: Fix bad log message on error path.
'path' is usually not the right path (often it's NULL).

Introduced in commit bde9f75de (unixctl: New JSON RPC back-end.).

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-23 13:42:12 -07:00
Ethan Jackson
bde9f75de1 unixctl: New JSON RPC back-end.
The unixctl library had used the vde2 management protocol since the
early days of Open vSwitch.  As Open vSwitch has matured, several
Python daemons have been added to the code base which would benefit
from a unixctl implementations.  Instead of implementing the old
unixctl protocol in Python, this patch changes unixctl to use JSON
RPC for which we already have an implementation in both Python and
C.  Future patches will need to implement a unixctl library in
Python on top of JSON RPC.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-02-21 00:02:20 -08:00
Ben Pfaff
e7b5947add unixctl: Improve readability of "help" output for long command names.
Without this change, if a unixctl command name is 23 character long or
longer, no space appeared between the command name and its usage.  This
commit ensures that at least one space always appears.

No command yet has a name this long.  I discovered this issue when I added
one that does.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-01-02 12:48:42 -08:00
Ben Pfaff
0e15264f96 unixctl: Implement quoting.
The protocol used by ovs-appctl has a long-standing bug that there
is no way to distinguish "ovs-appctl a b c" from "ovs-appctl 'a b c'".
This isn't a big deal because none of the current commands really
want to accept arguments that include spaces, but it's kind of a silly
limitation.

At the same time, the internal API is awkward because every user is
stuck doing its own argument parsing, which is no fun.

This commit fixes both problems, by adding shell-like quoting to the
protocol and modifying the internal API from one that passes a string
to one that passes in an array of pre-parsed strings.  Command
implementations may now specify how many arguments they expect.  This
simplifies some command implementations significantly.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-12-19 14:53:34 -08:00
Simon Horman
4895c70161 Make unixctl_command_register() idempotent
The assert() statement in unixctl_command_register() implies that it is
intended to be idempotent but inserting the same name and callback twice
would fail because:

* The callback is not stored directly in the hash, rather it the
  cb element of a struct unixctl_command which is stored in the hash.

* Insertion would be attempted even if the entry was already present.
2011-11-14 09:17:15 -08:00
Justin Pettit
7ff2009a95 ovs-appctl: Print command arguments for "help". 2011-09-29 18:52:28 -07:00
Justin Pettit
d5e1e5ede3 ovs-appctl: Add "version" command to print version of running daemons.
When debugging a running system, we occasionally see a mismatch of
different versions because someone forgets to restart one or more
daemons.  Often times, it would be useful to know what's running as
opposed to what's on the current runpath.
2011-08-04 11:15:55 -07:00
Ben Pfaff
fe1e967e3b Add a few more users for ovs_retval_to_string(). 2011-04-04 10:58:54 -07:00
Ben Pfaff
d76f09ea77 coverage: Make the coverage counters catalog program-specific.
Until now, the collection of coverage counters supported by a given OVS
program was not specific to that program.  That means that, for example,
even though ovs-dpctl does not have anything to do with mac_learning, it
still has a coverage counter for it.  This is confusing, at best.

This commit fixes the problem on some systems, in particular on ones that
use GCC and the GNU linker.  It uses the feature of the GNU linker
described in its manual as:

    If an orphaned section's name is representable as a C identifier then
    the linker will automatically see PROVIDE two symbols: __start_SECNAME
    and __end_SECNAME, where SECNAME is the name of the section.  These
    indicate the start address and end address of the orphaned section
    respectively.

Systems that don't support these features retain the earlier behavior.

This commit also fixes the annoyance that files that include coverage
counters must be listed on COVERAGE_FILES in lib/automake.mk.

This commit also fixes the annoyance that modifying any source file that
includes a coverage counter caused all programs that link against
libopenvswitch.a to relink, even programs that the source file was not
linked into.  For example, modifying ofproto/ofproto.c (which includes
coverage counters) caused tests/test-aes128 to relink, even though
test-aes128 does not link again ofproto.o.
2010-11-30 10:30:30 -08:00
Ben Pfaff
b43c6fe279 Make installation directories overridable at runtime.
This makes it possible to run tests that need access to installation
directories, such as the rundir, without having access to the actual
installation directories (/var/run is generally not world-writable), by
setting environment variables.  This is not a good way to do things in
general--usually it would be better to choose the correct directories
at configure time--so for now this is undocumented.
2010-11-29 16:29:11 -08:00
Ben Pfaff
614c489203 Add new "dummy" netdev and dpif implementations for use in unit tests. 2010-11-29 16:29:10 -08:00
Ben Pfaff
d98e600755 vlog: Make client supply semicolon for VLOG_DEFINE_THIS_MODULE.
It's kind of odd for VLOG_DEFINE_THIS_MODULE to supply its own semicolon,
so this commit switches to the more common form.
2010-10-29 09:48:47 -07:00
Ben Pfaff
4e8e4213a8 Switch many macros from using CONTAINER_OF to using OBJECT_CONTAINING.
These macros require one fewer argument by switching, which makes code
that uses them shorter and more readable.
2010-10-01 10:25:29 -07:00
Ben Pfaff
5136ce492c vlog: Introduce VLOG_DEFINE_THIS_MODULE for declaring vlog module in use.
Adding a macro to define the vlog module in use adds a level of
indirection, which makes it easier to change how the vlog module must be
defined.  A followup commit needs to do that, so getting these widespread
changes out of the way first should make that commit easier to review.
2010-07-21 15:47:09 -07:00
Ben Pfaff
3c44261983 unixctl: Sort list of commands output by "help".
Feature #2873.
2010-05-25 15:49:26 -07:00
Justin Pettit
bc39196036 Cleanup default file locations and XenServer packaging
This commit cleans up the locations of a number of files and directories
used.  These include:

    - Config file lives in /etc/openvswitch/conf.db
    - Logs go into /var/log/openvswitch
    - ovsdb-server socket is /var/run/openvswitch/db.sock
    - Schema goes into /usr/share/openvswitch/vswitch.ovsschema
    - PID files go in /var/run/openvswitch

For XenServer, these additional changes are made:

    - Cores go in /var/xen/openvswitch
    - OVS binaries run in /var/xen/openvswitch

In addition, it attempts to cleanup the XenServer packaging.  This
includes referring to the project as "openvswitch" as opposed to the
somewhat presumptuous "vswitch".

Note: Changes to the Debian packaging will be forthcoming.
2010-03-26 14:40:31 -07:00
Ben Pfaff
daf03c53ee util: New functions get_cwd(), abs_file_name().
These will be used further in an upcoming commit.
2010-03-18 11:23:50 -07:00
Ben Pfaff
c69ee87c10 Merge "master" into "next".
The main change here is the need to update all of the uses of UNUSED in
the next branch to OVS_UNUSED as it is now spelled on "master".
2010-02-11 11:11:23 -08:00
Ben Pfaff
67a4917b07 Rename UNUSED macro to OVS_UNUSED to avoid naming conflict.
Requested by Jean Tourrilhes <jt@hpl.hp.com>.
2010-02-11 10:59:47 -08:00
Ben Pfaff
a723bf84fb unixctl: Improve error reporting.
The ovs_error() function is our standard way of reporting startup errors,
so use it.  (It also outputs the program name at the beginning of the
message.)
2010-01-15 11:33:18 -08:00
Ben Pfaff
58fda1dab1 Merge "master" branch into "db". 2009-12-02 11:49:53 -08:00
Ben Pfaff
3fbe1d307e Make ovs-appctl easier to use and synchronize its interface with ovs-vsctl.
It is inconvenient to type the whole path to the Unix daemon socket when
using ovs-appctl.  Allow the name of the daemon to be used instead when
a pidfile exists in the default location, and contact ovs-vswitchd by
default.

Also, the various options for manipulating vlog were invented before the
general-purpose command mechanism existed.  Get rid of all of the action
options in favor of just specifying the command to be executed as
non-option arguments.

Finally, there simply wasn't much value in allowing multiple targets or
options to be specified; these variations were never used in practice.  So
simplify the interface by making it one target, one action per invocation.

Also, make ovs-vsctl use the same syntax for its --target option.

Based on work by Justin Pettit.
2009-11-09 14:46:38 -08:00
Ben Pfaff
8ca79daaa0 unixctl: Allow passing auxiliary data to unixctl commands.
This will allow users of unixctl to avoid using global variables, leading
to cleaner code.
2009-10-29 15:20:56 -07:00
Ben Pfaff
6a0061cbf5 fatal-signal: New function fatal_signal_unlink_file_now().
This is a helper function that combines two actions that callers commonly
wanted.  It will have an additional user in an upcoming commit.
2009-09-21 16:44:58 -07:00
Justin Pettit
be2c418b73 Cleanup isdigit() warnings.
NetBSD's gcc complains if isdigit()'s argument is an unadorned char.  This
provides an appropriate cast.
2009-08-25 14:11:44 -07:00
Ben Pfaff
fd30311c87 shash: Introduce new macros SHASH_FOR_EACH, SHASH_FOR_EACH_SAFE.
This is both more convenient and cleaner than using HMAP_FOR_EACH(_SAFE)
directly.
2009-07-30 16:07:13 -07:00
Ben Pfaff
a14bc59fb8 Update primary code license to Apache 2.0. 2009-06-15 15:11:30 -07:00
Ben Pfaff
064af42167 Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45. 2009-07-08 13:19:16 -07:00