2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-28 21:07:47 +00:00

663 Commits

Author SHA1 Message Date
Ben Pfaff
cca46d331e bridge: Downgrade log level of some log messages that may indicate races.
Some legitimate system activity can cause network devices to be destroyed
just before they are removed from the database, added to the database
just before they are created, or destroyed and then recreated under the
same name while other database activity is going on.  Logging these
events as errors makes it sound like something unexpectedly bad is going
on, but in fact these events are the most common instances of these log
messages, so downgrade them to warnings.

Reported-by: Reid Price <reid@nicira.com>
Bug #2584.
2011-03-14 16:40:42 -07:00
Ethan Jackson
55eccb868b vswitchd: Initialize configuration on active-backup bonds.
Some configuration settings which were not balance-[slb|tcp]
specific were only initialized for these bond types.

Bug #4806.
2011-03-04 11:42:15 -08:00
Ethan Jackson
7006c033dc ofproto: Change account_cb to use uint64_t.
This is more consistent with ofproto internals and its users.
2011-02-24 17:11:54 -08:00
Ben Pfaff
0b420b100a bridge: Ethernet address is 6 bytes, not 4 or 8.
'ea' here is a function parameter declared as an array, so "sizeof ea" is
sizeof(uint8_t *), which is either 4 or 8.

Coverity #10689, 10735.
2011-02-23 13:36:59 -08:00
Andrew Evans
289df16d29 ovsdb: Remove 'managers' column from 'Open vSwitch' table.
We had retained but deprecated the use of the older 'managers' column in the
'Open vSwitch' table for compatibility with applications that might still use
it, but that created more problems than it solved. This commit removes the
'managers' column from the schema, and removes all references to it from the
code, init scripts, documentation, and tests.
2011-02-18 11:09:29 -08:00
Ben Pfaff
0b8b6f71d5 Remove /proc/net compatibility support.
This feature was included only to allow Citrix QA to run some tests that
interacted directly with the bridge.  This feature hasn't been turned on
for some time, so it should not be necessary any longer.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-02-11 13:48:24 -08:00
Ethan Jackson
f48f70b7a3 vswitchd: Fix broken load rebalancing with balance-tcp.
Load rebalancing was not working in balance-tcp mode due to
mistaken balance-slb only assumptions leftover in the bridge code.
2011-02-10 17:12:13 -08:00
Ethan Jackson
f4709d4d7c vswitchd: Incoming LACP packets should un-default links. 2011-02-07 14:57:29 -08:00
Ethan Jackson
76ab2ea7fe vswitchd: LACP attached status flapped.
A bug introduced in the switch to bit mask LACP status caused the
attached status of interfaces in a LACP bond to slowly flap.
2011-02-07 14:37:51 -08:00
Ethan Jackson
ebe482fd21 vswitchd: Process special packets more aggressively.
Before this patch, special packets such as LACP and CFM messages
were only processed if they had NORMAL open flow actions.  With
this patch these messages are always processed unless originated in
ofproto_send_packet().
2011-02-07 14:17:35 -08:00
Ben Pfaff
a7ff9bd763 ovs-vswitchd: Complete daemonization only after initial configuration.
Otherwise when we add support for saving and restoring configuration
of internal devices around kernel module unload and reload, there's
no easy way for the "restore" code to tell when all the interfaces
should be set up and ready for configuration.
2011-02-07 12:50:19 -08:00
Ethan Jackson
cd48275890 vswitchd: LACP switch lacp_status to bit mask.
Much of the LACP status information attached to an interface is
moved from an enum to a bit mask in this commit.  The main reason
to do this is to allow a link to be concurrently expired and
defaulted.  With this commit, if a link enters an expired state,
but has never had its partner information update, it will properly
set the defaulted flag in its LACP messages.
2011-02-07 12:14:22 -08:00
Ethan Jackson
750d79a51b vswitchd: Instrument lacp_update_ifaces(). 2011-02-07 11:27:52 -08:00
Ethan Jackson
846f1be54c vswitchd: Fix format of LACP appctl output. 2011-02-07 11:27:52 -08:00
Ethan Jackson
8834f25e99 vswitchd: Tweak LACP values.
Hardware sets the default LACP partner information to 0 so this
commit follows.  The collector delay is a more interesting
case.  Hardware sets it to 32768 and Linux sets it to 0.  The
collector delay relates to a part of the LACP protocol which we
don't implement so we follow Linux in this case.
2011-02-07 11:27:51 -08:00
Ethan Jackson
edbad245ca vswitchd: Reset LACP partner when set off.
Without this patch, the LACP partner information will not be
cleared if LACP is turned off after a successful negotiation.
2011-02-07 11:27:51 -08:00
Ben Pfaff
4fadfb5644 vswitchd: Deconfigure CFM when not configured.
It looks to me like, once a CFM object is configured on an interface, it
will never get deconfigured.   This fixes the problem.

