2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 05:47:55 +00:00

19894 Commits

Author SHA1 Message Date
Justin Pettit
30746a1b6a Mention running boot.sh when pulling sources from Git
When the sources are pulled directly from Git, it is necessary to run
"./boot.sh" before "./configure" can be run.  This commit documents that
useful bit of information.
2009-11-03 15:37:03 -08:00
Jesse Gross
0193b2afce netflow: Implement NetFlow active timeouts.
Provides a NetFlow expiration message at regular intervals if the
key netflow.<br>.active-timeout is set.

Feature #1317
2009-11-03 14:05:17 -08:00
Jesse Gross
6d91c2fb6c datapath: Allow TCP flags to be cleared.
When querying flow stats allow the TCP flags to be reset.  Since
the datapath ORs together all flags that have previously been
seen it is otherwise impossible to determine the set of flags from
after a particular time.
2009-11-02 16:12:21 -08:00
Jesse Gross
0c0afbecaa ofproto: Only zero stats for non exact-match sub-rules.
We zero the stats on sub-rules after they expire to prevent them
from being counted twice in their super-rule if they are reinstalled.
However, for exact-match sub-rules this means that the OpenFlow stats
are always zero.  This changes that to only zero the stats for
non exact match rules.

Bug #1911
2009-11-02 11:45:36 -08:00
Reid Price
d99e262b28 dump-vif-details: Safeguard 'finally' code
This makes several minor streamlining changes to dump-vif-details,
and moves the try statement in dump_vif_info to exclude session
initialization, so that finally will not obscure the original exception
with a new exception related to the session variable when logins fail.
2009-10-30 16:09:22 -07:00
Ben Pfaff
ac718c9dbd Implement library for lockfiles and use it in cfg code.
This is useful because the upcoming configuration database also needs a
lockfile implementation.

Also adds tests.
2009-10-29 15:20:56 -07:00
Ben Pfaff
8ca79daaa0 unixctl: Allow passing auxiliary data to unixctl commands.
This will allow users of unixctl to avoid using global variables, leading
to cleaner code.
2009-10-29 15:20:56 -07:00
Justin Pettit
3d3d15a0e6 openflow: Fix endian issues in flow expiration messages
A few of the fields in the OpenFlow flow expiration message were being
sent in host-byte order.  This properly converts them to network.

Thanks to David Erickson for catching this!
2009-10-28 17:15:57 -07:00
Justin Pettit
14a34fe401 xenserver: Print program name on error in dump-vif-details 2009-10-28 12:08:27 -07:00
Jesse Gross
6a07af3678 netflow: Populate NetFlow output interface field.
Previously NetFlow expiration messages always contained 0 as the
output interface index.  This changes that to report the OpenFlow
interface instead.

Feature #1202
2009-10-27 13:19:15 -07:00
Ben Pfaff
d6fbec6de0 Spell verb form of "set up" correctly throughout the tree. 2009-10-26 14:41:32 -07:00
Justin Pettit
9052790aac flow: Differentiate between "port" when printing flows
When printing a flow, there were two references to "port": one the
interface the packet arrived on and the other the L4 ports.  This could
be a bit confusing to new users looking at the output of a command such
as "ovs-ofctl dump-flows".  This commit changes the incoming interface
field from "port" to "in_port".
2009-10-26 12:29:49 -07:00
Justin Pettit
cdd35cff22 ovs-vswitchd: Document "bridge/dump-flows" management command 2009-10-26 12:29:49 -07:00
Jesse Gross
69d60f9f4e bridge: Allow flows based on ARP opcode to be installed.
Since we can now distinguish between flows with different ARP opcodes
in the kernel, allow these flows to be installed.
2009-10-26 11:32:35 -07:00
Ben Pfaff
dc81071d9f cfg: Fix implementation of timeout in attempting to lock the config file.
Without removing SA_RESTART from the SIGALRM handler, the fcntl call will
never return, even after the signal handler is invoked and returns.

