Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Driver not loading for StarTech (ST10GSPEXNB) - Ubuntu Server 18.04.5 LTS; kernel 5.4.0-66-generic #40

Open
christasich opened this issue Mar 2, 2021 · 19 comments

Comments

@christasich
Copy link

I have this NIC here. I cannot get it running on Ubuntu Server 18.04.5 LTS (kernel 5.4.0). I started by trying to build the StarTech drivers from source here. I kept getting permission errors and never successfully built the driver. I then stumbled upon this project. I followed the dkms install directions and everything seems to build smoothly. However, my NIC is still not coming up.

lshw -c network shows this

*-network UNCLAIMED
       description: Ethernet controller
       product: TN9710P 10GBase-T/NBASE-T Ethernet Adapter
       vendor: Tehuti Networks Ltd.
       physical id: 0
       bus info: pci@0000:04:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm pciexpress cap_list
       configuration: latency=0
       resources: memory:d0600000-d060ffff

modprobe tn40xx returns nothing and dmesg shows

[  577.517154] tn40xx: loading out-of-tree module taints kernel.
[  577.517362] tn40xx: module verification failed: signature and/or required key missing - tainting kernel
[  577.518042] Tehuti Network Driver from https://github.com/acooks/tn40xx-driver, 004
[  577.518043] Supported phys :    QT2025 TLK10232 AQR105 MUSTANG

Am I mistaken that the driver should work for my device? Any advice on where to go from here?

@christasich
Copy link
Author

Quick update... Using the StarTech download above, I was able to build the driver from source on kernel 4.14. Per StarTech, that's the latest kernel that they support. I'd still like to get this working with kernel 5.4+, though.

@christasich
Copy link
Author

christasich commented Mar 3, 2021

I was able to patch the StarTech source code to work for Linux 5.4. #19 identified a similar issue in the @acooks driver. The issue was due to a change in the structure of skb_frag_struct (referenced in tn40.c) introduced by Linux 5.4. This was fixed in the @acooks drivers by ce1cbe5. I used this information to patch the StarTech source code tn40.c to include logic for Linux 5.4 (e.g. if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)). I was then able to build the StarTech drivers from source for Linux 5.4! Here is my patched tn40.c version of the StarTech source code in case someone else is having a similar issue.

This still doesn't explain why the @acooks drivers don't initialize my device. I'd still like to figure this out so I can more easily keep my driver up-to-date.

@FLEGA457
Copy link

Hello I believe i have a similar issue for ubuntu 20.04.
The link you shared points to a tn40.h not tn40.c file ?
thanks

@christasich
Copy link
Author

christasich commented Mar 18, 2021

Ooops... thanks for the catch @FLEGA457. I'll maybe do one better here actually. I had to change more than just the tn40.c file. I had to find compatable .hdr files (per the StarTech readme) and make a few changes to the Makefile. Here is my patched source code. This works for my StarTech NIC on Ubuntu Server 20.04.02 LTS using Linux Kernel 5.4.0. Hope it helps!

@FLEGA457
Copy link

Thanks. I still have the network interface UNCLAIMED with lshw -c network. Weird. Need to investigate further.

@christasich
Copy link
Author

Were you able to build the driver from the unzipped source directory using make and then make install? If so, did you follow it up with modprobe tn40xx?

@FLEGA457
Copy link

Yes. It seems I had to deactivate the secure boot to allow the driver to load at startup time. Now it is fine.

@bpinsard
Copy link

bpinsard commented May 14, 2021

I have the same issue on ubuntu 20.04-lts , tried all what was suggested here:

  • disabling secure boot
  • the driver in that repo
  • the driver in the zip in that thread.

The module seems to be loading correctly

$ lsmod  | grep tn40
tn40xx                466944  0

despite following messages:

$ dmesg  | grep tn40
[    2.751162] tn40xx: loading out-of-tree module taints kernel.
[    2.751265] tn40xx: module verification failed: signature and/or required key missing - tainting kernel
[    2.751567] Tehuti Network Driver from https://github.com/acooks/tn40xx-driver, 004

