2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-25 15:07:05 +00:00
Commit Graph

6121 Commits

Author SHA1 Message Date
Jarno Rajahalme
fe7744e84b datapath: Free skb dropped by lisp_tnl_send().
vport->send functions must free the skbs they themselves report as
dropped (return 0).

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
2013-05-07 11:43:38 -07:00
Ben Pfaff
a8eebd4832 ovs-ofctl: Fix bad info in comment on transact_multiple_noreply().
Cut-and-paste error I guess.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-07 11:28:31 -07:00
Justin Pettit
71fceeb0da ovsdb-client: Fix recently introduced svec_sort() bug.
Commit 66980be9 (ovsdb-client: Avoid assertion with multiple databases.)
passed in a pointer to an svec pointer, when it should have just been an
svec pointer.  This corrects the bug.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
2013-05-06 21:30:26 -07:00
Justin Pettit
66980be97d ovsdb-client: Avoid assertion with multiple databases.
When using ovsdb-client with an ovsdb-server with multiple databases, an
assertion could trigger due to them being returned in non-sorted order.
This commit changes the fetch_dbs() function to always return databases
in sorted order, since both callers are expecting that behavior.

Bug #16882

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Reported-by: Spiro Kourtessis <spiro@vmware.com>
2013-05-06 15:44:45 -07:00
Ben Pfaff
8e85e03749 Allow master to build on Fedora with the recent threading changes
The recent threading changes have broken the build on Fedora,
and presumably other Red Hat based distributions. This adds an explicit
"-lpthread" to the linker command line and allows the latest master to build
on Fedora. I've also tested this on Ubuntu and it builds fine there.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ed Maste <emaste@freebsd.org>
2013-05-06 15:41:29 -07:00
Pravin B Shelar
db0c31340f datapath: Kill VPORT_F_TUN_ID vport flag.
VPORT_F_TUN_ID is last remaining flag, once we remove it, flags
field from vport-ops can be removed.  Since it does not complicate
much code, we decided to remove this flag.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2013-05-06 11:43:08 -07:00
Pravin B Shelar
806b46ef3d datapath: Move vport init to first port create.
vport->init and exit() functions are defined by gre and netdev vport
only and both can be moved to first port create.

Following patch does same, it moves vport init to respective vport
create and gets rid of vport->init() and vport->exit() functions.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2013-05-06 11:42:48 -07:00
Pravin B Shelar
be7cd27e44 datapath: Unify vport error stats handling.
Following patch changes vport->send return type so that vport
layer can do error accounting.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2013-05-06 10:31:01 -07:00
Pravin B Shelar
c405d282fb tunneling: Remove struct tnl_vport and tnl_ops.
After flow based tunneling, kernel tunneling is greatly simplified.
There is no need to have extra tunneling layer between vport and
particular protocol.
Following patch removes tunneling struct which make code easy to read.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2013-05-06 10:29:08 -07:00
Jesse Gross
2f524209e9 datapath: Remove unused get_config vport op.
The get_config vport op is left over from old compatibility code,
it is neither used nor implemented any more.

Signed-off-by: Jesse Gross <jesse@nicira.com>
2013-05-06 08:49:36 -07:00
Ben Pfaff
c2553db908 bridge: Correctly omit unsupported interface statistics from database.
The database documentation says:

    If an interface does not support a given statistic, then that pair is
    omitted.

but in fact the implementation included the key-value pair for an
unsupported statistic with -1 as the value.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
2013-05-03 15:36:56 -07:00
Ed Maste
62d86422f9 netdev-bsd: Use UINT64_MAX for unsupported stats.
As documented in netdev-provider.h for the get_stats method.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-03 14:05:05 -07:00
Ben Pfaff
e94f17a77a ofp-util: Fix type of 'port' param to ofputil_encode_dump_ports_request().
We always use unsigned types for port numbers elsewhere, so use one here
too.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
2013-05-03 14:01:56 -07:00
Ben Pfaff
05f453a895 ovs-ofctl: Make "ovs-ofctl monitor" respond to echo requests.
Otherwise the command will time out after a while when there's no traffic,
which probably isn't what we want.

