mbox series

[net-next,0/5] mlxsw: Move Tx header handling to PCI driver

Message ID cover.1737044384.git.petrm@nvidia.com (mailing list archive)
Headers show
Series mlxsw: Move Tx header handling to PCI driver | expand

Message

Petr Machata Jan. 16, 2025, 4:38 p.m. UTC
Amit Cohen writes:

Tx header should be added to all packets transmitted from the CPU to
Spectrum ASICs. Historically, handling this header was added as a driver
function, as Tx header is different between Spectrum and Switch-X.

From May 2021, there is no support for SwitchX-2 ASIC, and all the relevant
code was removed.

For now, there is no justification to handle Tx header as part of
spectrum.c, we can handle this as part of PCI, in skb_transmit().

This change will also be useful when XDP support will be added to mlxsw,
as for XDP_TX and XDP_REDIRECT actions, Tx header should be added before
transmitting the packet.

Patch set overview:
Patches #1-#2 add structure to store Tx header info and initialize it
Patch #3 moves definitions of Tx header fields to txheader.h
Patch #4 moves Tx header handling to PCI driver
Patch #5 removes unnecessary attribute

Amit Cohen (5):
  mlxsw: Add mlxsw_txhdr_info structure
  mlxsw: Initialize txhdr_info according to PTP operations
  mlxsw: Define Tx header fields in txheader.h
  mlxsw: Move Tx header handling to PCI driver
  mlxsw: Do not store Tx header length as driver parameter

 drivers/net/ethernet/mellanox/mlxsw/core.c    |  21 +-
 drivers/net/ethernet/mellanox/mlxsw/core.h    |  13 +-
 drivers/net/ethernet/mellanox/mlxsw/i2c.c     |   2 +-
 drivers/net/ethernet/mellanox/mlxsw/pci.c     |  44 +++-
 .../net/ethernet/mellanox/mlxsw/spectrum.c    | 209 ++++--------------
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |  11 +-
 .../ethernet/mellanox/mlxsw/spectrum_ptp.c    |  44 +---
 .../ethernet/mellanox/mlxsw/spectrum_ptp.h    |  28 ---
 .../net/ethernet/mellanox/mlxsw/txheader.h    |  63 ++++++
 9 files changed, 176 insertions(+), 259 deletions(-)