Skip to content

net: xilinx: axienet: Add 10G/25G (XXV) ethernet support

Suraj Gupta linux-arm-kernel linux-devicetree lkml netdev 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest6 patches 2 repliesIn review
  2. v46 patches 3 repliesSuperseded
  3. v36 patches 10 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v27 patches1 replySuperseded
v17 patches3 repliesSuperseded

Changes in v5 from the cover letter · 21 lines

- Patch 1/6:
* Move the comment on why axienet_dma_err_handler() ignores the mac_init() return value into the patch that adds the call.
* Explain the lp->mii_bus NULL guard in the commit message, and fix the axienet_config kernel-doc for pcs_ops, stats_update and internal_pcs.
* Keep a single axienet_setoptions() and put the option table in axienet_config instead of adding a setoptions callback, which every MAC would have implemented identically.
- Patch 2/6:
* Constrain "managed" to in-band-status and disallow phy-handle, pcs-handle and the deprecated phy and phy-device spellings.
* Add an optional "ref" GT reference clock, clarify that the second clock is the GT helper (dclk), and require the first Tx/Rx DMA channel pair. Note that dmas and dma-names pair up by position.
* Add xlnx,has-statistics-counters: the counters are a PG210 build option and no ability register reports whether they were included.
* Explain in the commit message why xlnx,rxmem is required: probe reads it unconditionally and it bounds the largest frame accepted.
* Drop Rob Herring's Reviewed-by, as the binding has changed since v3.
- Patch 3/6 (new):
* Split the ndo_open / ndo_stop / resume changes out of the XXV patch, as they change 1G behaviour and are a prerequisite for it.
* Propagate the axienet_device_reset() error, previously overwritten by phylink_fwnode_phy_connect() before being checked.
* Clear reset_in_progress on the __axienet_device_reset() error paths, which the propagated error would otherwise leave set, freezing the 1G statistics readers.
* Make axienet_stop() a no-op after a failed open, replacing the per-pointer NULL checks posted earlier, which covered neither the NAPI and interrupt paths nor a failed dma_request_chan().
- Patch 4/6:
* Derive the line rate from phy-mode instead of STAT_CORE_SPEED, which PG210 provides only on 64-bit AXI4-Stream builds.
* Program the MAC RX max packet length from max_frm_size so oversized frames are truncated rather than spilling across descriptors, and finalize max_mtu from the MAC's jumbo capability.
* Set default_an_inband, request the optional "ref" clock, and skip the GT registers in ethtool -d on IP versions that lack them.
* Stop advertising pause until flow control is validated, and demote the RX block-lock timeout to a debug message.
* Name the XXV status registers after PG210; two of them described the

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6net: xilinx: axienet: Introduce axienet_config for MAC-specific opsdrivers/net/ethernet/xilinx/xilinx_axienet.h drivers/net/ethernet/xilinx/xilinx_axienet_main.c+324 -1190 replies
2/6dt-bindings: net: xlnx,xxv-ethernet: Add Xilinx XXV 10G/25G EthernetDocumentation/devicetree/bindings/net/xlnx,xxv-ethernet.yaml MAINTAINERS+147 -02 replies
3/6net: xilinx: axienet: Propagate device reset failure from ndo_opendrivers/net/ethernet/xilinx/xilinx_axienet.h drivers/net/ethernet/xilinx/xilinx_axienet_main.c+42 -40 replies
4/6net: xilinx: axienet: Add 10G/25G (XXV) ethernet supportdrivers/net/ethernet/xilinx/Makefile drivers/net/ethernet/xilinx/xilinx_axienet.h drivers/net/ethernet/xilinx/xilinx_axienet_main.c +2 more+470 -90 replies
5/6net: xilinx: axienet: Dispatch statistics through axienet_config opsdrivers/net/ethernet/xilinx/xilinx_axienet.h drivers/net/ethernet/xilinx/xilinx_axienet_main.c+146 -480 replies
6/6net: xilinx: axienet: Add statistics support for XXV ethernetdrivers/net/ethernet/xilinx/xilinx_axienet.h drivers/net/ethernet/xilinx/xilinx_axienet_main.c drivers/net/ethernet/xilinx/xilinx_axienet_xxv.c +1 more+378 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH net-next v5 0/6] net: xilinx: axienet: Add 10G/25G (XXV) ethernet support