We haven't seen a problem in practice, at least not recently, but that's
probably just luck combined with not holding the configuration file lock
for very long.
2009-10-23 11:52:05 -07:00
Ben Pfaff
e7cfedd6de Add test to ensure that time advances both normally and in a daemon.
This commit adds a test to ensure that the fix that makes daemonize()
reinitialize the periodic timer actually worked.
2009-10-23 11:52:05 -07:00
Ben Pfaff
9678a9b66c Distribute README-gcov, so that users building from tarballs can read it. 2009-10-23 11:52:05 -07:00
Ben Pfaff
3f355f47f8 Merge "citrix" into "master".
This merge took a little bit of care due to two issues:

    - Crossport of "interface-reconfigure" fixes from master back to
      citrix that had happened and needed to be canceled out of the merge.

    - New script "refresh-xs-network-uuids" added on citrix branch that
      needed to be moved from /root/vswitch/scripts to
      /usr/share/vswitch/scripts.
2009-10-22 17:43:28 -07:00
Jesse Gross
2416b8ecea bridge: Eject NORMAL flows without a learning entry from datapath.
When revalidating NORMAL flows we consult the learning table, which
could be empty if a packet hasn't come to userspace in a while or we
just did a bridge flush.  If there is no learning entry then existing
flows will begin flooding packets until a new flow is setup.  The
problem is worse with bonding because we can receive one of the flooded
packets back on a bond slave and learn that port, causing us to send
traffic to the wrong location.
2009-10-22 11:40:04 -07:00
Jesse Gross
5422a9e189 bonding: Balance bond slaves based on ratio.
Previously when deciding whether to migrate a hash between slaves
we would never move it if it would cause more load on the new slave
than the old.  This could lead to a situation where the slaves would
be imbalanced but no migration would occur since it would flip the
load.  This will do the migration if it will decrease the ratio.

Bug NIC-49
2009-10-20 19:26:55 -07:00
Jesse Gross
3a55ef1483 bonding: Drop unicast packets which have a different learned port.
Drop packets received on a bond port if we have learned a different
source port for that MAC.  We were already doing this for multicast
packets but extend the logic to unicast packets as well since the
same situation can occur if the connected switch has not learned the
MAC address and is flooding.  Otherwise vSwitch will learn the bond
port as the source of that MAC.

Bug #2167
2009-10-20 10:52:31 -07:00
Jesse Gross
450f38cf3c xen: Restore state files for VIF VLANs
A change on master to use ovs-vsctl instead of state files for VLANs
was ported to the citrix branch, which does not have ovs-vsctl.  The
interface reconfigure portion, which does not store the state files
was ported but the vif-hotput script portion was not.  This restores
interface reconfigure to again save the state files.

Bug #2187
2009-10-19 21:03:22 -07:00
Jesse Gross
adea354e28 xen: Correctly write VLAN key in config file.
When adding the VLAN key the name of the vif was from a variable in
use on only the xs5.7 branch.  This uses the correct variable name
for the master branch
2009-10-19 18:40:11 -07:00
Ben Pfaff
1125a1b9dc ovs-vsctl: Add tests that adding duplicate bridges or ports fails.
Suggested-by: Reid Price <reid@nicira.com>
2009-10-16 09:49:59 -07:00
Ben Pfaff
4d14e30f80 ovs-vsctl: Add the ability to perform multiple operations in a single run.
CC: Ian Campbell <Ian.Campbell@citrix.com>
2009-10-16 09:42:21 -07:00
Ben Pfaff
2792c2ad6d ovs-vsctl: Refactor internals to increase flexibility.
This changes the interface of each of the command implementations, making
them take the configuration as an argument and return the output.  This
will make it easier to support alternate output formats and to execute more
than one command per invocation (both happening in upcoming commits).
2009-10-16 09:36:25 -07:00
Ben Pfaff
3d1b9636b2 ovs-vsctl: Allow bridge name to be omitted from del-port command.
The 'bridge' argument to ovs-vsctl's del-port command is only supplied as
a form of error checking.  Sometimes the name of the bridge isn't readily
available, so for such situations this commit allows the user to omit the
name of the bridge entirely.

