dpif-netdev: reduce netdev_flow_key size

Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com>
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
BFD: Decreasing minimal transmit and receive interval

I found the BFD transmit interval was lowerbounded by the default value
without warning, although documentation does not consider a lowerbound.

Testing has been performed with transmit and receive intervals as low as 1
ms, and although CPU overhead was effected (especially with multiple BFD
sessions such as 6 and higher), it worked well.

Signed-off-by: Niels van Adrichem <n.l.m.vanadrichem@tudelft.nl>
Signed-off-by: Ben Pfaff <blp@nicira.com>
flow: Clean up MINIFLOW_FOR_EACH_IN_MAP.

It seemed awkward to have declarations outside the for loop.

This may also be a little faster because it avoids some calls to
count_1bits().  The idea for that change is due to Jarno Rajahalme
<jrajahalme@nicira.com>.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
lib/bitmap: Faster bitmap functions.

Replace bitwise loops with a single operation, inline all bitmap
functions.  Inlining allows the compiler to remove unnecessary code
due to some parameters being compile-time constants.

Before:

$ tests/ovstest test-bitmap benchmark 1000000
bitmap equal:    341 ms
bitmap scan:   8089 ms

After:

$ tests/ovstest test-bitmap benchmark 1000000
bitmap equal:    152 ms
bitmap scan:    146 ms

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Co-authored-by: Kmindg <kmindg@gmail.com>
Acked-by: Ben Pfaff <blp@nicira.com>
meta-flow: Autogenerate mf_field data structures.

This is a first step toward improving the abstraction of OXM and NXM in the
tree.  As an immediate improvement, this commit removes all of the
definitions of the OXM and NXM constants from the top-level header files,
because they are no longer used anywhere.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
util: New function bitwise_scan().

This will acquire its first user in an upcoming commit.

This implementation is not optimized at all but it doesn't matter for the
purpose for which I intend to initially use it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
ovs-ofctl: Encode cookies in OXM-compliant manner.

NXM/OXM are only supposed to put 1-bits in a value if the corresponding bit
in the mask is a 1-bit, but in the case of cookie matching, e.g.
    ovs-ofctl del-flows br0 cookie=0x3/0x1
ovs-ofctl would encode a bad OXM.  This fixes the problem.

(The test "ofproto - del flows based on cookie mask" in the OVS testsuite
tickles this bug.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
nx-match: Move all knowledge of OXM/NXM here.

This improves the general abstraction of OXM/NXM by eliminating direct
knowledge of it from the meta-flow code and other places.

Some function renaming might be called for; for example, mf_oxm_header()
may not be the best name now that the function is implemented within
nx-match.  However, these renamings would make this commit larger and
harder to review, so I'm postponing them.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
ofp-actions: Better support OXM in Copy-Field action.

The OpenFlow 1.5 (draft) Copy-Field action has two OXM headers, one after
the other.  Until now, Open vSwitch has implemented these as a pair of
ovs_be32 members, which meant that only 32-bit OXM could be supported.  This
commit changes the implementation to use nx_pull_header(), which means that
in the future when that function supports 64-bit experimenter OXMs,
Copy-Field will automatically get that support too.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
vswitch.ovsschema: Correct schema version number.

Commit 3e5aeeb581faf7 (bridge: Keep bond active slave selection across OVS
restart) updated the OVS schema number from 7.9.0 to 8.0.0.  However,
the major version number should only be incremented for incompatible schema
changes, ones that are likely to break software that interacts with the
schema.  The change in question only added a column to a table, so it is
not an incompatible change.  Therefore, this commit changes the schema
version number to 7.10.0, indicating a compatible change.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Change Travis CI notification email to ljakab@ac.upc.edu
userspace: add support for pop_eth and push_eth actions

These actions will allow L2->L3 and L3->L2 switching, and are supposed
to be added to flows installed in the datapath transparently by
ovs-vswitchd.

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
userspace: add layer 3 flow and switching support

This commit relaxes the assumption that all packets have an Ethernet
header, and adds support for layer 3 flows.  For each packet received on
the Linux kernel datapath the l2 and l3 members of struct ofpbuf are
intialized appropriately, and some functions now expect this (notably
flow_extract()), in order to differentiate between layer 2 and layer 3
packets.  struct flow has now a new 'base_layer' member, because we
cannot assume that a flow has no Ethernet header when eth_src and
eth_dst are 0.  For layer 3 packets, the protocol type is still stored
in the eth_type member.

Switching L2->L3 and L3->L2 are both implemented by adding the pop_eth
and push_eth actions respectively when a transition is detected.  The
push_eth action puts 0s on both source and destination MACs.  These
addresses can be modified with mod_dl_dst and mod_dl_src actions.

Added new prerequisite MFP_ETHERNET for fields MFF_ETH_SRC, MFF_ETH_DST,
MFF_VLAN_TCI, MFF_DL_VLAN, MFF_VLAN_VID and MFF_DL_VLAN_PCP.

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
squash
datapath: add layer 3 flow/port support

Implementation of the pop_eth and push_eth actions in the kernel, and
layer 3 flow support.

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
Address Jesse's comment #1
Address Jesse's comment #8
Address Jesse's comment #7
Address Jesse's comment #6
Address Jesse's comment #5