dpaa2-eth: add support for software TSO
authorIoana Ciornei <ioana.ciornei@nxp.com>
Wed, 9 Feb 2022 09:23:34 +0000 (11:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Feb 2022 13:15:35 +0000 (13:15 +0000)
commit3dc709e0cd47c602a8d1a6747f1a91e9737eeed3
treea91fcce7f0c681816d4d12d29d27092ba7f06cdb
parenta4ca448e8bfef0def568a6283a69d9cf018fd2c8
dpaa2-eth: add support for software TSO

This patch adds support for driver level TSO in the enetc driver using
the TSO API.

There is not much to say about this specific implementation. We are
using the usual tso_build_hdr(), tso_build_data() to create each data
segment, we create an array of S/G FDs where the first S/G entry is
referencing the header data and the remaining ones the data portion.

For the S/G Table buffer we use the same cache of buffers used on the
other non-GSO cases - dpaa2_eth_sgt_get() and dpaa2_eth_sgt_recycle().

We cannot keep a DMA coherent buffer for all the TSO headers because the
DPAA2 architecture does not work in a ring based fashion so we just
allocate a buffer each time.

Even with these limitations we get the following improvement in TCP
termination on the LX2160A SoC, on a single A72 core running at 2.2GHz.

before: 6.38Gbit/s
after:  8.48Gbit/s

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c