This patch series extends the AXI Ethernet driver to support the XXV Ethernet subsystem.

- Refactor through struct axienet_config so per-MAC behaviour is expressed as capability flags and callbacks instead of runtime MAC-type checks in the shared code.

- Document the XXV IP in Devicetree.

- Propagate a device reset failure out of ndo_open, which XXV bring-up needs, and keep a later ndo_stop safe after a failed resume.

- Add support for the XXV Ethernet subsystem.

- Refactor the statistics into struct axienet_config ops, and add ethtool / ndo_get_stats64 counter reporting for XXV.
---
Notes:
- This series is developed on top of [1]. Only "net: xilinx: axienet:
Derive RX frame length from residue in dmaengine path" from that series is still outstanding; the rest is already in net-next. This series builds and applies without it, but that change is required to get the correct RX completion length on the dmaengine path, which is the only path XXV supports. It is not included here to avoid duplication.
- The series advertises the core's active 10G or 25G rate only. Runtime switching between 10GBASE-R and 25GBASE-R is not supported and can be added later.
- Pause/flow control is not advertised for XXV yet; it is not validated on this IP and will be enabled in a later change.

[1]: https://lore.kernel.org/all/[email protected]/

Changes in v5:
- Patch 1/6:
* Move the comment on why axienet_dma_err_handler() ignores the mac_init() return value into the patch that adds the call.
* Explain the lp->mii_bus NULL guard in the commit message, and fix the axienet_config kernel-doc for pcs_ops, stats_update and internal_pcs.
* Keep a single axienet_setoptions() and put the option table in axienet_config instead of adding a setoptions callback, which every MAC would have implemented identically.
- Patch 2/6:
* Constrain "managed" to in-band-status and disallow phy-handle, pcs-handle and the deprecated phy and phy-device spellings.
* Add an optional "ref" GT reference clock, clarify that the second clock is the GT helper (dclk), and require the first Tx/Rx DMA channel pair. Note that dmas and dma-names pair up by position.
* Add xlnx,has-statistics-counters: the counters are a PG210 build option and no ability register reports whether they were included.
* Explain in the commit message why xlnx,rxmem is required: probe reads it unconditionally and it bounds the largest frame accepted.
* Drop Rob Herring's Reviewed-by, as the binding has changed since v3.
- Patch 3/6 (new):
* Split the ndo_open / ndo_stop / resume changes out of the XXV patch, as they change 1G behaviour and are a prerequisite for it.
* Propagate the axienet_device_reset() error, previously overwritten by phylink_fwnode_phy_connect() before being checked.
* Clear reset_in_progress on the __axienet_device_reset() error paths, which the propagated error would otherwise leave set, freezing the 1G statistics readers.
* Make axienet_stop() a no-op after a failed open, replacing the per-pointer NULL checks posted earlier, which covered neither the NAPI and interrupt paths nor a failed dma_request_chan().
- Patch 4/6:
* Derive the line rate from phy-mode instead of STAT_CORE_SPEED, which PG210 provides only on 64-bit AXI4-Stream builds.
* Program the MAC RX max packet length from max_frm_size so oversized frames are truncated rather than spilling across descriptors, and finalize max_mtu from the MAC's jumbo capability.
* Set default_an_inband, request the optional "ref" clock, and skip the GT registers in ethtool -d on IP versions that lack them.
* Stop advertising pause until flow control is validated, and demote the RX block-lock timeout to a debug message.
* Name the XXV status registers after PG210; two of them described the

    wrong register (0x0400 is STAT_TX_STATUS, 0x0408 is STAT_STATUS).