But I still get

$ lshw -c network 
  *-network UNCLAIMED       
       description: Ethernet controller
       product: TN9710P 10GBase-T/NBASE-T Ethernet Adapter
       vendor: Tehuti Networks Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm pciexpress cap_list
       configuration: latency=0
       resources: memory:d0000000-d000ffff

So it seems that the hardware is not recognized by the driver?
Do you any other ideas of things to try.
Many thanks for supporting that driver!

@christasich
Copy link
Author

despite following messages:

$ dmesg  | grep tn40
[    2.751162] tn40xx: loading out-of-tree module taints kernel.
[    2.751265] tn40xx: module verification failed: signature and/or required key missing - tainting kernel

I also get tn40xx: loading out-of-tree module taints kernel. What is different though is Tehuti Network Driver from https://github.com/acooks/tn40xx-driver, 004.

This looks like you're still trying to load the original driver provided by @acooks. I would uninstall the @acooks drivers documentation here) and then build the drivers from source using the modified source code that I posted above.

@bpinsard
Copy link

Thanks, I think I got mixed-up when trying the different versions.
I managed to make yours work with 5.4 but not with 5.8 (one of our machine had that kernel version so I downgraded).
Is there a reason not to merge your changes in the present repository?
Thanks!

@christasich
Copy link
Author

I managed to make yours work with 5.4 but not with 5.8 (one of our machine had that kernel version so I downgraded).

Glad it worked! It sounds like there may be some changes in kernel 5.8 that will require further tweaks. I'm running Ubuntu 20.04 LTS so all my machines are still on 5.4.

Is there a reason not to merge your changes in the present repository?

I'm not a collaborator on this project. I opened this issue when I was having trouble loading drivers for my NIC. This thread has mainly turned into my stream of consciousness while I figure out how to make it work ha.

@numonium
Copy link

numonium commented Dec 21, 2021

hey @christasich - from which commit did you fork your patch?

