2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-27 15:18:06 +00:00
Commit Graph

15 Commits

Author SHA1 Message Date
Russell Bryant
7fd06fc7b1 ovn: Fix check on existing encap row.
This code does some checking to validate the existing encaps for a
chassis to see if they need to be updated.  This typo resulted in
ovn-controller re-creating its encap(s) every time this code ran, making
ovn-controller and ovsdb-server eat up a CPU in my testing.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-11-03 16:18:59 -05:00
Justin Pettit
bf388125f6 ovn-controller: Support multiple encaps simultaneously.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-10-16 00:55:24 -07:00
Ben Pfaff
2ddf7558f2 ovn-controller: Un-inline get_chassis_by_name().
I don't know of any reason to inline this.

Also rename for consistency with get_bridge().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-10-15 21:27:46 -07:00
Ben Pfaff
4a5a9e0640 ovn-controller: Rename init functions that just register IDL columns.
The generic *_init() names for these functions made it sounds like they
do something more than just register IDL columns, even though that's all
they do.  Also, the controller_ctx that was passed into each of them was
only used to get the IDL handle.  This commit renames them and changes
their parameter type to simplify and make all of this clearer.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-07-30 10:11:53 -07:00
Ben Pfaff
30a4256fd0 ovn-controller: Tolerate missing 'chassis_id'.
Until now, if the chassis id was missing, ovn-controller exited.  This
commit makes ovn-controller wait for it to return.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-07-30 10:11:53 -07:00
Ben Pfaff
4acc496ecd ovn-controller: Pass 'chassis_id' explicitly to functions that need it.
I found it otherwise difficult to see what code depended on this.  When
later commits make it possible for ovn-controller to handle changes in
chassis ID, this will become important (the code should determine the
current chassis ID before trying to use it).

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-07-30 10:11:45 -07:00
Ben Pfaff
deab5e6703 ovn-controller: Factor encapsulation code out of chassis code.
These two pieces of code have different requirements and hardly anything in
common, and I found it easier to understand and reasonably modify the
overall structure of the program when they were separated.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-07-30 10:10:58 -07:00
Ben Pfaff
422a9f73d3 ovn-controller: Pass 'br_int' explicitly to functions that need it.
I found it hard otherwise to see what code depended on this.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
2015-07-28 11:06:51 -07:00
Ben Pfaff
f1fd765733 ovn-controller: Avoid blocking to commit OVSDB transactions.
Until now, ovn-controller has been full of loops that commit a transaction
to the OVS or OVN Southbound database.  These blocking loops delay other
work within ovn-controller.  They also make it unsafe to keep pointers to
database records within a single ovn-controller main loop, since calls
to ovsdb_idl_run() can cause IDL records to be destroyed.  This commit
drops all of the blocking calls, instead doing a single commit to the
databases at the end of each main loop.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
2015-07-28 11:06:47 -07:00
Ben Pfaff
6ad8ce88c3 ovn-controller: Verify bridge ports before changing.
OVSDB is transactional but it does not have built-in protection from dirty
reads.  To avoid those, it's necessary to manually add verification to
transactions to ensure that any data reads whose values were essential to
later writes have not changed.  ovn-controller didn't do that for
the "ports" column in the Bridge table, which means that if the set of
ports changed when it didn't expect it, it could revert changes made by
other database clients.

In particular this showed up in a scale test, where ovn-controller would
delete "vif" ports added via ovs-vsctl.

(It's easy to see exactly what happened by looking in the database log
with "ovsdb-tool -mm show-log".)

Reported-by: Russell Bryant <rbryant@redhat.com>
Reported-at: http://openvswitch.org/pipermail/dev/2015-June/056326.html
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-14 10:50:32 -07:00
Alex Wang
713322317c ovn: Change type of 'chassis' column in 'Binding' table.
This commit changes the type of 'chassis' column in 'Binding' table
from string to weak reference of 'Chassis' table entry.  This will
make accessing the chassis from binding more efficient.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-05-22 13:39:47 -07:00
Justin Pettit
e4901fe067 ovn-controller: Create tunnels based on Chassis configuration.
This creates a tunnel to each Chassis's specified Encaps.  In the
future, we may want to limit this to only Chassis that share a logical
datapath on the local system.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-04-30 23:08:54 -07:00
Justin Pettit
3442ca9b0b ovn-controller: Rename "chassis_name" to "chassis_id".
This makes it more consistent with other IDs in the system.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-04-30 23:08:39 -07:00
Ben Pfaff
e3df883845 ovn: Move all library files into ovn/lib, and merge libraries.
There is no value in having two separate libraries for OVN.

Reported-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-04-21 18:44:40 -07:00
Justin Pettit
717c7fc508 ovn: Introduce ovn-controller.
Add new ovn-controller daemon that runs locally on transport nodes.
This initial version registers itself in the Chassis table and registers
logical ports to the appropriate rows in the Bindings table.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
2015-04-12 10:11:06 -07:00