2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00
Commit Graph

14 Commits

Author SHA1 Message Date
Dmitry Porokh
421c94ee14 ovsdb: Introduce and use specialized uuid print functions.
According to profiling data, converting UUIDs to strings is a frequent
operation in some workloads. This typically results in a call to
xasprintf(), which internally calls vsnprintf() twice, first to
calculate the required buffer size, and then to format the string.

This patch introduces specialized functions for printing UUIDs, which
both reduces code duplication and improves performance.

For example, on my laptop, 10,000,000 calls to the new uuid_to_string()
function takes 1296 ms, while the same number of xasprintf() calls using
UUID_FMT take 2498 ms.

Signed-off-by: Dmitry Porokh <dporokh@nvidia.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
2025-05-08 09:28:21 +02:00
Ben Pfaff
1b1d2e6daa ovsdb: Introduce experimental support for clustered databases.
This commit adds support for OVSDB clustering via Raft.  Please read
ovsdb(7) for information on how to set up a clustered database.  It is
simple and boils down to running "ovsdb-tool create-cluster" on one server
and "ovsdb-tool join-cluster" on each of the others and then starting
ovsdb-server in the usual way on all of them.

One you have a clustered database, you configure ovn-controller and
ovn-northd to use it by pointing them to all of the servers, e.g. where
previously you might have said "tcp:1.2.3.4" was the database server,
now you say that it is "tcp:1.2.3.4,tcp:5.6.7.8,tcp:9.10.11.12".

This also adds support for database clustering to ovs-sandbox.

Acked-by: Justin Pettit <jpettit@ovn.org>
Tested-by: aginwala <aginwala@asu.edu>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-03-24 12:04:53 -07:00
Yi-Hung Wei
9131abe223 lib, ovsdb: Adapt headers for C++ usage
This patch adds 'extern "C"' in a couple of header files so that
they can be compiled with C++ compilers.

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-12-01 13:22:18 -08:00
Ben Pfaff
ffa3493a00 uuid: New function uuid_random().
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
2017-10-24 16:09:16 -07:00
Ben Pfaff
61be08e4ed uuid: New function uuid_is_partial_match().
This will have another caller in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
2017-05-03 08:22:48 -07:00
Ben Pfaff
42a1d93e29 uuid: New macro UUID_ZERO for an all-zero expression or initializer.
This is convenient in expressions, e.g. "uuid = x ? *x : UUID_ZERO;".

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
2017-02-08 11:41:15 -08:00
Ben Pfaff
c80eac1f85 ovn-controller: Tie OpenFlow and logical flows using OpenFlow cookie.
This makes it easy to find the logical flow that generated a particular
OpenFlow flow, by running "ovn-sbctl dump-flows <cookie>".

Later, this can be refined (and automated for "ofproto/trace"), but this
is still a significant advance.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
2016-12-28 09:17:51 -08:00
Ben Warren
d5dc60f0d3 Break uuid.h into private and public parts
Public (struct definitions and some prototypes) go in
include/openvswitch

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2016-04-14 13:40:32 -07:00
Joe Stringer
78145f6edb dpif: Always generate RFC4122 UUIDs for UFID.
This patch sacrifices a few bits of hash quality from the 128-bit unique
flow identifiers to make the UFIDs RFC4122-conformant as per the version 4
(random) UUID spec. Given that the 128-bit space is already quite large,
this should not affect the spread of UFIDs in any meaningful way for
hashing.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-09 18:20:02 -07:00
Raju Subramanian
e0edde6fee Global replace of Nicira Networks.
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc.

Feature #10593
Signed-off-by: Raju Subramanian <rsubramanian@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02 17:08:02 -07:00
Justin Pettit
27365e26a1 uuid: Correct name of header file in comment. 2011-01-11 18:57:01 -08:00
Ben Pfaff
d0d15d58c6 uuid: New function uuid_from_string_prefix().
For use in an upcoming commit.
2010-02-15 11:28:39 -08:00
Ben Pfaff
c532bf9dd4 ovsdb: Save some space in the log for newly inserted records.
When a new record is inserted into a database, ovsdb logs the values of all
of the fields in the record.  However, often new records have many columns
that contain default values.  There is no need to log those values, so this
commit causes them to be omitted.

As a side effect, this also makes "ovsdb-tool show-log --more --more"
output easier to read, because record insertions print less noise.  (Adding
--more --more to this command makes it print changes to database records.
The --more option will be introduced in an upcoming commit.)
2010-01-11 13:14:54 -08:00
Ben Pfaff
d918d9d112 Implement RFC 4122-compliant UUIDs.
This UUID library will be used by the upcoming configuration database.
2009-11-04 15:24:40 -08:00