ovs-ofctl: Document masked versions of arp_sha and arp_tha matches

Document masked versions of arp_sha and arp_tha matches.
Also update documentation of unmasked versions of these
matches to include an example address as is the case with
the documentation of dl_src and dl_dst.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: test ARP SPA and TPA load actions

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-ofctl: Document mpls_{label,bos,tc} matches

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-ofctl: Document set_mpls_{label,tc} actions

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-ofctl: Document arp_spa and arp_tpa matches

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
FAQ, NEWS: Notes on TCP flags matching.

Add a FAQ categorry "Performance Problems".  So far the only entry
addresses the issue with using a new kernel module with an older
(pre-megaflows) userspace.
OPENFLOW-1.1+: Update MPLS items

* MPLS BoS match is supported as much as other MPLS matches.
  That is, all that is missing is the kernel datapath side
  which is part my pending patchset.

* The rework of tag order does require work but it is
  covered by my pending patchset.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-actions: Remove unneeded redeclaration of vlog_rate_limit rl.

Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
dpif_netdev_execute: Extract flow key from the packet.

Extract the flow key from the packet instead of the execute->key.
This reflects how the kernel datapath behaves.

Also use ofpbuf_clone_with_headroom() instead of open coding the same.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
dpif-netdev: Maintain the original key during execution.

Userspace action needs the original flow key.  This also
matches the kernel datapath behavior.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
meta-flow: Fix typo in error message.

Signed-off-by: Ben Pfaff <blp@nicira.com>
bitmap: New macro BITMAP_N_LONGS for use in constant expressions.

An upcoming commit will declare a bitmap on the stack, rather than heap
allocating it, which means that it is not possible to use a function call
in the declaration.

Signed-off-by: Ben Pfaff <blp@nicira.com>
util: New function ovs_scan().

This new function is essentially an implementation of sscanf() with
slightly different behavior (see the comment) that is more convenient for
Open vSwitch internal use.  Also, this implementation ought to work out of
the box on Windows, which has a defective sscanf() that lacks the 'hh'
modifier required to scan into a char variable.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Switch from sscanf() to ovs_scan() throughout the tree.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-actions: Consider L4 actions after mpls_push as inconsistent

After an mpls_push action the resulting packet is MPLS and
the MPLS payload is opaque. Thus nothing can be assumed
about the packets network protocol and it is inconsistent
to apply L4 actions.

With regards to actions that affect the packet at other layers
of the protocol stack:

* L3: The consistency of L3 actions should already be handled correctly
  by virtue of the dl_type of the flow being temporarily altered
  during consistency checking by both push_mpls and pop_mpls actions.

* MPLS: The consistency checking of MPLS actions appear to already be
  handled correctly.

* VLAN: At this time Open vSwitch on mpls_push an MPLS LSE is always
  added after any VLAN tags that follow the ethernet header.
  That is the tag ordering defined prior to OpenFlow1.3. As such
  VLAN actions should sill be equally valid before and after mpls_push
  and mpls_pop actions.

* L2 actions are equally valid before and after mpls_push and mpls_pop actions.

Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
util: Fix bad constant in ovs_scan() implementation on 64-bit.

scan_chars() compares an "unsigned int" against SIZE_MAX, which will
always be false on 64-bit architectures.  The correct constant is
UINT_MAX.

Reported-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
dpif-linux: Fix minor typo OVS_DP_ATTR_UPCALL_PID

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/util: Make raw_ctz() implementation non-static.

Signed-off By: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/util: Add ctz64() and popcount64().

Add raw_ctz64(), ctz64(), and popcount64() using builtins when
available.

Signed-off By: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
miniflow: Use 64-bit map.

Signed-off By: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>