- Drop the "Make axienet_rmon_ranges non-static for reuse" patch. The XXV RMON callback reports only aggregate counters and leaves ranges NULL, so the table was never reused and can stay static.
- Patch 6/6:
* Gate XAE_FEATURE_STATS on xlnx,has-statistics-counters, and gate the TICK drain, the periodic work and the final snapshot on it, so a design without the block is never touched.
* Move the draining tick after GT reset-done, as the readable STAT_* registers hold unknown data until the first TICK.
* Mask the counter MSB to its low 16 bits, so bits outside the 48-bit counter are not accumulated.
* Report FrameCheckSequenceErrors / rx_crc_errors from stat_rx_packet_bad_fcs, and drop "TX Bad FCS" and "TX Frame Error" from ethtool -S, as both are already folded into tx_errors.
* Keep collection on the periodic work; queries copy the software accumulator and can therefore lag it.

V4: https://lore.kernel.org/all/[email protected]/

Changes in v4:
- Drop the "legacy" nomenclature and use dmaengine / non-dmaengine terminology as it might confuse with MAC instead of driver flow (Andrew Lunn).
- Patch 1/6: Gate the "xlnx,txcsum" DT property behind the MAC's tx_csum capability, so TX checksum offload is not advertised for a MAC whose hardware cannot complete checksums.
- Patch 2/6: Reword the binding description to state that the PCS/PMA is integrated into the IP, and that MDIO bus unavailability and SFP module (I2C) management are detailed in the IP (Andrew Lunn).
- Patch 3/6: Reword the dma_err_handler comment from "legacy embedded-DMA (1G) path" to "non-dmaengine flow (1G MAC)" (Andrew Lunn).
- Advertise only the core's active line rate.

V3: https://lore.kernel.org/all/[email protected]/

Changes in v3:
- Dropped patch 1/7 ("clk: Add devm_clk_bulk_get_enable()"); it has been applied to mainline as commit b698927accb1.
- Patch 2/6 (dt-bindings):
* Added Reviewed-by from Rob Herring. Thanks Rob!

V2: https://lore.kernel.org/all/[email protected]/

Changes in v2:
- Patch 1/7:
* Add Reviewed-by: Brian Masney <[email protected]>. Thanks Brian!
- Patch 3/7:
* Split the XXV binding into its own schema file (xlnx,xxv-ethernet.yaml) instead of extending xlnx,axi-ethernet.yaml with if/then branches, per Rob Herring's review.
* Add a multichannel (MCDMA) example.
- Patch 4/7:
* Require both GT reset-done bits in axienet_xxv_poll_link_ready() so polling does not exit before both the TX and RX resets complete.
V1: https://lore.kernel.org/all/[email protected]/

Suraj Gupta (6):
net: xilinx: axienet: Introduce axienet_config for MAC-specific ops
dt-bindings: net: xlnx,xxv-ethernet: Add Xilinx XXV 10G/25G Ethernet
net: xilinx: axienet: Propagate device reset failure from ndo_open
net: xilinx: axienet: Add 10G/25G (XXV) ethernet support
net: xilinx: axienet: Dispatch statistics through axienet_config ops
net: xilinx: axienet: Add statistics support for XXV ethernet

 .../bindings/net/xlnx,xxv-ethernet.yaml       | 146 ++++
 MAINTAINERS                                   |   1 +
 drivers/net/ethernet/xilinx/Makefile          |   3 +-
 drivers/net/ethernet/xilinx/xilinx_axienet.h  |  96 ++-
 .../net/ethernet/xilinx/xilinx_axienet_main.c | 659 +++++++++++++-----
 .../net/ethernet/xilinx/xilinx_axienet_xxv.c  | 633 +++++++++++++++++
 .../net/ethernet/xilinx/xilinx_axienet_xxv.h  | 151 ++++
 7 files changed, 1506 insertions(+), 183 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/xlnx,xxv-ethernet.yaml
 create mode 100644 drivers/net/ethernet/xilinx/xilinx_axienet_xxv.c
 create mode 100644 drivers/net/ethernet/xilinx/xilinx_axienet_xxv.h
Signature · 1 line
2.25.1