[RFC net-next 00/10] Add TSO map-once DMA helpers and bnxt SW USO support

Joe Damato posted 10 patches 4 weeks ago
There is a newer version of this series
drivers/net/ethernet/broadcom/bnxt/Makefile   |   2 +-
drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 159 ++++++++++++---
drivers/net/ethernet/broadcom/bnxt/bnxt.h     |  27 +++
.../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  19 +-
drivers/net/ethernet/broadcom/bnxt/bnxt_gso.c | 188 ++++++++++++++++++
drivers/net/ethernet/broadcom/bnxt/bnxt_gso.h |  31 +++
include/net/tso.h                             |  45 +++++
net/core/tso.c                                | 165 +++++++++++++++
8 files changed, 601 insertions(+), 35 deletions(-)
create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_gso.c
create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_gso.h
[RFC net-next 00/10] Add TSO map-once DMA helpers and bnxt SW USO support
Posted by Joe Damato 4 weeks ago
Greetings:

This series extends net/tso to add a data structure and some helpers allowing
drivers to DMA map headers and packet payloads a single time. The helpers can
then be used to reference slices of shared mapping for each segment. This
helps to avoid the cost of repeated DMA mappings, especially on systems which
use an IOMMU. N per-packet DMA maps are replaced with a single map for the
entire GSO skb.

The added helpers are then used in bnxt to add support for software UDP
Segmentation Offloading (SW USO) for older bnxt devices which do not have
support for USO in hardware. Since the helpers are generic, other drivers
can be extended similarly.

Early testing shows a ~4x reduction in DMA mapping calls at the same wire
packet rate.

Special care is taken to make bnxt ethtool operations work correctly: the ring
size cannot be reduced below a minimum threshold while USO is enabled and
growing the ring automatically re-enables USO if it was previously blocked.

Thanks,
Joe

Joe Damato (10):
  net: tso: Introduce tso_dma_map
  net: tso: Add tso_dma_map helpers
  net: bnxt: Export bnxt_xmit_get_cfa_action
  net: bnxt: Add a helper for tx_bd_ext
  net: bnxt: Use dma_unmap_len for TX completion unmapping
  net: bnxt: Add TX inline buffer infrastructure
  net: bnxt: Add boilerplate GSO code
  net: bnxt: Implement software USO
  net: bnxt: Add SW GSO completion and teardown support
  net: bnxt: Dispatch to SW USO

 drivers/net/ethernet/broadcom/bnxt/Makefile   |   2 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 159 ++++++++++++---
 drivers/net/ethernet/broadcom/bnxt/bnxt.h     |  27 +++
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  19 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_gso.c | 188 ++++++++++++++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_gso.h |  31 +++
 include/net/tso.h                             |  45 +++++
 net/core/tso.c                                | 165 +++++++++++++++
 8 files changed, 601 insertions(+), 35 deletions(-)
 create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_gso.c
 create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_gso.h

-- 
2.52.0
Re: [RFC net-next 00/10] Add TSO map-once DMA helpers and bnxt SW USO support
Posted by Joe Damato 4 weeks ago
On Tue, Mar 10, 2026 at 02:21:48PM -0700, Joe Damato wrote:
> Greetings:
> 
> This series extends net/tso to add a data structure and some helpers allowing
> drivers to DMA map headers and packet payloads a single time. The helpers can
> then be used to reference slices of shared mapping for each segment. This
> helps to avoid the cost of repeated DMA mappings, especially on systems which
> use an IOMMU. N per-packet DMA maps are replaced with a single map for the
> entire GSO skb.
> 
> The added helpers are then used in bnxt to add support for software UDP
> Segmentation Offloading (SW USO) for older bnxt devices which do not have
> support for USO in hardware. Since the helpers are generic, other drivers
> can be extended similarly.

Sorry for the noise; just realized this implementation is buggy.

Will fix and send an RFC v2, but this series is the general idea of what I'll be
posting, for anyone interested.