2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-21 14:49:41 +00:00
Commit Graph

11 Commits

Author SHA1 Message Date
Simon Horman
f59a10a8b6 datapath: Take a rcu_dereference() in netdev_get_vport()
Although not strictly necessary, this will make this
function more consistent when compatibility for 2.6.36 is added.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2010-08-23 14:37:44 -04:00
Simon Horman
33ef7695b7 datapath: Handle duplicate netdev in netdev_rx_handler_register()
For kernels that have netdev_rx_handler_register() (>=2.6.35),
duplicate netdevs are detected by netdev_rx_handler_register().
So by adding duplicate detection to the netdev_rx_handler_register()
compatibility code the explicit check in netdev_create() can be removed.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2010-08-23 14:37:44 -04:00
Simon Horman
431585099e datapath: dont use non-existent receive hooks
This adds compatibility with kernel changeset
of changeset "net: add rx_handler data pointer"
and thus "net: replace hooks in __netif_receive_skb V5",
which were added between 2.6.35 and 2.6.36-rc1

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2010-08-23 14:37:44 -04:00
Jesse Gross
67c74f7515 datapath: Remove redundant checks on SKBs.
On vport ingress we already check for shared SKBs but then later
warn in several other places.  In a similar vein, we check every
packet to see if it is LRO but only certain vports can produce
these packets.  Remove and consolidate checks to the places where
they are needed.
2010-07-30 13:35:20 -07:00
Jesse Gross
fbb29a542d datapath: Catch missed formatting changes.
A few functions were missed in the change to move the return type
onto the same line as the arguments.
2010-07-29 18:15:14 -07:00
Jesse Gross
fceb2a5bb2 datapath: Put return type on same line as arguments for functions.
In some places we would put the return type on the same line as
the rest of the function definition and other places we wouldn't.
Reformat everything to match kernel style.
2010-07-15 15:09:08 -07:00
Jesse Gross
b4d76c80a0 vport-netdev: Use vport stats layer on 32-bit machines.
Linux devices store stats in counters the size of a machine word,
which are rapidly overflowed on a 32-bit machine.  In this
situation we now use the vport stats layer, which always uses 64-
bit stats.  On 64-bit machines we continue to use the normal
Linux stats to avoid the extra overhead of counting twice.
2010-06-10 14:30:30 -07:00
Jesse Gross
5953c70e61 vport: Move 'extern' declarations of vports to header.
Since vport implementations have no header files they needed to be
declared as extern before being used.  They are currently declared
in vport.c but this isn't safe because the compiler will silently
accept it if the type is incorrect.  This moves those declarations
into vport.h, which is included by all implementations and will
cause errors about conflicting types if there is a mismatch.
2010-06-10 14:29:30 -07:00
Ben Pfaff
106eab5dfd datapath: Fix mutual exclusion with bridge module.
Mutual exclusion with the Linux bridge module has always been a problem.
But I think that this new approach should work reliably.  It is also
simpler.
2010-06-02 15:35:15 -07:00
Jesse Gross
f4267e344a datapath: Enable offloading on internal devices.
Enables checksum offloading, scatter/gather, and TSO on internal
devices.  While these optimizations were not previously enabled on
internal ports we already could receive these types of packets from
Xen guests.  This has the obvious performance benefits when these
packets can be passed directly to hardware.

There is also a more subtle benefit for GRE on Xen.  GRE packets
pass through OVS twice - once before encapsulation and once after
encapsulation, moving through an internal device in the process.
If it is a SG packet (as is common on Xen), a copy was necessary
to linearize for the internal device.  However, Xen uses the
memory allocator to track packets so when the original packet is
freed after the copy netback notifies the guest that the packet
has been sent, despite the fact that it is actually sitting in the
transmit queue.  The guest then sends packets as fast as the CPU
can handle, overflowing the transmit queue.  By enabling SG on
the internal device, we avoid the copy and keep the accounting
correct.

In certain circumstances this patch can decrease performance for
TCP.  TCP has its own mechanism for tracking in-flight packets
and therefore does not benefit from the corrected socket accounting.
However, certain NICs do not like SG when it is not being used for
TSO (these packets can no longer be handled by TSO after GRE
encapsulation).  These NICs presumably enable SG even though they
can't handle it well because TSO requires SG.

Tested controllers (all 1G):
Marvell 88E8053 (large performance hit)
Broadcom BCM5721 (small performance hit)
Intel 82571EB (no change)
2010-05-07 11:29:11 -07:00
Jesse Gross
f2459fe7d9 datapath: Add generic virtual port layer.
Currently the datapath directly accesses devices through their
Linux functions.  Obviously this doesn't work for virtual devices
that are not backed by an actual Linux device.  This creates a
new virtual port layer which handles all interaction with devices.

The existing support for Linux devices was then implemented on top
of this layer as two device types.  It splits out and renames dp_dev
to internal_dev.  There were several places where datapath devices
had to handled in a special manner and this cleans that up by putting
all the special casing in a single location.
2010-04-19 09:11:57 -04:00