2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-09 13:49:05 +00:00
Commit Graph

15276 Commits

Author SHA1 Message Date
Paul Blakey
e5b1657e6f compat: Add act_pedit compatibility for old kernels
Added compatibility for action pedit.

Signed-off-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
2017-11-16 08:03:05 -08:00
Ben Pfaff
fa54741ea5 netdev: Eliminate redundant ifindex mapping.
Until now, the code for mapping ODP port number to ifindexes and vice versa
has maintained two completely separate data structures, one for each
direction.  It was possible for the two mappings to become out of sync
with each other since either one could change independently.  This commit
merges them into a single data structure (with two indexes), which at least
means that if one is removed then the other is as well.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: William Tu <u9012063@gmail.com>
2017-11-15 10:57:49 -08:00
Ben Pfaff
8639555322 netdev: Indentation and style fixes.
White space changes only.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: William Tu <u9012063@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
2017-11-15 10:57:30 -08:00
Alin Gabriel Serdean
847dc1c22c ovn.at: Fix MSYS IPv6 interpretation
Unfortunately MSYS transforms `0::` into the location of the binaries i.e.:
c:\MinGW\msys\1.0\64.

Currently the test:
`testing ovn -- IPv6 Neighbor Solicitation for unknown MAC`
fails because of the above:
"ovn-nbctl: lrp0_ip6: invalid network address: aef0;c:\MinGW\msys\1.0\64"

This patch uses the full form of the IPv6 address instead of its shorter
notation.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
2017-11-14 20:40:51 +02:00
Ben Pfaff
0d8efdc9ca netdev: Change macro to function.
There was no reason that this should have been a macro.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
2017-11-14 10:14:18 -08:00
Ben Pfaff
1f3c6b2d23 tests: Try harder to figure out whether IPv6 is supported.
Until now, the tests have tried to create an IPv6 socket to figure out
whether the system under test supports IPv6.  Recently we've seen test
failures on Travis which appear to be because, although the system supports
IPv6, test programs are not allowed to connect or bind IPv6 addresses.
This commit refines the test for IPv6 to also try to bind the IPv6
localhost address, which should convert the test failures to "skip"s.

Acked-by: William Tu <u9012063@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Tested-at: https://travis-ci.org/gvrose8192/ovs-experimental
Reported-at: https://github.com/travis-ci/travis-ci/issues/8711
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-14 10:00:24 -08:00
Alin Gabriel Serdean
b0bf5ef292 installer-windows: Add x64 installer build via command line
Add a new variable to know on which platform we are compiling.

Make the msbuild command to be aware of the platform we want to build.

Shorter the msbuild parameters from `property:`->`p:`. Change slashes
to double slashes so msys does not get confused.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>
2017-11-14 06:16:37 +02:00
Alin Gabriel Serdean
abbb33e38c installer-windows: Modify installer so it can be compiled on x64
Add variables to know for which platform we are building.

They are needed for the installer to know if it should install
in `Program Files (x86)` or `Program Files` and which registry
it needs to update.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>
2017-11-14 06:16:36 +02:00
Alin Gabriel Serdean
9e3a4992df installer-windows: Call WIX binaries outside of MSBuild on x64
Unfortunately all WIX binaries (candle, heat, etc) are only 32 bit (up to
the latest version 3.11).

For performance reasons they are run as .NET assemblies inside the MSBuild
process. Running 32 bit assemblies inside a 64 bit process (MSBuild) makes
them segfault.

Add a new option for heat to be run as an individual process when the
platform is not x86.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>
2017-11-14 06:16:34 +02:00
Alin Gabriel Serdean
fe10c284d3 installer-windows: Resolve WIX solution build type
Until now the x64 build of the installer solution was pointing to the
x86 build of the WIX project.

This patch changes for them to match.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>
2017-11-14 06:16:33 +02:00
Alin Gabriel Serdean
00d90b49cc installer-windows: Remove unused entries from WIX project
Remove duplicate and obsolete entries from the installer WIX project.

Found by inspection.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>
2017-11-14 06:16:31 +02:00
Alin Gabriel Serdean
3d57e30963 build-windows: Suppress output from MSBuild
Add `nologo` parameter to MSBuild to suppress the banner.

