Page MenuHomeFreeBSD

alc(4): make resetting the CCR2004-1G-2XS-PCIe more reliable
Needs ReviewPublic

Authored by ryan_krammer.me on Tue, Sep 1, 10:25 PM.
Tags
None
Referenced Files
F170730250: D59315.id185593.diff
Sun, Sep 6, 6:38 AM
F170653673: D59315.id185593.diff
Sat, Sep 5, 8:14 PM
F170637704: D59315.id185593.diff
Sat, Sep 5, 6:20 PM
Unknown Object (File)
Sat, Sep 5, 8:02 AM
Unknown Object (File)
Sat, Sep 5, 3:02 AM
Unknown Object (File)
Fri, Sep 4, 11:57 PM
Unknown Object (File)
Fri, Sep 4, 7:43 PM
Unknown Object (File)
Fri, Sep 4, 5:58 PM
Subscribers

Details

Reviewers
ivy
Group Reviewers
network
Summary

This card is actually emulating an alc(4) card in firmware, and the firmware-emulated card takes a lot longer to reset than the real cards.

Add a delay before we start polling for a successful reset, and increase the poll interval, only for the Mikrotik card.

Additionally, the card does not appear to clear the reset request bit in the ALC_MASTER_CFG register, so we clear it ourselves after a successful reset.

The card does not yet pass traffic, but resetting the card when bringing it up is significantly more stable.

Test Plan

These changes have been tested against FreeBSD 15.1-STABLE. The hardware configuration is an HP ProDesk SFF desktop computer, with an Intel Core i5-4570 CPU, 8 gigabytes of DDR3 RAM, and the CCR2004-1G-2XS-PCIe card under test running RouterOS 7.24, installed in the first PCI express slot.

Note that I have not tested these changes in a system with a real alc(4) card; I don't own one. However, all changes here are gated to by an existing flag to only operate when the CCR2004 card is detected.

These changes have only been tested on top of D59295, and not in isolation.

Before the changes, if you were to run ifconfig alcN up and ifconfig alcN down enough times, where alcN is a device corresponding to a CCR2004-1G-2XS-PCIe card,
the card would eventually fail to come up, and messages such as "alc0: master reset timeout" would appear in the kernel message log.

After the changes, this behaviour is no longer exhibited, and the card consistently resets successfully.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 76395
Build 73278: arc lint + arc unit