CC: Ian Campbell <Ian.Campbell@citrix.com>
2009-10-16 09:26:22 -07:00
Ben Pfaff
37c84020e9 ovs-vsctl: Log changes to configuration file to syslog.
This feature, which has been in ovs-cfg-mod for some time as the "-c"
option, makes it much easier to see what changes ovs-vsctl actually makes
to ovs-vswitchd.conf.

CC: <Ian.Campbell@citrix.com>
2009-10-16 09:26:20 -07:00
Ben Pfaff
03fbffbda4 Make sure that time advances in a daemon between calls to time_refresh().
Open vSwitch uses an interval timer signal to tell it that its cached idea
of the current time has expired.  However, this didn't work in a daemon
detached from the foreground session (invoked with --detach) because a
child created with fork() does not inherit the parent's interval timer and
we did not re-set it after calling fork().

This commit fixes the problem by setting the interval timer back up after
calling fork() from daemonize().

This fix is based on code inspection (which was then verified to be correct
through testing).  It may not fix any actual problems in practice, because
time_refresh() is called every time through the poll loop, and the poll
loop typically runs more quickly than the periodic timer fires (1 ms or so
average in ovs-vswitchd, vs. 100 ms timer interval).
2009-10-15 10:43:36 -07:00
Ben Pfaff
43a6c464ef datapath: Fix build with Linux 2.6.31.
Linux 2.6.31 breaks the network device functions pointers into a separate
"netdev_ops" structure, so we need to handle this case now too.
2009-10-15 10:24:36 -07:00
Ben Pfaff
5562d3ccd2 datapath: Ignore return value from rtnl_notify().
In Linux 2.6.30, the rtnl_notify() return type was changed from int to
void along with the following commit message:

    This patch also modifies the rtnetlink code to ignore the return
    value of rtnl_notify() in all callers. The function rtnl_notify()
    (before this patch) returned the error of the unicast notification
    which makes rtnl_set_sk_err() reports errors to all listeners. This
    is not of any help since the origin of the change (the socket that
    requested the echoing) notices the ENOBUFS error if the notification
    fails and should resync itself.

Thus there's no point in checking the return value, even in older versions
of the kernel, and so this commit changes our code to ignore it, even
on older kernel versions.  We also update the rtnl_notify() wrapper macros
to make the return type void on older kernel versions.

This has not been tested, just built.

Thanks to Mikio for spurring me to try building with Linux 2.6.29 and
2.6.30.
2009-10-15 10:24:36 -07:00
Ben Pfaff
1b378b99f6 datapath: Fix warning on 64-bit builds. 2009-10-15 10:24:36 -07:00
Ben Pfaff
7c40efc9d3 datapath: Factor out code for getting and setting listen mask.
This fixes GCC warnings on 64-bit architectures caused by storing an "int"
in the "void *" f->private_data field.
2009-10-15 10:24:36 -07:00
Jesse Gross
43aa5f47f1 vlan: Compare vlan tags before implicit tagging when RSPANing.
We check that a packet is not sent out the on the in port on the
same VLAN when performing RSPAN.  However, we were comparing the
vlan tag from a packet after implicit tagging with a tag from
before implicit tagging.  This ensures that we always compare them
before such tagging.
2009-10-09 12:42:31 -07:00
Ben Pfaff
aed944953b datapath: Fix build with Centos 5.3 kernel.
Centos 5.3 backports more functions from later kernel versions to 2.6.18,
so the kernel version number is no longer a reliable way to check for these
functions.  Thus, add a "configure" test for them.

Reported-by: Paulo Cravero <pcravero@as2594.net>
2009-10-09 09:44:51 -07:00
Ben Pfaff
bf7446a4f4 datapath: Add cpumask.h header wrapper to distribution.
This header was included in the Git tree but we failed to distribute it
as part of the tarball.

This problem was found by inspection.  I am not aware of an actual problem
this fixes.
2009-10-09 09:44:47 -07:00
Ben Pfaff
bc17490dfc xenserver: Crossport "master" interface-reconfigure to "citrix".
This commit copies the interface-reconfigure script from "master" into
"citrix" and fixes up a few incompatibilities: the location of ovs-cfg-mod,
which in master is in /usr/bin and in citrix is in /root/vswitch/bin, and
the RPM spec file fragments needed to initialize the database cache.

