Hi Paolo,
Nice series! One issue I spotted that interacts with the EEE support
that's currently in net-next:
+ spin_lock(&bp->lock);
+ macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TSTART));
+ spin_unlock(&bp->lock);
macb_xdp_submit_frame() writes TSTART without first waking the MAC
from LPI. The regular TX path in macb_start_xmit() calls
macb_tx_lpi_wake(bp) before TSTART for this reason -- the GEM MAC
has no auto-wake mechanism, so when TXLPIEN is set in NCR, TX is
blocked and frames will sit in the FIFO indefinitely.
This affects XDP_TX, XDP_REDIRECT and ndo_xdp_xmit. The fix should
be straightforward:
spin_lock(&bp->lock);
macb_tx_lpi_wake(bp);
macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TSTART));
spin_unlock(&bp->lock);
macb_tx_lpi_wake() is a no-op when EEE is not active, so there's no
overhead in the non-EEE case.
Thanks,
Nicolai