datapath: Clarify locking.

Remove unnecessary locking from functions that are always called with
appropriate locking.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
netdev-bsd: compilation fixes

This fixes regressions from commit f7791740
("netdev: Rename netdev_rx to netdev_rxq")
and commit df1e5a3b.
("netdev: Extend rx_recv to pass multiple packets.")

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/flow: add dp_hash and recirc_id to struct flow

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Added Per backer recirculation ID management

Recirculation ID needs to be unique per datapath. Its usage will be
tracked by the backer that corresponds to the datapath.

In theory, Recirculation ID can be any uint32_t value, except 0. This
implementation limits to a smaller range just for ease of debugging.
Make the range size 0 effectively disables recirculation.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
dpif-netdev: user space datapath recirculation

Add basic recirculation infrastructure and user space
data path support for it. The following bond mega flow patch will
make use of this infrastructure.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lockfile: Minor code cleanup.

There were more superficial differences between Windows and non-Windows
versions of the code due to naming.  This commit reduces those differences.

CC: Gurucharan Shetty <shettyg@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/pcap: Use ofpbuf_tail() instead of ofpbuf_end().

Using ofpbuf_end() to compute payload length would fail if the ofpbuf
had any tailroom.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/ofpbuf: Inline the trivial ofpbuf functions.

Inline the most trivial ofpbuf functions to allow for better optimization.
Also inline the most often used ofpbuf_pull() and ofpbuf_try_pull(), which
should help streamline packet parsing.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/ofpbuf: Remove 'l7' pointer.

Now that we don't need to parse TCP flags from the packet after
extraction, we usually do not need the 'l7' pointer any more.  When
needed, ofpbuf_get_tcp|udp|sctp|icmp_payload() or ofpbuf_get_l4_size()
can be used instead.

Removal of 'l7' was requested by Pravin for the DPDK datapath work, as
it simplifies packet parsing a bit.

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