bridge: Fix bug in equal_pathnames().

Reported-by: Pavithra Ramesh <paramesh@vmware.com>
Acked-by: Pavithra Ramesh <paramesh@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
FAQ: Add QoS section.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto: Avoid wild write removing OFPP_LOCAL port in dealloc_ofp_port().

Found by valgrind.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ovsdb: Fix double-free in ovsdb_jsonrpc_session_close().

ovsdb_session_destroy() was called twice but it should only be called once.

This double-free is unlikely to cause problems in practice because it only
triggers if there were ever more than two outstanding requests in the
session at a time (because the only data being freed is an hmap, which
does not allocate any heap memory unless the hmap has more than two
elements).

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ofproto-dpif: Scope revalidation state to dpif_backers.

Before this patch, the "need_revalidate" flag and the
"revalidate_set" tag_set where maintained separately for each
ofproto.  This won't work in future patches when a flow table
change in one ofproto can require revalidation in another entirely
separate ofproto.  For this reason, this patch scopes these flags
to the dpif_backers.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
ofproto-dpif: Refresh stats before ovs-appctl dpif/dump-flows.

As a matter of convenience, this patch refreshes the statistics
when ovs-appctl dpif/dump-flows is called.  Hopefully this will
prevent users from being confused because statistics they were
expecting to see haven't made it from the datapath into the switch
yet.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
ofproto-dpif: Implement patch ports in userspace.

This commit moves responsibility for implementing patch ports from
the datapath to ofproto-dpif.  There are two main reasons to do
this.

The first is a matter of design:  ofproto-dpif both has more
information than the datapath, and is better suited to handle the
complexity required to implement patch ports.

The second is performance.  My setup is a virtual machine with two
basic learning bridges connected by patch ports.  I used
ovs-benchmark to ping the virtual router IP residing outside the
VM.  Over a 60 second run, "ovs-benchmark rate" improves from
14618.1 to 19311.9 transactions per second, or a 32% improvement.
Similarly, "ovs-benchmark latency" improves from 6ms to 4ms.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
netdev-dummy: Test LACP negotiation.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
ovs-ofctl: Use vconn_open() instead of vconn_open_block() in open_vconn__().

All of the paths in open_vconn__(), except the one path that calls
vconn_open() directly, just start the connection and do not block until
it completes.  This changes the remaining path to work the same way.

This will be important in an upcoming commit when in some cases we need to
take an action between opening and connecting.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
rconn: Fix null pointer dereference in rconn_add_monitor().

rconn_add_monitor() tries to check the version of the controller
connection being monitored, so that it can decide what OpenFlow version to
tell the monitor connection to negotiate.  But at any given time an rconn
may not have a controller connection (e.g. during backoff), so rc->vconn
may be null and thus vconn_get_version(rc->vconn) dereferences a null
pointer.

Fixing the problem in a local way would require the rconn to remember the
previous version negotiated, and that fails if the rconn hasn't yet
connected or if the next connection negotiates a new version.

This commit instead adds the ability to a vconn to accept any OpenFlow
message version and modifies "ovs-ofctl snoop" to use that feature, thus
removing the need to negotiate the "correct" version on snoops.

Bug #14265.
Reported-by: Pratap Reddy <preddy@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Merge branch 'master' into bsd-port-threaded

Conflicts:
	lib/netdev-vport.c