Found by inspection.  I haven't tested the original code or the fix.
2011-02-04 11:01:43 -08:00
Ben Pfaff
f915f1a8ca datapath: Consider tunnels to have no MTU, fixing jumbo frame support.
Until now, tunnel vports have had a specific MTU, in the same way that
ordinary network devices have an MTU, but treating them this way does not
always make sense.  For example, consider a datapath that has three ports:
the local port, a GRE tunnel to another host, and a physical port.  If
the physical port is configured with a jumbo MTU, it should be possible to
send jumbo packets across the tunnel: the tunnel can do fragmentation or
the physical port traversed by the tunnel might have a jumbo MTU.

However, until now, tunnels always had a 1500-byte MTU by default.  It
could be adjusted using ODP_VPORT_MTU_SET, but nothing actually did this.
One alternative would be to make ovs-vswitchd able to set the vport's MTU.
This commit, however, takes a different approach, of dropping the concept
of MTU entirely for tunnel vports.  This also solves the problem described
above, without making any additional work for anyone.

I tested that, without this change, I could not send 1600-byte "pings"
between two machines whose NICs had 2000-byte MTUs that were connected to
vswitches that were in turn connected over GRE tunnels with the default
1500-byte MTU.  With this change, it worked OK, regardless of the MTU of
the network traversed by the GRE tunnel.

This patch also makes "patch" ports MTU-less.

It might make sense to remove vport_set_mtu() and the associated callback
now, since ordinary network devices are the only vports that support it
now.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Suggested-by: Jesse Gross <jesse@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Bug #3728.
2011-02-04 09:46:26 -08:00
Ethan Jackson
9f5073d8a8 vswitchd: Implement balance-tcp bonding.
This commit implements a new bonding mode "balance-tcp" which takes
into account L4 flow information when hashing.  If LACP negotiation
is unsuccessful it automatically falls back to "balance-slb" bonding.

Bug #4213.
2011-02-03 12:26:58 -08:00
Ethan Jackson
c25c91fd5e vswitchd: Implement Link Aggregation Control Protocol.
This commit implements LACP, a protocol which allows directly
connected switches to automatically negotiate which links may
participate in bonds.  This commit disables LACP by default.  Once
sufficiently tested, LACP will be enabled in "active" mode on
bonded ports, and "passive" mode on all others.

Bug #4213.
2011-02-03 12:26:58 -08:00
Ethan Jackson
c835c3bf87 vswitchd: Cache interface carrier when bonding.
This commit caches each interface's carrier status when bonding is
enabled.  This allows port_update_bond_compat() to be called less
often, and will prove useful in future patches.
2011-02-03 12:24:13 -08:00
Ethan Jackson
abe457eb08 bridge: Cache bridge Ethernet address in struct bridge.
This patch stores each bridge's Ethernet address in its handle so
that it may be used in future patches.
2011-02-03 12:24:13 -08:00
Ethan Jackson
130f6e5faa packets: Add eth_addr_compare_3way function.
This commit adds eth_addr_compare_3way() which behaves like memcmp
for Ethernet addresses.
2011-02-03 12:24:13 -08:00
Ben Pfaff
7aec165dbc datapath: s/ODPAT_/ODP_ACTION_ATTR_/ to fit new naming scheme.
Jesse suggested this naming scheme, so I'm adjusting existing names to
fit it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-28 15:34:40 -08:00
Ben Pfaff
3d8c95357f dpif: Remove dpif_get_all_names().
None of the remaining dpif implementations have more than one name per
dpif, so there's no need for this function anymore.

