Page MenuHomeFreeBSD

ixgbe: improve MDIO performance by reducing semaphore/IPC delays
Needs ReviewPublic

Authored by adrian on May 11 2025, 2:46 AM.
Tags
None
Referenced Files
F121158884: D50295.diff
Tue, Jun 24, 4:49 AM
Unknown Object (File)
Sat, Jun 7, 2:02 AM
Unknown Object (File)
Sat, May 31, 11:16 PM
Unknown Object (File)
Thu, May 29, 7:45 PM
Unknown Object (File)
Tue, May 27, 9:52 PM
Unknown Object (File)
May 23 2025, 1:54 AM
Unknown Object (File)
May 21 2025, 9:56 AM
Unknown Object (File)
May 21 2025, 4:37 AM

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

Each MDIO transfer takes 8ms, and all of that is spent in a set
of DELAY() calls, which is consuming a LOT of CPU.

  • Change the timeout in ixgbe_hic_unlocked() - doing IPC to the on-chip firmware - to a 1uS delay and bump timeout appropriately. This seems to finish in a couple of microseconds on my local test devices.
  • Change the 2ms sleep in ixgbe_release_swfw_sync_X540() to 2ms for EEPROM/flash, and 10uS otherwise. 10uS seems to work fine on my local testing, but the config EEPROM doesn't read right without this extra delay.

The first change shouldn't change the driver behaviour, but the
latter change is more intrusive and needs some wider testing.
(My guess here is that there SHOULD have been some completion
check somewhere in the EEPROM/flash IO path, and these sleeps
are masking them.)

Locally tested:

  • C3558 (Denverton) w/ X553 backplane

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 64078
Build 60962: arc lint + arc unit

Event Timeline

Owners added a reviewer: Restricted Owners Package.May 11 2025, 2:46 AM

The first change seems sensible.

For the second change, It would be nice to have some citation on the timing or behavior (for instance a data sheet, another driver) or corroboration from an intel insider that this is thought to be ok. My own curiosity.. what is the delay even doing after the swfw release, are we missing or working around some mmio sync, or is the fw side not obeying memory ordering? Maybe we can just get rid of it.. inquiring minds want to know :)

kgalazka added inline comments.
sys/dev/ixgbe/ixgbe_x540.c
882

I've found a vouge note that this delay was added to prevent some issue with link establishment after a HW reset. It doesn't explain though why it was needed here, instead of e.g. somewhere in ixgbe_reset_hw_X540. Let me dig a bit more.

sys/dev/ixgbe/ixgbe_x540.c
882

thanks! have you found anything yet? Can you say which chipset(s) it was trying to fix?