Skip to content

hisi_higmac: harden bare-minimum driver toward production parity (TSO, EEE, ethtool, multicast, PM) #45

@widgetii

Description

@widgetii

Context

PR #44 landed the hisi_higmac driver — a minimal mainline port of the vendor's 3000-line higmac driver from Hi3516A_SDK_V1.0.8.0. The mainline version is 990 lines and intentionally stripped to the descriptor-ring TX/RX path that QEMU emulates and that real hardware needs to boot.

Sufficient for: ifup, DHCP, ping, SSH, web management.
Insufficient for: production camera traffic patterns (high-throughput RTSP streams, dropped-frame tracking, power management).

Missing vs. vendor driver

Feature Vendor (4.9 BSP) Mainline hisi_higmac
TSO (TCP Segmentation Offload) ✅ via TSO_COE_CTRL (0x02E8) + descriptor tso_* flags
COE checksum offload ✅ IPv4/IPv6 RX+TX checksum
EEE / autoEEE ✅ separate autoeee/ sub-driver, PHY-coordinated
AVS (adaptive voltage scaling) ✅ via open_pm.ko hooks
Statistics / ndo_get_stats64 ✅ HW counters ❌ (only core netdev counters)
ethtool ops ✅ link/speed/wol/coalesce/strings/stats
Multicast hash filter ✅ 128-bit MAC filter table ❌ (runs permissive — broadcast + multicast pass)
PM suspend/resume ❌ (HW defaults across suspend)
WoL (Wake-on-LAN) ✅ via PMU magic packet detect
RX coalescing tuning ✅ via RX_COALESCED_* regs
VLAN HW offload

Suggested phasing

Phase 1 — usability gaps

  • ndo_get_stats64: read RX_PKT_CNT, TX_PKT_CNT, RX_OCTET_CNT, TX_OCTET_CNT, RX_DROP_CNT from HW counters. Cheap, high-value for monitoring.
  • ethtool_ops with at least: get_drvinfo, get_link, get_settings, get_strings, get_stats. Lets userspace ethtool eth0 work.
  • Multicast hash filter: program the 128-bit table from dev->mc.list so multicast users (IGMP, mDNS) don't all hit the slow path.

Phase 2 — performance

  • TSO + COE checksum offload: vendor uses TSO_COE_CTRL to enable IPv4/IPv6 TCP segmentation in HW. Significant win for RTSP/video streaming.
  • RX coalescing tuning: vendor defaults are 8 frames or 0x74 (line RX_COALESCED_FRAMES/RX_COALESCED_TIMER); make these ethtool-tunable.

Phase 3 — power

  • PM suspend/resume: assert reset → restore on resume → reprogram ring base addresses, IRQ mask, port_en.
  • EEE / autoEEE: significant complexity (vendor has a separate sub-driver); defer until phase 1/2 land.
  • WoL + AVS: defer.

Why minimum-viable was the right scope for #44

Driver landed alongside hi3516av100_neo firmware bring-up (OpenIPC/firmware#2122). DoD was "QEMU boots + DHCP + ping" — bare-minimum meets that. Production hardening can layer on without changing the IP register layout assumptions. The driver also doesn't yet have real-hardware validation; phase 1 should arrive alongside the first hardware test of the av100_neo image.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions