Re: [Bonding-devel][PATCH]Zero Copy Transmit Support (Update)

David S. Miller
2004-11-12T00:16:34Z

On Fri, 12 Nov 2004 15:51:49 -0800 (PST)
Radheka Godse <radheka.godse@intel.com> wrote:

> -
> +
> + /* We let the bond device publish all hardware
> + * acceleration features possible. This is OK,
> + * since if an skb is passed from the bond to
> + * a slave that doesn't support one of those
> + * features, everything is fixed in the
> + * dev_queue_xmit() function (e.g. calculate
> + * check sum, linearize the skb, etc.).
> + */

This is very inefficient if the bond slaves don't
support these features.

I believe you when you say you saw improvement in the
case where the slaves do support TSO, but if you test
a non-TSO slave case I bet you'll see a marked
decrease in system utilization at least.

The upper layers need to know the precise capabilities
of the device in order to optimize the copy from userspace,
the checksumming, and the data gathering into the SKB.

Therefore, if you "fake it out" like this without checking
what the slaves actually support, then a lot of wasted cpu
time will be spent in each dev_queue_xmit() path. There will
in many cases be multiple passes over the data instead of one,
and it is possible to introduce an extra data copy as well.

I would recommend instead the following algorithm. Publish
only the capabilities which all slaves support.