(or basically if there's a way we could turn that patched code into a PR, so we can update it to work with the latest kernel)

please let me know -- thanks / you're the best! 😸 👍

@christasich
Copy link
Author

christasich commented Dec 21, 2021

@numonium I never properly forked the project, but my patch was on the most recent commit (4e9b17e). I ended up pulling the StarTech card and getting an Intel X550-2 since it has native support without needing to build drivers from source. Hope that helps!

@mail4mrrakesh
Copy link

Ooops... thanks for the catch @FLEGA457. I'll maybe do one better here actually. I had to change more than just the tn40.c file. I had to find compatable .hdr files (per the StarTech readme) and make a few changes to the Makefile. Here is my patched source code. This works for my StarTech NIC on Ubuntu Server 20.04.02 LTS using Linux Kernel 5.4.0. Hope it helps!

Hi I am able to install it on the 5.4 kernel version but when I try with 5.13 getting this output Skipping BTF generation for /root/Networkdriver/tn40xx.ko due to unavailability of vmlinux
make -C /lib/modules/5.13.4-amdsos-build37+/build M=/root/Networkdriver clean
make[1]: Entering directory '/usr/src/linux-headers-5.13.4-amdsos-build37+'
CLEAN /root/Networkdriver/Module.symvers
make[1]: Leaving directory '/usr/src/linux-headers-5.13.4-amdsos-build37+'
Building kernel 5.13.4-amdsos-build37+ resume supported
make -C /lib/modules/5.13.4-amdsos-build37+/build M=/root/Networkdriver modules
make[1]: Entering directory '/usr/src/linux-headers-5.13.4-amdsos-build37+'
CC [M] /root/Networkdriver/tn40.o
CC [M] /root/Networkdriver/CX4.o
CC [M] /root/Networkdriver/CX4_Linux.o
CC [M] /root/Networkdriver/QT2025_phy.o
CC [M] /root/Networkdriver/QT2025_phy_Linux.o
CC [M] /root/Networkdriver/TLK10232_phy.o
CC [M] /root/Networkdriver/TLK10232_phy_Linux.o
CC [M] /root/Networkdriver/AQR105_phy.o
CC [M] /root/Networkdriver/AQR105_phy_Linux.o
CC [M] /root/Networkdriver/MV88X3120_phy.o
CC [M] /root/Networkdriver/MV88X3120_phy_Linux.o
CC [M] /root/Networkdriver/MV88X3310_phy.o
CC [M] /root/Networkdriver/MV88X3310_phy_Linux.o
LD [M] /root/Networkdriver/tn40xx.o
MODPOST /root/Networkdriver/Module.symvers
CC [M] /root/Networkdriver/tn40xx.mod.o
LD [M] /root/Networkdriver/tn40xx.ko
BTF [M] /root/Networkdriver/tn40xx.ko
Skipping BTF generation for /root/Networkdriver/tn40xx.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-5.13.4-amdsos-build37+'
please can you help me to build driver for 5.13 kernal.

@SummerSeaSun
Copy link

I've the same hardware and installed latest release on Debian 11 stable that have kernel Linux server 5.10.0-13-amd64.

Please see: #41 (comment)

Can you please tell me how the interface shoud appear under /sys/class/net/ if it's correctly detected?

Thanks, BR

@jfernandz
Copy link

@numonium I never properly forked the project, but my patch was on the most recent commit (4e9b17e). I ended up pulling the StarTech card and getting an Intel X550-2 since it has native support without needing to build drivers from source. Hope that helps!

I'm a little bit confused, if your patch was included in this repo at (4e9b17e), why I'm having this issue? 🤔 Not sure if your source code in the zip will behave different, @christasich

@acooks
Copy link
Owner

acooks commented Jan 9, 2024

I'm a little bit confused, if your patch was included in this repo at (4e9b17e), why I'm having this issue?

@jfernandz: Please open a new issue and describe:

  • which NIC you have,
  • what distribution and kernel version you have,
  • what error messages you get when you get stuck with version 006 or 'develop' branch.

If it's a NIC based on the Marvell 88X3310 PHY, then unfortunately I cannot help you right now.

@jfernandz
Copy link

jfernandz commented Jan 9, 2024

@acooks well, I didn't want to open a new issue as this one is still open and I've got exactly the same NIC than @christasich and exactly the very same error message when I use modprobe tn40xx

[  577.517154] tn40xx: loading out-of-tree module taints kernel.
[  577.517362] tn40xx: module verification failed: signature and/or required key missing - tainting kernel
[  577.518042] Tehuti Network Driver from https://github.com/acooks/tn40xx-driver, 004
[  577.518043] Supported phys :    QT2025 TLK10232 AQR105 MUSTANG

I'm trying to make my NIC working in Ubuntu 20.04.6 LTS with 5.15.0-88-generic kernel.

I'm curious ... what's exactly the problem with PHY_MV88X3310?

PS: I've actually copied the error message from @christasich because it's pretty similar, but I'd say in my case that line says

[  577.518042] Tehuti Network Driver from https://github.com/acooks/tn40xx-driver, 006

But ... as develop branch is the default one ... I'd say I've been building this one. I didn't do any checkout to some different branch after cloning this repo.

@acooks
Copy link
Owner

acooks commented Jan 9, 2024

I'm curious ... what's exactly the problem with PHY_MV88X3310?

The exact problem with PHY_MV88X3310 is that Marvell has not allowed the firmware for that chip to be redistributed, and therefore this tn40xx driver doesn't include it.

Unfortunately that chip doesn't work at all without the firmware.

You can find copies of the firmware on the internet, and in other drivers, and it can even be extracted from flash chips on other cards, but it cannot be included into a Linux driver or distribution until Marvell makes it available under a suitable license.

Other's have posted helpful comments to Issue #3 and I've tried to link to other kernel discussions about that phy and firmware.

The original poster of this bug had multiple issues:

  • kernel version/ API changes
  • missing firmware

The kernel API issues have been addressed in subsequent releases. The missing firmware remains a problem that you might be able to resolve yourself, but I cannot help you obtain it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants