2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00
Commit Graph

17132 Commits

Author SHA1 Message Date
Ben Pfaff
431d8ad2a0 secchan: Fix bad pointer dereference sending flow expirations. 2009-09-14 13:37:08 -07:00
Ben Pfaff
cb5087cadd datapath: Fix WARN_ON sending GSO packets to userspace in Linux 2.6.22+.
Until now, when dp_output_control() queued a GSO packet to userspace, it
would first compute the checksum for the whole GSO packet, then break the
packet into segments.  However this had two drawbacks:

    1. The checksum had to be recomputed for each segment, wasting time.
    2. Linux 2.6.22 and later would emit a warning in skb_gso_segment()
       because the checksum was precomputed.

This commit changes dp_output_control() to instead break the packet into
segments, then compute the checksum across each of the segments
individually.  This fixes both drawbacks.

This commit has seen light testing on Xen's 2.6.27.  It has been build
tested on a few different kernel versions.
2009-09-14 12:20:00 -07:00
Ben Pfaff
0d3b8a34d6 datapath: Fix comments. 2009-09-14 12:20:00 -07:00
Ian Campbell
2e44e26d10 ovs-vsctl: additional commands for querying VLAN fake bridges.
Our test automation needs to be able to validate that a VLAN bridge and
for this I needed two new operations in ovs-vsctl:
      * The ability to query the VLAN tag for a bridge.
      * The ability to query the 'parent' of a bridge. The parent is the
        non-VLAN/untagged bridge with the same physical devices and
        could be a bond.

So given xenbr0 (containing eth0) + xapi2 (VLAN 42 on eth0) and xapi1
(containing bond0 == eth2+eth3) + xapi3 (VLAN 23 on the bonded
interface):

[root@warlock ~]# ovs-vsctl br-to-vlan xapi2
42
[root@warlock ~]# ovs-vsctl br-to-vlan xapi3
23
[root@warlock ~]# ovs-vsctl br-to-parent xapi2
xenbr0
[root@warlock ~]# ovs-vsctl br-to-parent xapi3
xapi1
2009-09-14 11:27:42 -07:00
Ben Pfaff
3b135da329 New utility ovs-vsctl. 2009-09-14 10:05:13 -07:00
Justin Pettit
2e8873af89 vswitch: Correctly identify slave status in /proc compatibility layer
In the /proc compatibility layer, the bond member was reported as up
immediately after link recovery, regardless of the updelay.  I believe
the compatibility code was correct if the check had been done with carrier,
but since 'iface->enabled' already does that calculation, we can use it
directly.

Additinally, when a bond slave was enabled or disabled, the bond
compatibility code was not being told to update its state.  This commit
makes that call.

NIC-39
2009-09-14 09:42:21 -07:00
Ben Pfaff
30a2c8b162 Raise MAC learning table capacity from 1,024 to 2,048 entries per bridge.
Given a possible 1,024 ports on a bridge the previous limit of 2,048
entries seems low.

If we want to increase this further we should introduce dynamic allocation
of table entries to avoid wasting memory in the common case.

CC: Keith Amidon <keith@nicira.com>
2009-09-14 09:26:37 -07:00
Ben Pfaff
5eab9abcd3 datapath: Raise maximum ports per datapath from 256 to 1024.
This makes the datapath port limit the same as the Linux bridge module
port limit.

CC: Keith Amidon <keith@nicira.com>
2009-09-14 09:26:37 -07:00
Justin Pettit
43a0e3476d xenserver: Have xen-bugtool collect OVS logs
The original xen-bugtool did not collect any OVS logs.  Now that more
logging is moving from /var/log/messages to ovs-vswitchd's and
ovs-brcompatd's private log files, we should include them in the
information collected for bug reports.
2009-09-12 16:40:03 -07:00
Justin Pettit
39fb08818b Merge commit 'origin/citrix'
Conflicts:
	vswitchd/ovs-vswitchd.8.in
	vswitchd/ovs-vswitchd.conf.5.in
	xenserver/etc_init.d_vswitch
2009-09-12 00:49:30 -07:00
Justin Pettit
7646deb6ec Merge commit 'origin/ctrix' into k 2009-09-11 18:40:38 -07:00
Justin Pettit
e3951e76bc xenserver: Have ovs-brcompatd's log file rotated
Suggested by Ian Campbell.
2009-09-11 18:09:19 -07:00
Jean Tourrihles
dc6fe1d7ee vconn: Fix byte-swapping of message type when validating OpenFlow actions.
It seems really strange that this one slipped through.  Perhaps this
means that we have never tested with any action other than OFPAT_OUTPUT
(which has value 0 and thus is not affected by byte-swapping).
2009-09-11 15:19:15 -07:00
Ben Pfaff
6867bc3633 xenserver: Install kernel modules in proper system locations.
This gets rid of the last files in /root/vswitch.  With this change, the
Open vSwitch RPMs should now comply with FHS (http://www.pathname.com/fhs/).
2009-09-11 15:13:57 -07:00
Ben Pfaff
eaa3c7e88b xenserver: Install into /usr instead of /root/vswitch.
/usr is the standard location for installation, so use that instead of our
nonstandard location under /root.

This migrates everything except the kernel modules to /usr.  The kernel
modules will be migrated in an upcoming commit.

One possibly surprising change is that the manpages listed in the %files
section of vswitch-xen.spec not only moved but added .gz extensions.  This
seems to be because RPM automatically compresses manpages, but only if they
are installed in a standard system location.
2009-09-11 15:13:08 -07:00
Ben Pfaff
ac9634f0af xenserver: Make RPM install work again.
The RPM install was generating a database cache in Python pickle format in
/etc/ovs-vswitchd.conf, but interface-reconfigure was looking for it in
XML format in /var/lib/openvswitch/dbcache.  This fixes the problem, by
adding an init-dbcache command to interface-reconfigure and then using that
at RPM install time.

This moves the database cache creation from %pre to %post.  This is
necessary so that interface-reconfigure is available from the install
script.
2009-09-11 14:41:39 -07:00
Ben Pfaff
0d46ae039b xenserver: Remove dead store from interface-reconfigure.
No point in looking up pifrec if we're not going to use it.
2009-09-11 14:06:14 -07:00
Ben Pfaff
fcf78c4ff9 xenserver: Remove unmaintained comments in interface-reconfigure.
I added these comments a long time ago and have not kept them up-to-date,
so it is probably better to delete them than to confuse people.
2009-09-11 14:06:14 -07:00
Ben Pfaff
fe8b662b2d xenserver: Fix syntax error in vswitch-xen.spec %pre fragment. 2009-09-11 13:18:14 -07:00
Justin Pettit
d4016a58d2 xenserver: Set default file log level and fix brcompatd file
Set the default log level for file logging to INFO for ovs-vswitchd and
ovs-brcompatd.  This is done so that coverage messages are kept in the
log file, since we no longer log them through syslog due its synchronous
writing on Xen hosts.  The issue is described in detail in commit 6bc995e.

Fix test for whether file logging should be enabled for ovs-brcompatd.

Reported by Ian Campbell.
2009-09-11 10:54:39 -07:00
Justin Pettit
6bc995e46d logging: Lower logging level for coverage messages due to slow poll loops
By default, many OVS processes keep track of their time through a poll
loop.  If it takes an unusually long time (measured as some distance
from the mean), the processes will log stats it has been keeping about
coverage.  It was doing this at level WARN.

On Xen systems, syslog messages written at level INFO and higher are
written to /var/log/messages synchronously.  This would mean that there
would be dire messages that it took a few dozen milliseconds to go
through the loop, meanwhile, it would take up to 6(!) seconds writing
those.  Meanwhile, the process would do no other processing, which could
be quite serious in the case of a process such as ovs-vswitchd.
This problem was somewhat masked because the time used by this logging
was not used in the calculations for determining how long it was taking
to get through the loop.

This commit lowers the default log level for those coverage messages to
INFO.  On Xen systems, it raises the default level at which messages are
written to syslog to WARN.

Diagnosed and fixed with the help of Ian Campbell.
2009-09-11 10:49:27 -07:00
Ben Pfaff
b16fdafe57 Document ovs-vswitchd's ovs-appctl commands and some ovs-vswitchd internals.
CC: Justin Pettit <jpettit@nicira.com>
2009-09-09 11:16:55 -07:00
Ben Pfaff
c2abdb7ec6 Increase the default priority of vswitchd and brcompatd
Our hope is that this will resolve many of the issues we have seen
where temporary delays in the forwarding of packets have caused issues
of various types.

This is a crossport from master of commit 44cb492 by Ian Campbell.
2009-09-09 10:52:26 -07:00
Ben Pfaff
8850d6d2d1 Revert "xenserver: Renice netback process to priority 0 by default."
This reverts commit 641a0a4ed0.

This is a crossport from master of commit b2cdfea by Ian Campbell, with
the following commit message:

Do not renice the netback thread.

We should increase the vswitchd daemon's priority instead.
2009-09-09 10:50:32 -07:00
Ian Campbell
44cb492f46 Increase the default priority of vswitchd and brcompatd
Our hope is that this will resolve many of the issues we have seen
where temporary delays in the forwarding of packets have caused issues
of various types.
2009-09-09 10:45:51 -07:00
Ian Campbell
b2cdfeae16 Do not renice the netback thread.
We should increase the vswitchd daemon's priority instead.

Reverts 641a0a4ed
2009-09-09 10:45:48 -07:00
Ian Campbell
5de7052b9b Only write Network.PIF elements for this host to dbcache. 2009-09-09 10:41:45 -07:00
Ian Campbell
b88907e798 Add PIF.currently_attached to the list of fields used by interface-reconfigure 2009-09-09 10:41:41 -07:00
Ian Campbell
e44d184463 Move vswitch state files to /var/lib.
I believe this is the correct location for files of this type.
2009-09-09 10:41:38 -07:00
Ben Pfaff
1cee7f2815 xenserver: Don't (try to) remove log files on RPM uninstall.
The RPM spec file was trying to remove Open vSwitch log files as part of
the RPM uninstall process.  It wasn't succeeding, however, since the glob
pattern was wrong.

Instead of fixing the glob pattern, just stop trying to remove the log
files.  Log files are, after all, important for trying to debug problems,
and if we delete them at uninstall time then that makes life harder.
2009-09-08 13:34:12 -07:00
Ben Pfaff
df9fd4a52e xenserver: Improve readability of /etc/init.d scripts.
Less redundancy makes code easier to read.
2009-09-08 13:34:07 -07:00
Ben Pfaff
3cbe3ea5a7 xenserver: Don't install at same time as XS 5.5.900 "openvswitch" package.
XenServer 5.5.900 installs an "openvswitch" package that this package
conflicts with, so add a "Conflicts: openvswitch" to the RPM packaging.
2009-09-08 13:20:35 -07:00
Ben Pfaff
a320b3413d xenserver: Avoid "rpm -i" warnings on XenServer 5.5.900.
Open vSwitch installs successfully on XenServer 5.5.900 but it prints some
worrying messages during the process.  This commit fixes them.
2009-09-08 13:18:13 -07:00
Ben Pfaff
7983f00289 vswitch: Document that fail-open is enabled by default.
The vswitchd.conf manpage said that fail-open is disabled by default.  This
is wrong: it is enabled by default.  This commit fixes the documentation.

CC: Sujatha Sumanth <ssumanth@nicira.com>
2009-09-08 13:13:35 -07:00
Ben Pfaff
b1040b1701 vswitchd: Fix typo in comment. 2009-09-08 12:54:24 -07:00
Justin Pettit
8398cf7efc Merge commit 'origin/citrix' 2009-09-04 22:23:29 -07:00
Justin Pettit
a393b897f2 datapath: Don't drop MTU-sized VLAN packets from userspace
Before transimitting a packet, the datapath checks that the packet
length is not greater than the MTU.  It determines the length based on
the 'protocol' field in the skb.  If 'protocol' is ETH_P_8021Q, it reduces
the packet length as stored in the 'len' field by four bytes, which
is the size of a VLAN tag header.  Unfortunately, packets that arrived
from userspace were not having the 'protocol' field set, which would
cause MTU-sized packets to be dropped.  This commit sets the 'protocol'
field appropriately.

Thanks to Ben Pfaff for the help diagnosing this issue.

NIC-17 and NIC-26
2009-09-04 22:19:15 -07:00
Ben Pfaff
692c92e092 xenserver: Install /etc/sysconfig/vswitch by default.
Until now, the vswitch RPM has installed /etc/sysconfig/vswitch.example
and made the system administrator copy it to /etc/sysconfig/vswitch if he
desires.  This is slightly inconvenient, since it is slightly easier for
the admin if he can just edit /etc/sysconfig/vswitch directly.  This commit
changes to the latter behavior.

Bug #1810.
2009-09-03 14:28:44 -07:00
Ben Pfaff
b1bdd85cab xenserver: Create vswitchd configuration file if it does not exist.
/etc/ovs-vswitchd.conf should always be there.  Nevertheless, it is not
nice to entirely break vswitch if it is accidentally deleted.  This commit
makes /etc/init.d/vswitch create an empty configuration file if it is
missing.

Bug #1821.
2009-09-03 13:00:11 -07:00
Ben Pfaff
fdc8be4e6d vswitchd: Explain why mirroring to a VLAN can cause network problems.
Bug #1963.
2009-09-03 12:58:40 -07:00
Ben Pfaff
875673c139 xenserver: Document all the /etc/sysconfig/vswitch settings.
Bug #1853.
2009-09-03 11:53:31 -07:00
Ben Pfaff
19d1ab55ae rconn: Speed up in-band control connections, by caching the remote address.
In-band control needs to know the IP and port of the controller, so that
it can set up the correct flows to talk to that controller.  Until now,
the rconn code has only made this available when a connection was actually
in progress.  This means that, say, ARP packets will not be allowed through
when the rconn backs off.  The same is true of packets sent by switches
that access the controller through this one.

This commit makes the rconn cache the remote IP and port and local IP
across connection attempts, improving the situation.  In particular, it
reduces the overall amount of time that it takes to connect in my own
simple test case from over 10 seconds to about 2 seconds.
2009-09-02 12:52:50 -07:00
Ben Pfaff
c3a519b5c9 vconn-tcp: Report correct remote IP and remote port.
TCP vconns were reporting indeterminate remote IP and remote port, which
prevented in-band control from working for TCP vconns.

The code that this fixes is implemented differently on the citrix branch
and thus the bug was not present there.
2009-09-02 11:16:40 -07:00
Ben Pfaff
c0a5fd2aed ofproto: Fix bad merge in previous commit.
This was fixed in my working tree before I pushed it, but I forgot to
commit it.  Oops.
2009-09-02 11:11:38 -07:00
Ben Pfaff
f1acd62b54 Merge citrix branch into master. 2009-09-02 10:14:53 -07:00
Justin Pettit
0ad9b73291 in-band: Implement L3-based in-band control
Previously, in-band control was L2-based.  This worked well when the
controller was on the same network segment as the switch.  However, many
configurations are not set up this way.  These changes allow a switch and
controller to be on different subnets.

This set of changes also fixes some problems related to passing DHCP
traffic as described in Bug #1618.

A full description of the reasoning and supported configurations of
in-band will be forthcoming.
2009-09-01 14:48:34 -07:00
Justin Pettit
bd193a0aba dpif: Add dpif_port_get_name call
Add ability to lookup a device name by its dpif port number.
2009-09-01 14:48:34 -07:00
Justin Pettit
13063c3b38 netdev: Add netdev_get_next_hop call
Add ability to determine the next hop IP address and device used to
reach a given host.
2009-09-01 14:48:34 -07:00
Justin Pettit
a26ef51703 Add ability for the datapath to match IP address in ARPs
The ability to match the IP addresses in ARP packets allows for fine-grained
control of ARP processing.  Some forthcoming changes to allow in-band
control to operate over L3 requires this support if we don't want to
allow overly broad rules regarding ARPs to always be white-listed.
Unfortunately, OpenFlow does not support this sort of processing yet, so
we must treat OpenFlow ARP rules as having wildcarded those L3 fields.
2009-09-01 14:48:34 -07:00
Justin Pettit
f10725fea5 Return netmask along with IP address when querying through netdev
The call netdev_get_in4() now allows the caller to also retrieve the
associated netmask.
2009-09-01 14:48:34 -07:00