netdev-vport: Fix indentation.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
odp-util: Remove trailing whitespace.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
utilities: a top like tool for ovs-dpctl dump-flows.

This python script summarizes ovs-dpctl dump-flows content by aggregating
the number of packets, total bytes and occurrence of the following fields:
  - Datapath in_port
  - Ethernet type
  - Source and destination MAC addresses
  - IP protocol
  - Source and destination IPv4 addresses
  - Source and destination IPv6 addresses
  - UDP and TCP destination port
  - Tunnel source and destination addresses

Testing included confirming both mega-flows and non-megaflows are
properly parsed. Bit masks are applied in the case of mega-flows
prior to aggregation.  Test --script parameter which runs in
non-interactive mode. Tested syntax against python 2.4.3, 2.6 and 2.7.
Confirmed script passes pep8 and pylint run as:

pylint --disable=I0011 --include-id=y --reports=n

This tool has been added to these distribution:
  - add ovs-dpctl-top to debian distribution
  - add ovs-dpctl-top to rpm distribution.
  - add ovs-dpctl-top to XenServer RPM.

Signed-off-by: Mark Hamilton <mhamilton@nicira.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
NEWS: Move backported item from post-v2.0.0 to v2.0.0.

I backported millisecond timestamps to branch-2.0 upon request from Paul
Ingram, so we should mention it as part of that version.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
openvswitch/types.h: New macros OVS_BE16_MAX, OVS_BE32_MAX, OVS_BE64_MAX.

These seem slightly nicer than e.g. htons(UINT16_MAX).

Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath: Remove net_device_ops compatibility code.

The symbol HAVE_NET_DEVICE_OPS was changed in 3.1 but code the that
it was protecting dates back to before 2.6.32. Therefore, we can
just assume that net_device_ops exists in all cases and drop the
compat code.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
utilities: add ovs-dpctl-top to .gitignore

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath: add linux/utils.c to .gitignore

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
ofproto-dpif-upcall: Forward packets in order of arrival.

Until now, the code in ofproto-dpif-upcall (and the code that preceded it
in ofproto-dpif) obtained a batch of incoming packets, inserted them into
a hash table based on hashes of their flows, processed them, and then
forwarded them in hash order.  Usually this maintains order within a single
network connection, but because OVS's notion of a flow is so fine-grained,
it can reorder packets within (e.g.) a TCP connection if two packets
handled in a single batch have (e.g.) different ECN values.

This commit fixes the problem by making ofproto-dpif-upcall always forward
packets in the same order they were received.

This is far from the minimal change necessary to avoid reordering packets.
I think that the code is easier to understand afterward.

Reported-by: Dmitry Fleytman <dfleytma@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
timeval: Call coverage_clear() before coverage_log() in time_poll().

time_poll() calls log_poll_interval(), which in some circumstances calls
coverage_log().  Before this commit, time_poll() also called
coverage_clear() after log_poll_interval().  This made sense before commit
857165b5fd26 (coverage: Make thread-safe.), because coverage_log() would
log the most recent main loop's coverage counters separately and calling
coverage_clear() beforehand would zero out those counters.  However, it
doesn't make sense any longer because the most recent loop's counters are
no longer separately logged and in fact this practice now means that the
most recent loop's counters are omitted from the logged counters.

Therefore, this commit moves the call to coverage_clear() earlier, so that
the most recent loop's counters are included.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif-upcall: Make miss handlers accumulate coverage counters.

The miss handler threads do not call poll_block(), which calls
coverage_clear() indirectly.  This meant that coverage counters incremented
by miss handler threads never got integrated into the global coverage
counters and therefore did not show up in coverage logging or
"ovs-appctl coverage/show" output.  This commit fixes the problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
coverage: Rename coverage_clear() to coverage_run().

The new name better reflects what this function does.

Signed-off-by: Ben Pfaff <blp@nicira.com>
pcap-file: Improve error logging.

There is no reason to log end of file as an error, but that's what this
code was doing.

Signed-off-by: Ben Pfaff <blp@nicira.com>
pcap-file: Add support for append mode to pcap_open().

Signed-off-by: Ben Pfaff <blp@nicira.com>
netdev-dummy: Add pcap feature.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-ofctl: Add undocumented "parse-pcap" command, for testing.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Simplify code using execute_odp_actions().

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Factor lots of code out into new function execute_actions().

Signed-off-by: Ben Pfaff <blp@nicira.com>
odp-execute: Refine signatures for odp_execute_actions() callbacks.

Signed-off-by: Ben Pfaff <blp@nicira.com>
odp-util: Make it possible to combine slow path reasons.

It will soon be possible for a single flow to be slow pathed for multiple
reasons.  This commit makes it possible to indicate more than one reason
to slow path a flow.

This commit is logically a revert of commit 98f0520fb2 (odp-util: Make
slow_path_reasons mutually exclusive.) but details have changed.

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