Suggested-by: Jesse Gross <jesse@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-28 15:34:40 -08:00
Ben Pfaff
4c738a8da5 dpif: Eliminate "struct odp_port" from client-visible interface.
Following this commit, "struct odp_port" is only used in Linux-specific
parts of OVS userspace code.  This allows the actual Linux datapath
interface to evolve more freely.

Reviewed by Justin Pettit.
2011-01-27 21:08:37 -08:00
Ben Pfaff
6d9e6eb44f netdev: Make netdev arguments fetchable, and implement for netdev-vport.
This gives network device implementations the opportunity to fetch an
existing device's configuration and store it as their arguments, so that
netdev clients can find out how an existing device is configured.

So far netdev-vport is the only implementation that needs to use this.

The next commit will add use by clients.

Reviewed by Justin Pettit.
2011-01-27 21:08:36 -08:00
Ben Pfaff
b0ec0f279e datapath: Change listing ports to use an iterator concept.
One of the goals for Open vSwitch is to decouple kernel and userspace
software, so that either one can be upgraded or rolled back independent of
the other.  To do this in full generality, it must be possible to add new
features to the kernel vport layer without changing userspace software.  In
turn, that means that the odp_port structure must become variable-length.
This does not, however, fit in well with the ODP_PORT_LIST ioctl in its
current form, because that would require userspace to know how much space
to allocate for each port in advance, or to allocate as much space as
could possibly be needed.  Neither choice is very attractive.

This commit prepares for a different solution, by replacing ODP_PORT_LIST
by a new ioctl ODP_VPORT_DUMP that retrieves information about a single
vport from the datapath on each call.  It is much cleaner to allocate the
maximum amount of space for a single vport than to do so for possibly a
large number of vports.

It would be faster to retrieve a number of vports in batch instead of just
one at a time, but that will naturally happen later when the kernel
datapath interface is changed to use Netlink, so this patch does not bother
with it.

The Netlink version won't need to take the starting port number from
userspace, since Netlink sockets can keep track of that state as part
of their "dump" feature.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27 21:08:36 -08:00
Ben Pfaff
d6da96ce2b vswitchd: Initialize SSL keys before making SSL connections.
Otherwise, if SSL is configured at startup then the first connection
attempt fails with warnings about keys not be configured.

Bug #4448.
2011-01-25 17:10:48 -08:00
Andrew Evans
eb9b830766 bridge: Check for null ofproto_controller_info pointer.
This fixes a bug I introduced in commit bffc0589.

Reported-by: Bryan Fulton <bryan@nicira.com>
Bug #4474.
2011-01-24 17:12:47 -08:00
Andrew Evans
bffc058934 bridge: Add controller status to Controller table.
Get status information for controller(s) attached to each bridge and store in
Controller table every 5 seconds.
2011-01-23 22:16:53 -08:00
Andrew Evans
e210037edd bridge: Store status of physical network interfaces in Interface table.
New columns in Interface table: admin_state, link_state, link_speed, duplex,
mtu.

New keys in status map in Interface table: driver_name, driver_version,
firmware_version.

Requested-by: Peter Balland <pballand@nicira.com>
Bug #4299.
2011-01-18 21:09:02 -08:00
Ethan Jackson
b42c5c2404 vswitchd: Display miimon interval.
Causes bond/show to display the miimon interval for bonded ports
when configured to use miimon instead of carrier.

Requested-by: Michael Mao <mmao@nicira.com>
Bug #4418.
2011-01-18 16:13:14 -08:00
Ethan Jackson
6333182946 vswitchd: Add miimon support.
This commit allows users to check link status in bonded ports using
MII instead of carrier.
2011-01-12 15:50:20 -08:00
Ethan Jackson
27dcaa1ac8 vswitchd: Rename bond_mode configuration.
This commit renames bond_type to bond_mode to be more consistent
with XenServer configuration.  It also renames the "slb" bond_mode
to "balance-slb".
2011-01-11 16:19:43 -08:00
Ethan Jackson
ea763e0e28 bridge: Move tunnel_egress_iface to status column.
This commit removes the tunnel_egress_iface column from the
interface table and moves it's data to the status column.  In the
process it reverts the database to version 1.0.0.
2011-01-11 12:33:44 -08:00
Ethan Jackson
be02e7c371 vswitchd: Active backup bonding.
This commit adds active backup bonding support to vswitchd.

