Bug 242654 - Bgx driver fails to match PHY on ThunderX after r336281
Summary: Bgx driver fails to match PHY on ThunderX after r336281
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: arm64 Any
: --- Affects Some People
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-15 20:22 UTC by Marcel
Modified: 2019-12-21 16:17 UTC (History)
3 users (show)

See Also:


Attachments
output from ofwdump on thunderX (60.96 KB, text/plain)
2019-12-17 04:30 UTC, Marcel
no flags Details
proposed patch (2.71 KB, patch)
2019-12-17 16:14 UTC, Mark Johnston
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel 2019-12-15 20:22:05 UTC
Following base r336281 the onboard NIC on ThunderX boards fails to load properly with the BGX driver (specifically on MT30-GS2, but it likely applies to others). In particular, during boot it warns:

bgx0: Could not find matching PHY

and vnic setup via iovctl fails.

Manually removing the check in base r336281 fixes this warning and allows the vnic setup to complete successfully.
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2019-12-16 18:16:59 UTC
Can you provide the FDT for this system?  Output of "ofwdump -ap" or "sysctl -b hw.fdt | dtc -I dtb -I dts".
Comment 2 Marcel 2019-12-17 04:30:01 UTC
Created attachment 210001 [details]
output from ofwdump on thunderX

Attached output from ofwdump. The other command bails out with "Failed to Parse Tree".

The fun part of the ofwdump is probably:

# cat ofwdump.txt | grep xfi
            Node 0x408c: xfi00
            Node 0x40f0: xfi01
            Node 0x4154: xfi02
            Node 0x41b8: xfi03
          Node 0x46e4: xfi00
          Node 0x4728: xfi01
          Node 0x476c: xfi02
          Node 0x47b0: xfi03
Comment 3 Mark Johnston freebsd_committer freebsd_triage 2019-12-17 16:14:24 UTC
Created attachment 210009 [details]
proposed patch

(In reply to Marcel from comment #2)
Thanks.  Instead of reverting r336281 can you try the attached patch?
Comment 4 Marcel 2019-12-18 05:07:02 UTC
(In reply to Mark Johnston from comment #3)

Appears to do the trick:

# dmesg | grep bgx
bgx0: <ThunderX BGX Ethernet I/O Interface> mem 0x87e0e0000000-0x87e0e03fffff,0x87e0e0400000-0x87e0e07fffff at device 0.128 on pci1
bgx1: <ThunderX BGX Ethernet I/O Interface> mem 0x87e0e1000000-0x87e0e13fffff,0x87e0e1400000-0x87e0e17fffff at device 0.129 on pci1
Comment 5 Mark Johnston freebsd_committer freebsd_triage 2019-12-18 21:42:32 UTC
(In reply to Marcel from comment #4)
Thank you.
Comment 6 commit-hook freebsd_committer freebsd_triage 2019-12-18 21:42:51 UTC
A commit references this bug:

Author: markj
Date: Wed Dec 18 21:41:53 UTC 2019
New revision: 355887
URL: https://svnweb.freebsd.org/changeset/base/355887

Log:
  vnic: Relax PHY node matching after r336281.

  The phy name may apparently be followed by a number in some systems.
  Allow that.

  PR:		242654
  Reported and tested by:	Marcel <marcel@brickporch.com>
  MFC after:	3 days
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/sys/dev/vnic/thunder_bgx_fdt.c
Comment 7 commit-hook freebsd_committer freebsd_triage 2019-12-21 16:17:05 UTC
A commit references this bug:

Author: markj
Date: Sat Dec 21 16:16:43 UTC 2019
New revision: 355983
URL: https://svnweb.freebsd.org/changeset/base/355983

Log:
  MFC r355887:
  vnic: Relax PHY node matching after r336281.

  PR:	242654

Changes:
_U  stable/12/
  stable/12/sys/dev/vnic/thunder_bgx_fdt.c
Comment 8 Mark Johnston freebsd_committer freebsd_triage 2019-12-21 16:17:42 UTC
Thanks for the report.