openflow-1.1.h: improve struct ofp11_group_stats definition

Uncomment bucket_stats definition in struct ofp11_group_stats
to better match OpenFlow spec 1.1's definition on page 48.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
openflow-1.3.h: improve struct ofp13_group_stats definition

Uncomment bucket_stats definition in struct ofp13_group_stats
to better match OpenFlow spec 1.3.3's definition on page 91.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofp-util.c: Simplify ofputil_group_stats_to_* functions.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
debian: Better document how to get a kernel module in README.Debian.

This moves existing text from INSTALL.Debian into the README.Debian
installed as part of the openvswitch-switch package, and adds a reference
from the former to the latter.

Reported-by: Brian Candler <b.candler@pobox.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
Clarify tunnel wildcarding.

It would seem we should set the 'tunnel.ip_dst' in 'wc' when calling
tnl_port_should_receive(), as it is reading that flow field.  However,
since tunnels' datapath port numbers are different from the non-tunnel
ports, and we always unwildcard the 'in_port', we do not need to
unwildcard the 'tunnel.ip_dst' for non-tunneled packets.

Also, 'nw_tos' need not be unwildcarded if it is not examined.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Makefile.am: Fix build hang when .git and Git are present but don't work.

If the .git directory is there, and "git --version" works, but "git
ls-files" fails to print any file names (e.g. perhaps because .git is a
symlink to an inaccessible directory) then the "grep" command in the
thread-safety-check rule would hang forever because it had an empty list
of files and therefore expected to read from stdin.  This fixes the problem
by adding the name of an empty file to the command, which is harmless.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
lib/odp-util: Do not use mask if it doesn't exist.

Diagnostic code path dereferenced a NULL pointer.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
ofproto-dpif: Correct documentation of rule_dpif_lookup_from_table()

This corrects an editing error that was added by 6b83a3c5c37a0711
("ofproto: Support OF version-specific table-miss behaviours").

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Andy Zhou <azhou@nicira.com>¬
ofproto-dpif: Correct typo in documentation of rule_dpif_lookup()

This corrects a typo that was added by adcf00ba35a0ce9c
("ofproto/bond: Implement bond megaflow using recirculation").

Cc: Andy Zhou <azhou@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Andy Zhou <azhou@nicira.com>¬
datapath: Orphan frags in skb_zerocopy and handle errors

This is the ported version of commit 36d5fe6a with the same name from net-next.
Apart from the small datapath.c changes it adjust the compat layer files as
well. This is the original commit message:

"skb_zerocopy can copy elements of the frags array between skbs, but it doesn't
orphan them. Also, it doesn't handle errors, so this patch takes care of that
as well, and modify the callers accordingly. skb_tx_error() is also added to
the callers so they will signal the failed delivery towards the creator of the
skb."

Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
ofproto/bond: Minor cleanups.

Add a constant for the number of bond buckets, and other minor cleanups.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>¬
ofproto/bond: Protect statistics with writelock.

dcf00ba35a0 (ofproto/bond: Implement bond megaflow using recirculation)
allowed bond_entry statistics to be modified while holding a readlock.
This patch modifies bond_entry_account() to get a writelock before
modifying the statistics and adds thread-safety annotations to these
fields and relevant functions.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>¬
datapath: Allow each vport to have an array of 'port_id's.

In order to allow handlers directly read upcalls from datapath,
we need to support per-handler netlink socket for each vport in
datapath.  This commit makes this happen.  Also, it is guaranteed
to be backward compatible with previous branch.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
ofproto/bond: only display hash entries with tx_byptes > 1KB

When recirculation is used to implement bond, all bond entries are
always populated regardless whether there is traffic going through
them or not. This change cuts down the noise when running
'ovs-appctl bond/show', by skipping '0KB' entries.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
ofproto/bond: Keep hash entry slave valid.

Bond recirculation needs to refresh the 'hidden rules' from
time to time. Keep hash entry slave valid to prevent those
hidden rules from being removed.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
ofproto/bond: properly maintain hash entry pr_rule

This is a bug causing per hash entry's pr_rule pointer not properly
maintained; they became NULL after each rebalancing. This patch fixes
this bug.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
ofproto-dpif: xlate should not attribute stats to bond entry when using recirc

When recirculation is used to implement bond, the bond entry stats are
collected from the hidden post recirculation rules. This bug causes
double counting of stats to some strenuous bond entries.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
dpif-linux: Implement the API functions to allow multiple handler threads read upcall.

Signed-off-by: Alex Wang <alexw@nicira.com>
ofproto-dpif-upcall: Remove the dispatcher thread.

With the foundation laid in previous commits, this commit
removes the 'dispatcher' thread by allowing 'handler'
threads to read upcalls directly from dpif.

This commit significantly simplifies the flow miss handling
code and brings slight improvement to flow setup rate.

Signed-off-by: Alex Wang <alexw@nicira.com>