This will make tidier log messages.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>
2017-11-14 06:16:29 +02:00
Alin Gabriel Serdean
27f141d44d ofp-actions: Add compare to offsetof need for MSVC 2015/17
Unfortunately starting from VS 2015, the "C" definition for `offsetof`
has been changed. Please see:
https://stackoverflow.com/questions/42725929/using-offsetof-with-enum-does-not-compile-in-visual-studio-2015/42726424

Several people reported the bug for 2015 and also 2017 (i.e. :
https://developercommunity.visualstudio.com/content/problem/22196/static-assert-cannot-compile-constexprs-method-tha.html
), but we don't have a fix yet.

This patch adds an explicit compare, although we could redefine the macro
for the same effect.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Anand Kumar <kumaranand@vmware.com>
2017-11-14 05:46:10 +02:00
Alin Gabriel Serdean
2b3f8b6e23 build-windows: Add check for struct timespec
Starting from WDK 10 the structure `timespec` is defined in <time.h>.

This patch adds a check for the structure to make <pthread.h> aware of it, so
it doesn't try to redefine the structure.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Anand Kumar <kumaranand@vmware.com>
2017-11-14 05:46:08 +02:00
Alin Gabriel Serdean
5ec39c8a35 windows: Add interlocked function definitions for VS 2015
For some unclear and accidental reasons, the Windows 10 SDK
renamed _Interlocked* functions to _InlineInterlocked* (although the
documentation still points to the old form:
https://msdn.microsoft.com/en-us/library/191ca0sk.aspx).

This patch adds mappings for used functions.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Anand Kumar <kumaranand@vmware.com>
2017-11-14 05:46:05 +02:00
Alin Gabriel Serdean
54b32d6f65 windows: _set_output_format is no longer required from VS2015
_set_output_format is deprecated ang no longer required
starting from MSC_VER 1900 (VS 2015):
https://msdn.microsoft.com/en-us/library/bb531344(v=vs.140).aspx .

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Anand Kumar <kumaranand@vmware.com>
2017-11-14 05:46:00 +02:00
Ashish Varma
97459c2f01 netdev, dpif: fix the crash/assert on port delete
a crash is seen in "netdev_ports_remove" when an interface is deleted and added
back in the system and when the interface is part of a bridge configuration.
e.g. steps:
  create a tap0 interface using "ip tuntap add.."
  add the tap0 interface to br0 using "ovs-vsctl add-port.."
  delete the tap0 interface from system using "ip tuntap del.."
  add the tap0 interface back in system using "ip tuntap add.."
                       (this changes the ifindex of the interface)
  delete tap0 from br0 using "ovs-vsctl del-port.."

In the function "netdev_ports_insert", two hmap entries were created for
mapping "portnum -> netdev" and "ifindex -> portnum".
When the interface is deleted from the system, the "netdev_ports_remove"
function is not getting called and the old ifindex entry is not getting
cleaned up from the "ifindex_to_port" hmap.

As part of the fix, added function "dpif_port_remove" which will call
"netdev_ports_remove" in the path where the interface deletion from the system
is detected.
Also, in "netdev_ports_remove", added the code where the "ifindex_to_port_data"
(ifindex -> portnum map node) is getting freed when the ifindex is not
available any more. (as the interface is already deleted.)

VMware-BZ: #1975788
Signed-off-by: Ashish Varma <ashishvarma.ovs@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-13 11:05:31 -08:00
Aaron Conole
b4027b17e8 ovs-tcpdump: handle large interface names on linux
Linux has a fixed size interface name, which will not change.  This means
that attempts to dump interfaces whose names are larger than the max size
will result in an error making the tap device.

This commit brings a new function.  When the generated name would be too
large, use a random number prefixed by 'ovsmi' instead.

Reported-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-13 09:01:10 -08:00
Ben Pfaff
9e848936ea ovn: Add document describing new features in OVN added in version 2.8.
This is adapted from a talk I gave at OpenStack Summit Sydney on Nov. 6.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
Acked-by: Miguel Angel Ajo <majopela@redhat.com>
2017-11-13 09:01:10 -08:00
Gurucharan Shetty
a3c5fca1b5 ovs-ctl: Don't remember vport-* kernel modules
From OVS 2.8, ovs-vswitchd, when it starts, will
load the kernel modules for tunnels. It has logic
inside it to choose either upstream kernel module
or vport-* kernel module.

So, when we run 'force-reload-kmod' to upgrade to
OVS 2.8 from a previous version,  we do not need to
remember the vport-* kernel module that was previously
loaded.  It is not really harmful to load vport-* kernel
module though.

On RHEL7.x and OVS 2.8, we use the upstream "geneve" kernel
module for tunnels.

But, on RHEL 7.x we have hit a bug caused by iptables
startup script which tries to remove all kernel modules
related to linux conntrack. It fails to unload openvswitch
kernel module because it has a reference count on it. But it
succeeds in unloading vport-geneve and in turn the upstream
"geneve" kernel module.  This causes the tunnels to go down.

With this patch, we avoid the above situation, by not loading
vport-geneve kernel module.  ovs-vswitchd when it starts will
load upstream geneve. And when "iptables stop" runs, since
"geneve" has nothing to do with conntrack, it spares it.
Ideally, we should fix this by incrementing the refcount
on the kernel modules.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: William Tu <u9012063@gmail.com>
2017-11-13 08:15:39 -08:00
Kevin Traynor
d9f79b6a5c dpif-netdev: Remove unnecessary resets on new rxqs.
Commit 38259bd7eb (dpif-netdev: Initialize new rxqs in
port_reconfigure().) added a memset for the dp_netdev_rxq of new rxq's
to remove a valgrind warning for an index field in that struct.  With
the addition of that memset, it also means there are some existing
resets on other fields in that struct that are no longer needed and
gives the opportunity to simplify by removing them.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-12 14:44:12 -08:00
Ilya Maximets
14f137ba1f netdev: Remove EOPNOTSUPP related comment for netdev_send().
Since 57eebbb4c3, the caller must make sure that 'netdev' supports
sending. This mentioned at the start of the comment.

Fixes: 57eebbb4c3 ("dpif-netdev: Don't try to output on a device without txqs.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
2017-11-09 14:11:30 -08:00
Jan Scheurich
9a180f2c00 NSH: Adjust NSH wire format to the latest IETF draft
This commit adjusts the NSH user space implementation in OVS to
the latest wire format defined in draft-ietf-sfc-nsh-28 (November 3
2017). The NSH_MDTYPE field was reduced from 8 to 4 bits. The FLAGS
field is reduced from 8 to 2 bits. A new 6 bit TTL header field is
added. The TTL field is set to 63 at encap(nsh).

Match and set_field support for the newly introduced TTL header field
and a corresponding dec_nsh_ttl action is not yet included and will be
implemented in a future patch.

Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-08 12:33:45 -08:00
Jan Scheurich
7edef47b48 NSH: Minor bugfixes
- Fix 2 incorrect length checks
- Remove unnecessary limit of MD length to 16 bytes
- Remove incorrect comments stating MD2 was not supported
- Pad metadata in encap_nsh with zeroes if not multiple of 4 bytes

Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-08 12:31:57 -08:00
Timothy Redaelli
ea36b04688 rhel: Add support for "systemctl reload openvswitch"
The reload procedure will trigger a script that saves the flows and tlv
maps (using ovs-save) then it restarts ovsdb-server, it stops ovs-vswitchd,
it sets other_config:flow-restore-wait=true (to wait till flow restore is
finished), it starts ovs-vswitchd, it restore the backupped flows/tlv
maps and it removes other_config:flow-restore-wait=true (logic mostly ripped
from ovs-ctl).

It uses systemctl with --job-mode=ignore-dependencies to restart ovsdb-server
and stop and start ovs-vswitchd in order to avoid systemd to restart the other
components due to dependencies (as explained in rhel/README.RHEL.rst).

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
2017-11-08 12:16:51 -08:00
László Sürü
1cfa77b6c2 Documentation: Fix for userspace testsuite directory name
Open vSwitch Testing documentation Userspace datapath section shows incorrect directory name for test result.
Morever to this check-system-userspace test fails if another OVS instance is running.
This patch corrects the directory name and adds a note for other running instances.

Signed-off-by: László Sürü <laszlo.suru@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-08 03:22:04 -08:00
Ben Pfaff
3220b8a894 vswitch.xml: Fix nonbreaking spaces.
Fixes: fb9fdd7289 ("vswitchd: Document option dst_port.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-08 01:35:16 -08:00
duanjiong
fb9fdd7289 vswitchd: Document option dst_port.
Otherwise the user does not know how to change it

Signed-off-by: Duan Jiong <djduanjiong@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-07 20:21:28 -08:00
duanjiong
1acb986d7f packets: Move declarations inside extern "C".
It doesn't matter but it seems "more correct" this way.

Signed-off-by: Duan Jiong <djduanjiong@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-06 14:43:58 -08:00
Borja Marcos EA2EKH
ff6aa424ef conntrack: Include <sys/types.h> before <netinet/icmp6.h>.
FreeBSD and Mac OS X require this.

Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-06 14:20:55 -08:00
antonio.fischetti@intel.com
97ee6d41e2 dpctl: manage ret value when dumping CT entries.
Manage error value returned by ct_dpif_dump_next.

Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
2017-11-03 14:54:45 -07:00
Ben Pfaff
cb9958e930 AUTHORS: Add Matteo Croce.
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 14:51:24 -07:00
Matteo Croce
dbb5ecb4be ovs-lib: dont't purge corrupted DB
In ovs-lib there is a function named upgrade_db which tries to convert a
database after OVS {up,down}grades. This function uses ovsdb-tool to
check if the DB needs to be upgraded. If the upgrade fails,
it purges the DB and create an empty one.
ovsdb-tool returns "yes" or "no" to indicate if the DB needs upgrading,
but if the DB is corrupted it returns a list of errors.
Change a condition from "!= no" to "= yes" because in case of DB
corruption upgrade_db would purge the existing DB without writing
anything in the logs.

Signed-off-by: Matteo Croce <mcroce@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
2017-11-03 14:49:27 -07:00
antonio.fischetti@intel.com
ac81c218bf dpctl: Comment functions retrieving the datapath name.
Add a comment to functions retrieving the datapath name.

CC: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 14:46:17 -07:00
Guoshuai Li
03b85a584f ovn: Fix remote not receive GARP, when localnet Port has vlan tag.
When sending a localnet port with vlan, the GARP packet needs push_vlan.

Signed-off-by: Guoshuai Li <ligs@dtdream.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 14:40:03 -07:00
Guoshuai Li
3f9d3836d6 dpif-netdev: Set MAX_RECIRC_DEPTH to 6.
In an ovn gateway node with DPDK, the RECIRC_DEPTH may be greater than 5.

Scenes:
VM ping self floating IP, or
VM ping Floating IP of VMs with the same network.

It need process UNDNAT SNAT in LRouter egress and
UNSNAT DNAT in LRouter ingress, and
output to geneve tunnel also need recirc.

This has an WARN:
dpif_netdev(pmd36)|WARN|Packet dropped. Max recirculation depth exceeded.

Signed-off-by: Guoshuai Li <ligs@dtdream.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 14:29:39 -07:00
Bhanuprakash Bodireddy
a0a4f2a5d3 ovsdb: Remove break after OVS_NOT_REACHED.
The break statement would never be executed as OVS_NOT_REACHED()
internally invokes abort() and causes process termination.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 13:38:00 -07:00
Bhanuprakash Bodireddy
36ef6dfd04 ofp-actions: Remove return after OVS_NOT_REACHED.
The return statement would never be executed as OVS_NOT_REACHED()
internally invokes abort() and causes process termination.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 13:37:47 -07:00
Bhanuprakash Bodireddy
4a67ca44f1 ofproto: Remove break after OVS_NOT_REACHED.
The break statement would never be executed as OVS_NOT_REACHED()
internally invokes abort() and causes process termination.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 13:37:22 -07:00
Bhanuprakash Bodireddy
23d4d53f14 netdev-dpdk: Refactor netdev_dpdk structure.
This commit introduces below changes to netdev_dpdk structure.

- Mark cachelines and reorder few member variables.
- Maintain the grouping of related member variables.
- Add comment on the information on pad bytes where ever appropriate, so
  new members can be introduced in the future to fill the gaps.

  Below is how this structure looks with this commit.

                  Member                    size

         OVS_CACHE_LINE_MARKER cacheline0;
             dpdk_port_t port_id;            1
             bool attached;                  1
             ...

         OVS_CACHE_LINE_MARKER cacheline1;
             struct ovs_mutex;              48
             struct dpdk_mp *dpdk_mp;        8
             ...

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 13:36:53 -07:00
Bhanuprakash Bodireddy
a807c15796 dpif_netdev: Refactor dp_netdev_pmd_thread structure.
This commit introduces below changes to dp_netdev_pmd_thread
structure.

- Mark cachelines and in this process reorder few members to avoid
  holes.
- Align emc_cache to a cacheline.
- Maintain the grouping of related member variables.
- Add comment on the information on pad bytes whereever appropriate so
  that new member variables may be introduced to fill the holes in future.

  Below is how the structure looks with this commit.

              Member                    size

     OVS_CACHE_LINE_MARKER cacheline0;
         struct dp_netdev * dp;          8
         struct cmap_node node;          8
         pthread_cond_t cond;           48

     OVS_CACHE_LINE_MARKER cacheline1;
         struct ovs_mutex cond_mutex;   48
         pthread_t  thread;              8
         unsigned int core_id;           4
         int        numa_id;             4

     OVS_CACHE_LINE_MARKER cacheline2;
         struct emc_cache flow_cache;   4849672

     ###cachelineX: 64 bytes, 0 pad bytes####
         struct cmap flow_table;         8
         ....

     ###cachelineY: 59 bytes, 5 pad bytes####
       struct dp_netdev_pmd_stats stats 40
         ....

     ###cachelineZ: 48 bytes, 16 pad bytes###
         struct ovs_mutex port_mutex;   48
         ....

This change also improve the performance marginally.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 13:36:14 -07:00
Bhanuprakash Bodireddy
82f197ca5a cmap: Use PADDED_MEMBERS_CACHELINE_MARKER in cmap_impl.
Instead of explicitly adding the pad bytes to force the structure an
exact multiple of cacheline size, let the macro do the job. This way
the pad bytes will be auto adjusted when the new members get introduced
in to the structure.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 13:35:51 -07:00
Bhanuprakash Bodireddy
6be7aa7d54 ccmap: Use PADDED_MEMBERS macro in ccmap_impl structure.
Instead of explicitly adding the pad bytes to force the structure an exact
multiple of cacheline size, let the PADDED_MEMBERS macro do the job.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 13:33:05 -07:00
Bhanuprakash Bodireddy
95e620b48c odp-execute: Use const qualifer for batch size.
It is recommended to use const qualifer for 'num' that tracks the
packet batch count. This way 'num' can't be modified by iterator.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 13:22:00 -07:00
Bhanuprakash Bodireddy
e0a00cee33 netdev-linux: Clean up netdev_linux_sock_batch_send().
Use DP_PACKET_BATCH_FOR_EACH macro and dp_packet_batch_size() API
in netdev_linux_sock_batch_send().

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 13:22:00 -07:00
Bhanuprakash Bodireddy
13708b2183 netdev-linux: Use DP_PACKET_BATCH_FOR_EACH in netdev_linux_tap_batch_send.
Use DP_PACKET_BATCH_FOR_EACH macro in netdev_linux_tap_batch_send().

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 13:20:22 -07:00
Bhanuprakash Bodireddy
ee42dd70dc dpif-netdev: Reorder elements in dp_netdev_rxq structure.
By reordering elements in dp_netdev_rxq structure, pad bytes and a hole
can be removed.

Before: structure size: 104, sum holes: 1, sum padbytes:4, cachelines:2
After : structure size:  96, sum holes: 0, sum padbytes:0, cachelines:2

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 12:56:22 -07:00
Bhanuprakash Bodireddy
85e16a45ea netdev-provider: Reorder elements in netdev structure.
By reordering elements in netdev structure, holes can be removed.

Before: structure size: 88, sum holes: 10, cachelines:2
After : structure size: 80, sum holes:  2, cachelines:2

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 12:56:06 -07:00
Bhanuprakash Bodireddy
0d9bdf2e22 netdev-provider: Reorder element in netdev_flow_dump structure.
By reordering bool in netdev_flow_dump structure, pad bytes can be
reduced.

Before: structure size: 32, sum holes: 4, sum padbytes:7, cachelines:1
After : structure size: 24, sum holes: 3, sum padbytes:0, cachelines:1

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 12:55:03 -07:00
Bhanuprakash Bodireddy
fea6740fe2 netdev: Reorder elements in netdev_tunnel_config structure.
By reordering elements in netdev_tunnel_config structure, sum holes and
pad bytes can be reduced.

Before: structure size: 96, sum holes: 17, pad bytes: 4, cachelines:2
After : structure size: 80, sum holes:  5, pad bytes: 0, cachelines:2

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-11-03 12:54:28 -07:00