Bug #4210.
2011-01-07 12:43:43 -08:00
Ethan Jackson
7ca5f24311 vswitchd: Fix segmentation fault with bonded ports.
This commit fixes a segmentation fault which could occur when a
bonded port was destroyed.
2011-01-07 12:43:43 -08:00
Ethan Jackson
6b4186af06 vswitchd: Whitespace fixups.
Removed tabs from vswitch.xml.  Removed trailing whitespace from
the bridge.
2011-01-07 12:43:43 -08:00
Ethan Jackson
ea83a2fcd0 lib: Show tunnel egress interface in ovsdb
This commit parses rtnetlink address notifications from the
kernel in order to display the egress interface of tunnels in the
database.

Bug #4103.
2011-01-04 12:35:59 -08:00
Justin Pettit
fe4838bc70 vswitch: Remove unnecessary iface_get_options function
Since GRE-over-IPsec is a proper tunnel type and no longer configured
through "other_config", we can remove this function that folded an
interface's "other_confg" into "options".
2010-12-28 14:30:36 -08:00
Ben Pfaff
ee45ad81ab ovs-vswitchd: Release most memory on normal exit.
This makes "valgrind --leak-check=full --show-reachable=yes" output much
easier to read.
2010-12-13 14:29:13 -08:00
Ben Pfaff
83c19ab15a vswitchd: Delete DP_MAX_PORTS.
This is no longer used.
2010-12-13 14:29:13 -08:00
Ben Pfaff
0c62a7ad88 vswitchd: Fix dependency on DP_MAX_PORTS for allocating "struct dst"s.
Until now, compose_actions() has allocated enough "struct dst"s on the
stack for a worst-case flow, one that floods packets with the maximum
number of ports and mirrors.  When the code was written this was correct.
However, now the number of ports is no longer known at compile time.  The
maximum number, 65535, would require (65536 * (32 + 1) * 4) == 8 MB of
stack space, which is a lot.  So this commit fixes the problem a different
way, by allocating the "struct dst"s dynamically when necessary.

This is a bug fix, but not a very serious one, because it could only
become a buffer overflow with a large number of mirrors.
2010-12-13 14:28:53 -08:00
Ben Pfaff
c47cd5f013 bridge: Eliminate bond_rebalance_port() dependency on DP_MAX_PORTS.
There's no reason to allocate the bals[] array on the stack here, since
this is not on any fast-path.

As an alternative, we could limit the number of interfaces on a single
bond to some reasonable maximum, such as 8 or 32, but this commit's change
is simpler.
2010-12-13 14:26:18 -08:00
Jesse Gross
cf22f8cba3 vswitchd: Consistently use size_t for action lengths.
Currently the type of the datapath action length is mixture of
size_t and unsigned int.  However, size_t is really defined as an
unsigned long, which causes the build to fail on 64-bit platforms.
This consistently uses size_t.
2010-12-13 11:07:15 -08:00
Ben Pfaff
cdee00fd63 datapath: Replace "struct odp_action" by Netlink attributes.
In the medium term, we plan to migrate the datapath to use Netlink as its
communication channel.  In the short term, we need to be able to have
actions with 64-bit arguments but "struct odp_action" only has room for
48 bits.  So this patch shifts to variable-length arguments using Netlink
attributes, which starts in on the Netlink transition and makes 64-bit
arguments possible at the same time.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2010-12-10 11:13:32 -08:00
Ethan Jackson
e58de0e386 vswitchd: Incorporate vlan into bond hash.
With this patch vlan tags are incorporated into bond hashes in
addition to the source mac address.

NIC-294
2010-12-06 13:59:43 -08:00
Ethan Jackson
557c178b31 vswitchd: Remove bond/migrate MAC argument.
Before this patch one could specify a mac address as part of the
bond/migrate command.  This will no longer make sense as bond
hashing becomes more complicated.
2010-12-06 13:55:09 -08:00
Ethan Jackson
a27598cdb2 vswitchd: Correct indentation in bridge.
The "bond_unixctl_hash" function was using tabs instead of spaces.
2010-12-06 13:55:09 -08:00