netdev-bsd: Fix a build error.

fix a typo in the following commit.

> commit 10a89ef04df5669c5cdd02f786150a7ab8454e01
> Author: Ben Pfaff <blp@nicira.com>
> Date:   Mon Jun 24 10:54:49 2013 -0700
>
>     Replace all uses of strerror() by ovs_strerror(), for thread safety.
>
>     Signed-off-by: Ben Pfaff <blp@nicira.com>

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
datapath: Fix tunnel source port selection for mega flow

Tunnel source port selection was based on hash value cached in the
flow. This no longer works with mega flow, since all flows matching
a mega flow will be transmitted with the same tunnel source port.

This patch computes the tunnel source port at run time based on each
incoming packet. Packets belong to the same micro flow would still get
the same source port, but multiple micro flows hitting the same mega flow
can get different source ports.

Packets injected from the usespace will be assigned to the same
source port as if they are forwarded in the kernel.

Bug #18216

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
odp-util: Always encode mask of 0xffff for dl_type < ETH_TYPE_MIN.

For non-Ethernet II packets, we don't set an EtherType netlink attribute
and set the Ethertype mask attribute to 0xffff.  The code was encoding
whatever mask was passed in, which could lead to bugs if the caller
didn't know the userspace-kernel interface.

Found by inspection.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
odp-util: Clearly indicate VID mask is printed in hex.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
datapath: Fix version check in compat gre.h

Taken the version checks in datapath/linux/compat/gre.c this seems correct.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
datapath: Use RCU lock for flow dump operation.

Flow dump operation is read-only operation.  There is no need to
take ovs-lock.  Following patch use rcu-lock for dumping flows.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath: add netlink error message to help kernel userspace integration.

When kernel rejects a netlink message, it usually returns EINVAL
error code to the userspace. The actual reason for rejecting the
netlinke message is not available, making it harder to debug netlink
issues.  This patch adds kernel log messages whenever a netlink message
is rejected with reasons. Those messages are logged at the info level.

Those messages are logged only once per message, to keep kernel log noise
level down. Reload the kernel module to re-enable already logged
messages.

The messages are meant to help developers to debug userspace and kernel
intergration issues. The actual message may change or be removed over time.
These messages are not expected to show up in a production environment.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
tests: Add test-atomic to .gitignore.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
ofp-parse: Do not exit() upon a parse error.

Until now, failure to parse a flow in the ofp-parse module has caused the
program to abort immediately with a fatal error.  This makes it hard to
use these functions from any long-lived program.  This commit fixes the
problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
BFD: Add forwarding_override command for BFD.

Added appctl commands to override the bfd forwarding status. Values
of true/false/normal are allowed. When set to normal, the bfd
forwarding status is left unchanged. Else, the forwarding status is
set to the specified value - true/false.

Signed-off-by: Pavithra Ramesh <paramesh@vmware.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
bridge: Add ifindex column to Interface table.

This commit adds an "ifindex" column to the "Interface" table in the db.

Signed-off-by: Neil McKee <neil.mckee@inmon.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
bitmap: Fix bitmap_allocate1() bug when n_bits is a multiple of 32.

In function bitmap_allocate1(), the last "unsigned long" in bitmap was
set to all 0-bits when (n_bits % BITMAP_ULONG_BITS == 0).  This commit
correctly sets it to all 1-bits.

Signed-off-by: ZhengLingyun <konghuarukhr@163.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
DESIGN: Fix typo in "VLAN Matching" section.

Signed-off-by: Ben Pfaff <blp@nicira.com>
lacp: Handle unknown slaves in lacp_process_packet().

In future patches, ofproto-dpif-xlate may be temporarily out of
sync with ofproto-dpif proper, and pass an unknown ofport to
lacp_process_packet().  This patch handles that edge case
gracefully.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Handle dest mirrors in compose_output_action().

Before this patch, the mirroring code would retroactively insert
actions for destination mirrors after actions were translated.
This relied on converting datapath output actions into ofports
which doesn't work for tunnels and patch ports.  This patch
refactors the code to handle destination mirrors at output.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Modularize mirror code.

This code modularizes ofproto-dpif's mirror code by moving it to
ofproto-dpif-mirror.  Not only does this shorten ofproto-dpif and
hide complexity, but its also necessary for future patches which
modularize ofproto-dpif-xlate in preparation for multi-threading.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath: Make netlink error messages more consistent.

Suggested-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
DESIGN: Update flow_mod section to describe OpenFlow 1.1+ behavior.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-util: Add 'modify_cookie' to struct ofputil_flow_mod, to support OF1.1.

Signed-off-by: Ben Pfaff <blp@nicira.com>
tests: Add tests for mod flows with cookie miss on OF1.2.

Signed-off-by: Ben Pfaff <blp@nicira.com>