ofproto: Fix memory leak in ofproto_destroy().

Found by valgrind.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
ofproto-dpif-rid: Fix memory leak in recirc_id_pool_destroy().

recirc_id_pool_create() allocates memory but recirc_id_pool_destroy() did
not destroy it.

Found by valgrind.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
ofproto-dpif: Remove unused struct dpif_completion.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
ovs-ofctl: Document 'cookie' argument to learn action.

This has always been supported, but the documentation was missing.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
ovs-ofctl: Support "send_flow_rem" in "learn" actions.

This flag was overlooked when support for the "learn" action was added.
(It was always supported in the OpenFlow code, just not in the ovs-ofctl
interface.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
ofp-actions: Store cookie in network byte order in struct ofpact_learn.

Most other code in Open vSwitch that works with flow cookies keeps them
in network byte order.  Using network byte order in struct ofpact_learn,
also, reduces the number of byte order conversions needed across the
source tree.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
ofproto: Destroy rule in ofproto_get_vlan_usage().

Found by inspection.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
netflow: Fold netflow_expire() into netflow_flow_clear().

netflow_flow_clear() asserted that no packets or bytes were included
in the statistics for the flow being cleared.  Before threading Open
vSwitch, this assertion was always true because netflow_expire() was
always called before calling netflow_flow_clear().  Since Open
vSwitch was threaded, however, it was possible that a packet arrived
after netflow_expire() but before netflow_flow_clear(), since each of
these function separately took the netflow mutex.

This commit fixes the problem by merging netflow_expire() into
netflow_flow_clear(), under a single acquisition of the netflow
mutex.

Signed-off-by: Anoob Soman <anoob.soman@citrix.com>
[blp@nicira.com modified the patch to remove netflow_expire() and
 rewrote the commit message]
Signed-off-by: Ben Pfaff <blp@nicira.com>
acinclude.m4: dpdk: link with -ldl if necessary

On some systems libintel_dpdk.a fails to link with libopenvswitch
unless -ldl is used. This should address the issue

Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
test-flows: Change the way flows are read.

With Visual Studio and Msys combination, something is going
wrong when we do a '3<pcap' followed by fdopen(3, 'rb'). fdopen
fails. I do not know the exact reason for the failure. But the
workaround is straightforward.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
testsuite.at: pids can have zero after first character.

Fix the bug which did not kill the processes with pids that had
a zero in them. Also, some tests do a AT_CHECK([kill `cat pid`]) which
on windows prints something on the stdout causing the tests to fail.
So supress it.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
cmap: Rename a enum constant.

The constant MAX_PATH is already defined in Windows.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
daemon.at: Make changes for Windows.

Skip some of the tests that uses '--monitor' as an option as
it is not implemented on Windows.

When a 'kill pid' is done on windows (through 'taskkill //F'),
pidfiles are not deleted (because it is force kill), so use
'ovs-appctl exit' instead.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
.gitignore: Update with couple of Windows specific creations.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
INSTALL.DPDK: User space dpdk setup documentation addition.

Added details of dpdk poll mode setup to make it easier
for someone, not familiar, to get it operating.

Signed-off-by: Mike A. Polehn <mike.a.polehn@intel.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
netdev-dummy: add appctl netdev-dummy/conn-state command

Using without any parameter, this command list the connection
state of all netdev-dummy devices that are configured to make
active connections.

Optionally, the name of the netdev-dummy device can be supplied
as a parameter.

The states will be displayed as:

"connected": The socket has been connected to the listener.
"disconnected": The socket is not connected.
"unknown":  It is not an active dummy device.

CC: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
test: add WAIT_FOR_DUMMY_PORTS helper macro for writing tests

Add a macro to waiting until all ports supplied are connected.

CC: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
test: Remove explicit sleeps from ofproto-dpif bond tests

Ofproto-dpif bond tests relies on netdev-dummy ports to set up
socket connection before actual tests. The time required
for socket connection varies depends on system load, making the test
prone to failure with simple sleep calls. On the other hand,
conservative sleep value for the slowest machine may be excessive on
a faster machine.

This patch removes the sleep calls. Replace them with
WAIT_FOR_DUMMY_PORTS() introduced in the last patch, thus removing
the timing dependency.

CC: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Fix log message weird suffixes.

I think these were leftovers from the removal of %z for MSVC that happened
some time ago.

VMware-BZ: 1265762
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Pritesh Kothari <pritesh.kothari@cisco.com>
ofproto: Use OFPRR_GROUP_DELETE

Use OFPRR_GROUP_DELETE as the reason for deleting flows due
to the removal of a group that they use.

This implementation adds an delete_reason member to struct ofputil_flow_mod
as a convenient way to set the reason used by delete_flows__() when it is
called indirectly from delete_group__().

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com initialized the new member in a few more places]
Signed-off-by: Ben Pfaff <blp@nicira.com>