The purpose of this commit is to obtain the bug fixes that have been
applied (mainly by Ian Campbell) to "master" but which are not in "citrix".

It's difficult to understand the changes from this commit alone.  It is
more meaningful to compare the resulting files against those currently
on the master branch.
2009-10-08 15:17:32 -07:00
Jesse Gross
b3137fe852 ofproto: Make current packet counts more accurate.
When the stats for a currently active flow are requested this
ensures that the packets not handled by the kernel are counted
immediately.  Before, these packets would only be counted once
the kernel flow expired and the counts were combined.
2009-10-08 13:49:42 -07:00
Jesse Gross
97b7b2f410 bonding: Compare ports, not interfaces, for loop checks.
In order to avoid loops we check that the input and output ports
are not equal.  When selecting mirror outputs for RSPAN we were
checking interfaces instead of ports.  This lead to loops when
using RSPAN with bonded ports.

Bug #2118
2009-10-08 13:47:07 -07:00
Jean Tourrilhes
6a5d4138d6 ovs-ofctl: Fix use-after-free error in mod-flows command. 2009-10-08 10:42:14 -07:00
Jean Tourrilhes
a4fbb689b0 datapath: Fix validation of ODPAT_SET_VLAN_PCP actions.
The VLAN PCP mask is in the rightmost bits of the vlan_pcp member but we
were checking for it in its position in the VLAN tag field instead.

Slightly modified from Jean's original patch by adding and using the
VLAN_PCP_SHIFT macro.
2009-10-08 10:41:48 -07:00
Ben Pfaff
417a8cb6a6 xenserver: Fix ovs-vsctl in built RPM by defining /etc as sysconfdir.
By default, the "configure" script picks a sysconfdir of $prefix/etc,
which works out to /usr/etc in our case.  That's wrong, of course--it
should be /etc--but we didn't notice until now because sysconfdir was
only used in ovs-vsctl, which in turn wasn't used at all on a XenServer
system until recently.

This bug is present on all branches, but it is only potentially visible
on "master" and "xs5.7", since only those have ovs-vsctl.  It is only
actually visible on "xs5.7", since that is the only branch where the
system uses ovs-vsctl itself (from /etc/xensource/scripts/vif), but this
is being committed to master in case we start using ovs-vsctl there too.

Reported-by: Henrik Amren <henrik@nicira.com>
2009-10-07 10:19:31 -07:00
Justin Pettit
e7f327ff6b Merge commit 'v0.90.6' into citrix 2009-10-06 14:33:31 -07:00
Justin Pettit
ef5925df6a Prepare for v0.90.6 release. v0.90.6 2009-10-06 14:25:36 -07:00
Justin Pettit
96119ba43d xenserver: Fix dbcache location for xen-bugtool
I forgot to add my local changes to xen-bugtool that reflected the new
location for dbcache.
2009-10-06 11:38:57 -07:00
Justin Pettit
e8b52a913a Merge commit 'origin/citrix' 2009-10-06 11:35:29 -07:00
Justin Pettit
9e5ce56ddb xenserver: Include dbcache in xen-bugtool output
It has been pointed out that it would be useful to have a copy of the
dbcache file in the bug report.  This adds that.

Bug #2106
2009-10-05 17:32:36 -07:00
Jesse Gross
d83d6bbc3d netflow: Increase maximum number of NetFlow records to 30.
NetFlow v5 allows up to 30 records per packet but we were incorrectly
limiting to 29.  This corrects that and also uses the count of the
number of records in the header rather than the packet size since
it is easier to reason about.

Bug #2103
2009-10-05 13:25:19 -07:00
Ben Pfaff
4d678233e9 Merge "citrix" branch into "master. 2009-10-05 10:29:07 -07:00
Jesse Gross
c6303ea11b bonding: Update the link status on the bond fake interface.
Brings the fake bond interface up and down to match our notion of
whether the bond is currently active.  This solves an issue where
XenCenter would always show the bond as disconnected.

Bug #1703
2009-10-05 10:27:29 -07:00