FAQ: Explain the difference between a switch and a bridge.

(There isn't any difference.)

Based on a conversation in #openvswitch.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
ofproto: Better hide hidden tables.

ofproto has a concept of "hidden" OpenFlow tables.  Currently these are
used internally only for ofproto-dpif for a couple of unimportant
purposes.  However, hidden tables were not hidden well enough, because
OFTest was able to spot ofproto-dpif's hidden table and, seeing that it
had a couple of flows in it even after OFTest had tried to delete all
flows, failed at least one test.

This commit hides the tables better:

    - The number of tables reported in a feature reply no longer counts
      hidden tables.

    - Table stats replies omit hidden tables.

This commit introduces the requirement that hidden tables, if any, be the
highest-numbered tables.  This is because it's not clear to me that
OpenFlow intends to allow tables to be numbered noncontiguously.

We could take this further, by not exposing hidden tables in any way, but
I have this pet theory that being able to get the statistics for these
tables will come in handy for debugging someday.

Found by openflow_protocol_messages.ModifyStateDelete in OFTest.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Process RARP packets with ethertype 0x8035 similar to ARP packets.

With this commit, OVS will match the data in the RARP packets having
ethertype 0x8035, in the same way as the data in the ARP packets.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
ofproto: Report 0 Mbps when speed not available instead of 100 Mbps.

When a link is down, or when a link has no speed because it is not a
physical interface, Open vSwitch previously reported that its rate is 100
Mbps as a default.  This is counterintuitive, however, so this commit
changes Open vSwitch behavior to report 0 Mbps when a link is down or its
speed is otherwise unavailable.

Bug #13388.
Reported-by: Hiroshi Tanaka <htanaka@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
util: Group functions for bitwise tests.

This only moves code around for more logical grouping.

Signed-off-by: Ben Pfaff <blp@nicira.com>
util: New functions for the index of the leftmost or rightmost 1-bit.

These will acquire a user in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-util: Add functions to support version number bitmaps.

The bitmap is simple a uint32_t, allowing for versions up until
wire-protocol number 31.

Bit offsets correspond to ofp_version numbers which in turn
correspond to wire-protocol numbers for Open Flow versions..
E.g. (1 << OFP10_VERSION) is the mask for Open Flow 1.1.
If the bit for a version is set then it is allowed, otherwise it is
disallowed.

This is in preparation for allowing the range of allowed OpenFlow
versions to be configured.

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com simplified some functions to constants, and rewrote
 a few functions in terms of utility bitwise functions]
Signed-off-by: Ben Pfaff <blp@nicira.com>
vconn: Replace minimum version with bitmap of allowed versions.

This is in preparation for allowing the range of allowed OpenFlow versions
to be configured.

As part of this change pvconn_open() is now paramatised over the allowed
versions.  this is to avoid avoids needing to provide version information
as a parameter to pvconn_accept().  This will in turn avoid the need to
pass version information to connmgr_run().

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com simplified slightly and generalize log messages]
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-util: Add version bitmap support to hello messages.

Allow encoding and decoding of version bitmap in hello messages
as specified in Open Flow 1.3.1.

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com simplified and generalized decode/encode functions]
Signed-off-by: Ben Pfaff <blp@nicira.com>
connmgr: Parameterize ofservice_create() over allowed OpenFlow versions

This is in preparation for allowing configuration of the
allowed OpenFlow versions.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Update master to reflect updates on branch-1.9

This commit updates NEWS and debian/changelog to reflect that
commit 8087f5ff (Process RARP packets with ethertype 0x8035
similar to ARP packets.) is going to be backported intto 1.9.0, so
that they should no longer be listed as post-1.9 features.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Correct the warning for format specifier.

ofputil_format_version uses type 'size_t' to print version whereas
expected type is 'unsigned int'.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
datapath: Add Upstream id for GRE type.

Once GRE is upstream it will have new type to have continuous sequence
of ids for vport type.  Following patch adds this ID to have
compatibility with it.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath: enable encap for capwap.

kernel 3.5 added a switch to turn on UDP encap, capwap needs
to enable it.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
netdev: Deprecate CAPWAP support.

The CAPWAP implementation is just the encapsulation format and
therefore really not the full protocol.  While there were some
uses of it (primarily hardware support and UDP transport).  But
these are most likely better provided by VXLAN.  As a result,
CAPWAP will be removed no earlier than February 2013.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
datapath: Fix sparse warning for symbol 'BUILD_BUG_ON_NOT_POWER_OF_2'

BUILD_BUG_ON_NOT_POWER_OF_2 symbol is moved from kernel.h to
bug.h in 3.4.  Therefore sparse is giving warning:

include/linux/bug.h:15:9: warning: preprocessor token
BUILD_BUG_ON_NOT_POWER_OF_2 redefined
ovs/datapath/linux/compat/include/linux/kernel.h:44:9:
this was the original definition

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath: Remove tunnel header caching.

Tunnel caching was added to reduce CPU utilization on TX path
by caching packet header, So performance gain is directly proportional
to number of skbs transferred.  But with help of offloads skb are getting
larger. So there are less number of skbs.  Therefore header caching does
not shows similar gains we seen in past.  And now kernel 3.6 has removed
dst caching from networking which makes header caching even more tricky.
So this commit removes header caching from OVS tunnelling.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath: Add support for 3.6 kernel.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath: Add missing bug.h file

Commit 51f4701be1 (datapath: Fix sparse warning for symbol
'BUILD_BUG_ON_NOT_POWER_OF_2') missed file bug.h. Commiting it now.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
datapath: Remove flow refcount functionality.

Header caching previously required the ability to maintain the lifetime
of flows across RCU boundaries.  However, now that header caching is
gone we can simplfy the code and make it match the upstream version.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>