datapath: remove duplicated include from vport-vxlan.c

Remove duplicated include.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath: remove duplicated include from vport-gre.c

Remove duplicated include.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Jesse Gross <jesse@nicira.com>
ofproto: Allow ofproto_delete_flow() to delete hidden rules.

Commit 97f63e57a8 (ofproto: Remove soon-to-be-invalid optimizations.)
changed ofproto_delete_flow() to use the general-purpose flow_mod
implementation.  However, the general-purpose flow_mod never matches hidden
flows, which are exactly the flows that ofproto_delete_flow()'s callers
want to delete.

This commit fixes the problem by allowing flow_mods that specify a priority
that can only be for a hidden flow to delete a hidden flow.  (This doesn't
allow OpenFlow clients to meddle with hidden flows because OpenFlow uses
only a 16-bit field to specify priority.)

I verified that, without this commit, if I change from one controller to
another with "ovs-vsctl set-controller", then the in-band rules for the
old controller remain.  With this commit, the old rules are removed.

Reported-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Bug #19821.
Reported-by: Luca Giraudo <lgiraudo@vmware.com>
Bug #19888.
Reported-by: Ying Chen <yingchen@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
ofproto: Fix memory leak in rule_actions_unref().

Found by valgrind.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
hmap: Make bad hash functions easier to find.

The hmap code has for a long time incremented a counter when a hash bucket
grew to have many entries.  This can let a developer know that some hash
function is performing poorly, but doesn't give any hint as to which one.
This commit improves the situation by adding rate-limited debug logging
that points out a particular line of code as the source of the poor hash
behavior.  It should make issues easier to track down.

Bug #19926.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Lauded-by: Keith Amidon <keith@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
ofproto-dpif-upcall: Fix typos in comments.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: pritesh <pritesh.kothari@cisco.com>
ovs-dpctl: Remove stale comment.

The '-m' option is documented in the manpage.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ovs-dpctl: Add a missing simap_destroy()

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ovs-dpctl: Parse the arguments correctly for del-flow.

Inside dpctl_del_flow() argv[0] is 'del-flow' and argv[1] can
be the flow in the absence of the optional datapath argument.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
odp-util: Parse the in_port as a name correctly.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ovs-dpctl: Update usage where datapath name is optional.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif-upcall: Fix a memory leak.

The "key" member in struct flow_miss refers to memory held by the "struct
upcall", hence the upcalls should be freed only after the flow misses are
processed by the main thread.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath: Fix typos in comment.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: pritesh <pritesh.kothari@cisco.com>
Acked-by: Jesse Gross <jesse@nicira.com>
packets: Remove unused function eth_mpls_depth

eth_mpls_depth() has been unused as of 1ac7c9bdb2b6fdcb ("ofproto-dpif: Use
execute_actions to execute controller actions").

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
for ovs-appctl bridge/dump-flows, don't show "priority" twice

before the change:

duration=2110s, priority=0, n_packets=3151646, n_bytes=3104180388, \
priority=0,actions=CONTROLLER:65535
table_id=254, duration=2136s, priority=0, n_packets=0, n_bytes=0, \
priority=0,reg0=0x3,actions=drop
table_id=254, duration=2136s, priority=0, n_packets=0, n_bytes=0, \
priority=0,reg0=0x1,actions=controller(reason=no_match)
table_id=254, duration=2136s, priority=0, n_packets=0, n_bytes=0, \
priority=0,reg0=0x2,actions=drop

after the change:

duration=2924s, n_packets=5316116, n_bytes=5260045454, \
priority=0,actions=CONTROLLER:65535
table_id=254, duration=2924s, n_packets=0, n_bytes=0, \
priority=0,reg0=0x3,actions=drop
table_id=254, duration=2924s, n_packets=0, n_bytes=0, \
priority=0,reg0=0x1,actions=controller(reason=no_match)
table_id=254, duration=2924s, n_packets=0, n_bytes=0, \
priority=0,reg0=0x2,actions=drop

(i wrapped long lines by hand)

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
OPENFLOW-1.1+: update for OF1.3 ONF Extentions and OF1.4

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
tunnel: Make tnl_find() easier to understand.

Suggested-by: pritesh <pritesh.kothari@cisco.com>
Acked-by: pritesh <pritesh.kothari@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>