lib: refactor match_format() output functions

Refactor to remove some duplicated logic in match_format()
implemenation and make the output more uniform.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
fedora package: include python byte compiled files

Include byte compiled files to speed up the execution,
to avoid spurious SELinux AVC denials and also to make
rpm happy when checking for unpackaged files:

RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/share/openvswitch/python/argparse.pyc
   /usr/share/openvswitch/python/argparse.pyo
   /usr/share/openvswitch/python/ovs/__init__.pyc
   [...]

Package guideline reference:
https://fedoraproject.org/wiki/Packaging:Python?rd=Packaging/Python#Files_to_include

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
lib/meta-flow: remove unused function

Remove mf_random_value() which does not have any user now.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Add check for -latomic

Later versions of gcc on some architectures push atomic functions
out into a separate atomic library; add a check to see when this
is required and add it to LIBS if need be.

Specifically the problem was observed on GCC 4.8.2 on powerpc
architecture for Ubuntu 14.04:

https://launchpadlibrarian.net/155235096/buildlog_ubuntu-trusty-powerpc.openvswitch_2.0.0-0ubuntu1_FAILEDTOBUILD.txt.gz

Signed-off-by: James Page <james.page@ubuntu.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
m4: Remove assignment of otherwise unused variable RESOLVER_LIBS.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
bridge: Improve iface_set_ofport() style.

This should behave the same as before but the code reads more naturally to
me this way.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
datapath: Fix compat skb_get_rxhash()

Add missing return statement.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath: Improve compat rxhash functionality.

Following patch improves rxhash calculation, It is taken from
upstream Linux kernel code.
From kernel 3.8, skb_get_rxhash() can handle hardware generated
l4-rxhash. Therefore compat skb_get_rxhash() is not used on
kernel 3.8 or new.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Reviewed-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath: Add compile time check for rxhash

Some distribution kernel has backported skb->rxhash (e.g. RHEL)
Following patch allows use precalculated rxhash.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Reviewed-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath: lisp: Use skb rxhash for source port.

Rather than using complete flow hash, we can use skb->rxhash for
calculating source port. Similar calculation is done by vxlan.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath: Use percpu allocator for flow-stats.

Use percpu allocator for stats due to objection to stats array.
But percpu allocator is not designed for high churn allocation/
deallcation. so we need to avoid allocating percpu flow for
short lived flows. One cheaper way to detect flow is by checking
if 5-tuple used in RSS are masked or not. if any one of them is
masked, flow is likely shared across CPU where percpu stat
should be more scalable. And that flow should be relatively
long lived flow.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
cccl: Add the DEBUG option for linker.

The /DEBUG option creates debugging information for
the .exe file

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/odp-util: Only use expected_bit when set.

parse_l2_5_onward() previously used out of range 'expected_bit' when
it was called with no attrs, which happens when parsing a mask with
zero length.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath: compat: Fix compiler error.

Earlier RHEL6 kernel do not have linux/atomic.h header
file.  Use types.h to get atomic_t definition.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
vlog: Add option to send vlog syslog output to arbitrary UDP destination.

Signed-off-by: Henry Mai <henrymai@nicira.com>
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>