Reported-by: Henry Mai <hmai@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
2013-05-03 13:58:29 -07:00
Ben Pfaff
f44c514621 rconn: Discard messages received on monitor connections.
Otherwise, if a monitor connection happens to be talking to a (misguided?)
peer that sends it messages, such as replies to what the peer perceives as
echo requests meant for it, then the peer will eventually hang trying to
send data because the monitor connection never sinks it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
2013-05-03 13:40:19 -07:00
Ben Pfaff
5ac7c4dcf5 rconn: Factor code out from copy_to_monitor().
This prepares for the introduction of a second user in the following
commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-03 13:40:06 -07:00
Ed Maste
44f645a583 socket-util: restore building on FreeBSD.
FreeBSD does not have EAI_ADDRFAMILY or EAI_NODATA and thus failed to build
after commit 3cbb5dc7e8 "socket-util: Use
getaddrinfo() instead of gethostbyname() for thread safety."

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-03 13:32:47 -07:00
Ben Pfaff
5b7126361f vconn: Mark class structures as const.
These data structures are never modified so it seems logical for them
to be const.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-03 13:29:49 -07:00
Ben Pfaff
a00d4bd036 ofp-util: Make names[] in ofputil_action_code_from_name() const-ier.
This changes allows the compiler to put 'names' in a read-only section.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-03 13:29:48 -07:00
Ben Pfaff
4b5f1d2cc3 vlog: Mark more static data const.
These data structures are never modified so this seems like a
logical change.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-03 13:29:48 -07:00
Ben Pfaff
112b76f6b9 stream-fd: Mark 'fd_pstream_class' const.
These data structures are never modified so this seems like a
logical change.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-03 13:29:47 -07:00
Ben Pfaff
edfbe9f7bc netdev: Make 'smap' variable const in netdev_set_qos().
This makes this code more obviously thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-03 13:29:47 -07:00
Ben Pfaff
559eb2308b netdev-linux: Mark more static data as "const".
This makes this code more obviously thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-03 13:29:47 -07:00
Ben Pfaff
e37726e467 hmap: Make HMAP_INITIALIZER a valid initializer for a const hmap.
Without this change, an initialization such as
    const struct hmap map = HMAP_INITIALIZER(&map);
yields a compiler warning "initialization discards qualifiers from pointer
target type".

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-03 13:29:46 -07:00
Ben Pfaff
07fc4ed341 Make most "struct option" instances "const".
Reducing non-const static data makes code more obviously thread-safe.
Although option parsing does not normally need to be thread-safe, I
don't know of a drawback to making its data const.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-03 13:29:46 -07:00
Ben Pfaff
d64e176c35 dpif-linux: Make dummy_action const in dpif_linux_init_flow_put().
This makes this code more obviously thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-03 13:29:46 -07:00
Ben Pfaff
ffb1cfd144 system-stats: Use getmntent_r() for thread-safety.
getmntent_r() is a GNU extension so we test for its existence and just
disable this feature of system stats if it is not present, because this
feature is not very important.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-03 12:49:39 -07:00
Ben Pfaff
9b6937eb1f Use gmtime_r() and localtime_r() instead of non-thread-safe versions.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-02 15:49:36 -07:00
Andy Zhou
d5155945e0 ovs-benchmark: improve 'rate' command piped output support.
Add fflush() to the 'rate' command of 'ovs-benchmark'.  On a tty console
the output is line-buffered. However, piped output by default has a
deeper (usually 4KB) buffer, the output won't appear to the other end of
the pipe until this buffer is full.

This patch makes the piped output of the 'rate' command's consistent
with tty console output.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-02 15:47:55 -07:00
Ben Pfaff
3cbb5dc7e8 socket-util: Use getaddrinfo() instead of gethostbyname() for thread safety.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-02 14:34:45 -07:00
Ben Pfaff
92829687b4 Use pthread_sigmask() in place of sigprocmask(), for thread safety.
POSIX says that multithreaded programs must not use sigprocmask() but must
use pthread_sigmask() instead.  This commit makes that replacement.

The actual use of signals in Open vSwitch is still not thread safe
following this commit, but this change is a necessary prerequisite for
fixing the other problems.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-02 13:55:45 -07:00
Neil Mckee
743cea4543 Change sFlow model to reflect per-bridge sampling
Until now, we were presenting a separate sFlow data-source (sampler) for
each ifIndex-interface.  This caused problems with samples that did not
easily map to an ifIndex being aliased together and breaking the sFlow
containment rules.  This patch changes the model to present a single sFlow
data-source for each bridge.  Now we can still make all reasonable effort
to map packet samples to ingress/egress ifIndex numbers, knowing that the
fallback to "unknown" does not break the sFlow model.  Note that
interface-counter-polling is still handled the same way as before, with
sFlow counter-polling data only being exported for ifIndex-interfaces.

Signed-off-by: Neil Mckee <neil.mckee@inmon.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-02 12:37:28 -07:00
Jesse Gross
17ec1d0425 datapath: Immediately exit on error in ovs_vport_cmd_set().
It is an error to try to change the type of a vport using the set
command. However, while we check that this is an error, we still
proceed to allocate memory which then gets freed immediately.
This stops processing after noticing the error, which does not
actually fix a bug but is more correct.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
2013-05-02 11:48:14 -07:00
Ben Pfaff
48f6fbe197 dpif-linux: Close channel Netlink sockets when a port number gets recycled.
When ovs-vswitchd deletes a port with dpif_linux_port_del(), that function
uses del_channel() to delete the corresponding channel, including closing
its Netlink socket fd.  However, if the vport gets removed by some other
process (e.g. "ip link delete" for veths) then this function never gets
called and thus the channel never gets deleted.

This commit partially fixes the problem.  Now, if a port number gets
reused, add_channel() closes the old Netlink socket assigned to that port
before it installs the new one.

