ofproto: Remove ofproto_group_write_lookup()

ofproto_group_write_lookup() slightly different from
ofproto_group_lookup() in handling reference counting.
Currently, it has only one caller: modify_group().
It seems the abstraction is not adding value here.

Remove the function, along with some refactoring, makes modify_group()
easier to understand.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ryan Wilson <wryan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: remove a redundant assignment

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif-xlate: Simplify group_is_alive

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif-xlate: Coding style fix for bucket_is_alive()

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
makefile.am: Apply printf check only to OVS userspace.

We shouldn't restrict printf specifiers in kernel or third party
code.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
upcall: Remove redundant xlate_actions_for_side_effects().

As a result of commit a0bab87 (ofproto: Remove per-flow miss hash
table from upcall handler.) we're guaranteed that every packet has had
xlate_actions() called on it at least once.  Therefore, there's no
need to re-xlate slow path flows just to shove their packets through
the system.

This also may fix a bug discussed here:
http://openvswitch.org/pipermail/discuss/2014-April/013670.html

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Reported-by: Murphy McCauley <murphy.mccauley@gmail.com>
Acked-by: Ben Pfaff <blp@nicira.com>
netdev-dpdk: use defined values for queues length

Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
xcache: Remove unused field xc_entry.u.learn.ofproto.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
rhel: support persistent mac addresses on OVS bridges

This patch adds support for RHEL-derived systems (RHEL/CentOS/Fedora)
for setting the persistent MAC address of an OVS bridge via the MACADDR
setting in the interface configuration file.

Without this change, when an administrator provides MACADDR in the
interface configuration file that address will be set in ifup-eth using
the "ip link set" command.  While this appears to work, any operation
that updates the OVS configuration will cause the MAC address to revert.

Persistent MAC addresses must be set using ovs-vsctl.

(Resubmitted with whitespace and grammar corrections)

Signed-off-by: Lars Kellogg-Stedman <lars@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
AUTHORS: Add Lars Kellogg-Stedman.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-print: Merge ofp_print_stats_{reply, request}()

Merge ofp_print_stats_reply() and ofp_print_stats_request()
into a single new function, ofp_print_stats().

For stats replies there should be no run-time change in behaviour.

For pre-OpenFlow1.3 stats requests there should also be
no run-time change in behaviour.

For OpenFlow1.3+ stats requests the more flag is now printed
as present. Previously ***unknown flags 0x0001*** was printed.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
socket-util: Refactor unix specific code to a new file.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/flow: call memcmp in miniflow_equal()

This commit replace a while loop in miniflow_equal() with a call to
memcmp() for performace reasons.

Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif-xlate: Implement RCU locking in ofproto-dpif-xlate.

Before, a global read-write lock protected the ofproto-dpif
/ ofproto-dpif-xlate interface.  Handler and revalidator threads
had to wait while configuration was being changed.  This patch
implements RCU locking which allows handlers and revalidators
to operate while configuration is being updated.

Signed-off-by: Ryan Wilson <wryan@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
ovsdb-monitor.at: Changes for Windows.

ovsdb-client's 'monitor' command works with --detach such
that the parent detaches after printing initial transactions in
the database. This is a little tricky to implement
in windows. So for windows, send the process to background with
'&' and then sleep for a second to let the intial transactions
printed. (We can do the same for Linux, but it slows down the
test run)

Also let the perl script that looks at the o/p be aware of
CR LF in windows.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
bridge: Initialize dscp for mgmt connections.

Without it, garbage values make it to set_dscp function
in Windows.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ovs-ofctl: Flush monitored data.

Otherwise, on Windows unit tests, data sometimes is
not seen in output files.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ovs-ofctl: Enable the ability to 'detach' on Windows.

This is mostly for unit tests that use ovs-ofctl monitor.
service_start() creates a new process and waits till
daemonize_complete() is called by the child.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
socket-util: Log the kernel assigned port number when asked.

So far, we log the kernel assigned port number when the port number is
not specified. On Windows, this happens multiple times because "unix"
sockets are implemented internally via TCP ports. This means that many tests,
specially the ovs-ofctl monitor tests, need to filter out the
additional messages. Doing that is not a big deal, but I think it will
keep manifesting in future tests added by Linux developers.

With this commit, we simply don't print the kernel assigned TCP ports
on Windows when done for "unix" sockets.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Remove unused flows.txt from fin_timeout test

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>