Bug #16784.
Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-02 10:10:42 -07:00
Ben Pfaff
12d7685905 dpif-linux: Use MAX_PORTS instead of hard-coded 65535.
MAX_PORTS is currently USHRT_MAX (also 65535).  I think that's a
coincidence; I don't remember MAX_PORTS being mentioned when the new
dpif_channel code was written.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-02 10:06:35 -07:00
Justin Pettit
79a6e10e35 FAQ: Indicate LTS is now the 1.9.x series.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
2013-05-02 09:10:27 -07:00
Simon Horman
20131cefeb Make it more obvious that OVS_KEY_ATTR_MPLS may be an array
Note that OVS_KEY_ATTR_MPLS may be an array of ovs_key_mpls
and that the acceptable length may be restricted by the implementation.

Currently the user-space datapath and proposed kernel datapath
implementation restrict the length to a single element.

Also update the mpls_top_lse name of the element of struct ovs_key_mpls,
as it is an array of LSEs and thus not necessarily just the top LSE.

As requested by Jesse Gross

Cc: Jesse Gross <jesse@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2013-05-01 19:34:05 -07:00
Justin Pettit
b82b19e938 Set release date for 1.10.0.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
2013-05-01 14:30:38 -07:00
Duffie Cooley
431ad53564 ovs-sandbox: Use $schema for creating the db.
The code here went to some trouble to properly set $schema and then
ignored it.

Signed-off-by: Duffie Cooley <dcooley@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-01 12:24:05 -07:00
Simon Horman
0283017566 Remove spurious IPv4 data from MPLS packet test
Supplying this data is somewhat misleading as it
is completely ignored and is not included in
the synthesised packet.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-01 08:15:44 -07:00
Ben Pfaff
589b85e14b dpif-netdev: Shorten delay loops.
Um, I mean, remove useless code.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-30 15:17:53 -07:00
Ethan Jackson
ad9ca30d58 ofproto: Add ipfix-entities.def to gitignore.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2013-04-30 12:31:46 -07:00
Ben Pfaff
a93f1927f2 ofproto-dpif: Fix 'size' argument to fix_sflow_action().
The sflow action only uses 8 bytes of the total 16 for user_action_cookie,
but fix_sflow_action() was checking for the presence of all 16, so if the
sflow action wasn't followed by a few other actions then 'cookie' would
end up NULL and the assertion would segfault.

Bug #16659.
Reported-by: Dhaval Badiani <dbadiani@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-30 11:24:11 -07:00
Thomas Graf
d5de5b0d7e datapath: Remove unneeded ovs_netdev_get_ifindex()
The only user is get_dpifindex(), no need to redirect via the port
operations.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2013-04-30 08:51:40 -07:00
Gurucharan Shetty
7ffd3f6972 worker: Prevent worker from being responsible for pidfile deletion.
Currently we are creating the worker process after creation of the pidfile.
This means that the responsibility of deleting the pidfile after process
termination rests with the worker process.

When we restart openvswitch using the startup scripts, we SIGTERM the main
process and once it is cleaned up, we start ovs-vswitchd again. This results
in a race condition. The new ovs-vswitchd will create a pidfile because it is
unlocked. But, if the old worker process exits after the start of new
ovs-vswitchd, it will simply delete the pidfile underneath the new ovs-vswitchd.
This will eventually result in multiple ovs-vswitchd daemons.

This patch gives the responsibility of deleting the pidfile to the main
process.

Bug #16669.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-04-29 15:09:48 -07:00
Gurucharan Shetty
9f27568d9f vswitchd: Disable system stats collection on a concurrently running daemon.
There are very rare cases (ex: ovs-vswitchd.pid is inadvertantly deleted),
when multiple ovs-vswitchd daemons can end up running at the same time.
In a situation like that one of the daemons can wait on the poll()
with a 0 ms wait time as it would be expecting system stats to be collected.

But system stats are never run for the daemon that does not have the
lock on the database and hence it takes up 100% of the CPU if its state
machine for stats collection previously was S_WAITING.

With this patch, we disable the system stats collection for the daemon that
does not have the database lock. When it eventually gets the lock on the
database, system stats are automatically enabled if other_config:\
enable-statistics=true.

Bug #16669.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-04-29 15:09:48 -07:00
Ben Pfaff
488232b7ec netlink-socket: Use xmalloc() instead of malloc().
This was the only obvious use of bare malloc() in the tree, other
than in the implementation of wrapper functions.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-29 15:05:56 -07:00
Ben Pfaff
0d121c7350 netlink-socket: Minor style fix.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-29 15:05:56 -07:00
Ben Pfaff
95ddb070ca timeval: Remove prototype for unimplemented function.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-29 15:02:26 -07:00
Justin Pettit
9f31efc731 Prepare for post-1.11.0 (1.11.90).
Signed-off-by: Justin Pettit <jpettit@nicira.com>
2013-04-29 14:56:41 -07:00