How to install drivers for a NIC? (AQtion AQC107/XG-C100C)

Anda

Explorer
Joined
Aug 12, 2015
Messages
63
Hey guys,

so I recently got the aboved mentioned 10GBE Card. At that point I didn't knew that there is now driver for this card/s.

So I got in contact with the support and they told me to they are working on it.
A few weeks later and I got the driver now:

https://www.dropbox.com/s/1j0ybm6nj8gj1n8/freebsd-drv-v0.0.2.zip?dl=0

So my question? Can I compile the driver on the CLI and test it/installed the driver or should I test that on a fresh FreeBSD system?
If so which FreeBSD version is FreeNAS running on?

Or do you guys have better ideas?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,681
It may be possible to do this, but FreeNAS is really an appliance and isn't meant to be hacked on. Things will break when you run an update, for example.

You may be better off requesting that the driver be added. Submit requests like this through the "Report a Bug" link found at the top of the page.
 

Anda

Explorer
Joined
Aug 12, 2015
Messages
63
It may be possible to do this, but FreeNAS is really an appliance and isn't meant to be hacked on. Things will break when you run an update, for example.

You may be better off requesting that the driver be added. Submit requests like this through the "Report a Bug" link found at the top of the page.

Okay, I created a bug report.
Hope that will help :)
https://jira.ixsystems.com/browse/NAS-101990
 

trdevaney

Cadet
Joined
Jun 11, 2019
Messages
3
So glad this is happening. I bought two of them and was going to sell one to get one that is compatible with FreeNAS.
 

Anda

Explorer
Joined
Aug 12, 2015
Messages
63
So glad this is happening. I bought two of them and was going to sell one to get one that is compatible with FreeNAS.

I bought mine a few months ago :D But I think It will still take some time till the driver will be in FreeBSD or FreeNAS.

Till then I'm gonna hack around and try to get it working. And update here ofc.
 

Anda

Explorer
Joined
Aug 12, 2015
Messages
63

Luckas

Cadet
Joined
Jun 28, 2019
Messages
2
Hello,
I've send a few messages to Aquantia and I've finally found how to compile the driver.
The last github version is here (now v0.0.4): https://github.com/Aquantia/aqtion-freebsd/archive/master.zip
I've compiled the driver and obtained the if_atlantic.ko file.
The instructions to compile are:
  1. Load sources: fetch -o /tmp ftp://ftp.freebsd.org/pub/`uname -s`/releases/`uname -m`/`uname -r | cut -d'-' -f1,2`/src.txz
  2. Become superuser: su
  3. Unzip sources: tar xzf /tmp/src.txz -C /
  4. Download archive with driver and extract it
  5. Build driver: make
  6. Load driver: kldload ./if_atlantic.ko
I've attached here the if_atlantic.ko result file.
 

Attachments

  • if_atlantic.ko.zip
    25.3 KB · Views: 2,693

trdevaney

Cadet
Joined
Jun 11, 2019
Messages
3
Anyone load the drive yet? I'd try it but I'm not that fluent with shell for FreeNas.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Anyone load the drive yet? I'd try it but I'm not that fluent with shell for FreeNas.
Look into the kldload command in the FreeBSD hand book. Don't forget to add the enable line in you rc.conf file.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Also this WILL break with every update.
 

trdevaney

Cadet
Joined
Jun 11, 2019
Messages
3
Look into the kldload command in the FreeBSD hand book. Don't forget to add the enable line in you rc.conf file.
I was able to load the driver using kldload, and see it as a network interface but no luck with finding the command that you are talking about. Sorry I am super new at FreeBSD.
 

Tock

Dabbler
Joined
Jul 15, 2014
Messages
11
Hi,

I was wondering how can I make the driver load after a restart? I tried the commands below as pre init and post init script but it did not work.
Code:
cd /
kldload usr/if_atlantic.ko


Edit:

Seems like I found the problem. The Script used Line Ending Windows Style (CRLF) and I had to change it to Unix (LF).
 
Last edited:

Anda

Explorer
Joined
Aug 12, 2015
Messages
63
Hey guys,

we now have a dev port. https://www.freshports.org/net/aquantia-atlantic-kmod/

Does someone know how I can install that port? Pkg is not available for dev ports. I tried to make/build it with the previous idea (from Luckas) but it didn't work for me.

I saw that the driver got aimed for FreeNAS 12. Would it maybe be possible to shift it to the 11.3 Nightlies? (Running on them).

Otherwise I guess I can wait a bit more.
 

appliance

Explorer
Joined
Nov 6, 2019
Messages
96
Does someone know how I can install that port? Pkg is not available for dev ports. I tried to make/build it with the previous idea (from Luckas) but it didn't work for me.
Installing port is as easy as typing pkg install aquantia-atlantic-kmod-0.0.5 and adding if_atlantic_load="YES" to /boot/loader.conf.
Tried this way and Luckas attached KO file with success on FreeNAS 11.2 and 11.3. The official package is compatible with FreeBSD 11, 12, 13.


# pkg search aquantia
aquantia-atlantic-kmod-0.0.5 Aquantia AQtion (Atlantic) Network Driver (Development Preview)
# pkg install aquantia-atlantic-kmod-0.0.5
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
aquantia-atlantic-kmod: 0.0.5 [FreeBSD]

Installed packages to be REINSTALLED:
pkg-1.12.0 [FreeBSD] (options changed)

Number of packages to be installed: 1
Number of packages to be reinstalled: 1

The operation will free 25 MiB.
3 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/2] Fetching pkg-1.12.0.txz: 100% 3 MiB 1.8MB/s 00:02
[2/2] Fetching aquantia-atlantic-kmod-0.0.5.txz: 100% 22 KiB 22.9kB/s 00:01
Checking integrity... done (0 conflicting)
[1/2] Reinstalling pkg-1.12.0...
[1/2] Extracting pkg-1.12.0: 100%
[2/2] Installing aquantia-atlantic-kmod-0.0.5...
[2/2] Extracting aquantia-atlantic-kmod-0.0.5: 100%
# kldload /boot/modules/if_atlantic.ko
# vi /boot/loader.conf



Issues:
- both ways (boot conf or your own pre-boot script to kldload) are wiped out after OS update (ok for me as i use 10gbit just between NAS and PC)
- performance is limited by
1) the hardware itself (max 3.5gbit for anyone i got report from) -- using 5gbit QNAP USB3 device at the moment and all tests are single user sequential
2) the driver or operating system, lacks more in single thread speed than other OS with the same hardware and "same" setup:

iperf3 to NAS 1 / 2 / 4 threads : 2.2 2.8 3.4
iperf3 -R 1 / 2 / 4 threads : 2.2 2.8 3.45

3) the freebsd services

samba big files read 390MBs vs 400MBs on debian ZFS (still not bad sequential performance given iperf above and lack of multithreads like in debian)
samba big files write 370MBs vs 400MBs on debian ZFS (again, there are some hiccups, it's never a flat line, without chopiness it'd be pure 3.5gbs)
above could be attributed to driver perhaps, but this sucks:
samba medium files up to 50% slower
samba tiny files up to 100% slower (no matter what, sync=disabled, encryption off etc)
on top of that, NFS is ~100% slower than freebsd samba, ironically, while non-kernel debian NFS was ~100% faster than samba, in other words, 4x faster than freenas NFS. i don't use it as i hate Win10Pro NFS client implementation.
Overall CPU usage is very nice on X3421 Gen10, hardly 50% used with encryption on at around laughable 20 watts.
ARC utilization doesn't really help with reads or writes. Did hundreds of tests, and i do read tests from cache (proven by monitoring) and from disk if needed. The small to medium files (MP3s and JPGs) are a big performance bottleneck, this is i think a limitation of samba. Debian pipelines single user somehow, freebsd only ZFS. No samba tweaks help. Writes rely on drive activity and i'd need 10gbit NIC to check if there's any boost as right now NIC speed <= drive speed. Using all types of drives - new NVME, SSD, and RAIDZ drives. Even direct benchmarks are lower (-50% on NVME dd vs debian). Freebsd needs to catch up to 10gbit era, soon people will upgrade to thunderbolt speeds and then higher. ideally 10gbit will be soon obsoleted like H264 and SATA, so we can build proper NVME-like RAIDs (hopefully non PCI in future), have to count on each client having an NVME drive with 3GBs speed...
 

Zyrox

Dabbler
Joined
Aug 7, 2019
Messages
10
I'm using FreeNAS 11.2 U5 and I had to activate pkg *like here*.

@appliance I followed your instructions but the ethernet interface isn't listed under Network -> Interfaces -> ADD

If I
# kldload /boot/modules/if_atlantic.ko
kldload: an error occurred while loading the module. Please check dmesg(8) for more details.

and

kldload: unexpected relocation type 4
kldload: unexpected relocation type 4
KLD if_atlantic.ko: depends on kernel - not available or version mismatch
linker_load_file: Unsupported file type

What have I done wrong?
 

appliance

Explorer
Joined
Nov 6, 2019
Messages
96
What have I done wrong?
hmm not sure.. R_X86_64_PLT32 relocation type was in commit earlier this year, perhaps upgrade. also diff module to kernel:
diff <(file /boot/modules/if_atlantic.ko) <(file /boot/kernel/kernel)
also try Luckas module, no real difference, it's 2 seconds:
wget https://www.ixsystems.com/community/attachments/if_atlantic-ko-zip.31610/
unzip index.html
mv if_atlantic.ko /usr/
rm index.html
kldload /usr/if_atlantic.ko #add to pre-init script
 

Zyrox

Dabbler
Joined
Aug 7, 2019
Messages
10
Ok Danke. Hm, is there another way to see if the driver is loaded correctly?

# wget https://www.ixsystems.com/community/attachments/if_atlantic-ko-zip.31610/
--2019-11-07 23:57:34-- https://www.ixsystems.com/community/attachments/if_atlantic-ko-zip.31610/
Resolving www.ixsystems.com (www.ixsystems.com)... 38.109.202.239
Connecting to www.ixsystems.com (www.ixsystems.com)|38.109.202.239|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 25908 (25K) [application/octet-stream]
Saving to: ‘index.html’

index.html 100%[===================>] 25.30K 147KB/s in 0.2s

2019-11-08 01:47:23 (147 KB/s) - ‘index.html’ saved [25908/25908]

# unzip index.html
Archive: index.html
extracting: if_atlantic.ko
# mv if_atlantic.ko /usr/
# rm index.html
# kldload /usr/if_atlantic.ko
kldload: can't load /usr/if_atlantic.ko: module already loaded or in kernel
#
# diff <(file /boot/modules/if_atlantic.ko) <(file /boot/kernel/kernel)1c1
< /boot/modules/if_atlantic.ko: ELF 64-bit LSB relocatable, x86-64, version 1 (FreeBSD), not stripped---
> /boot/kernel/kernel: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /red/herring, not stripped
#
 

appliance

Explorer
Joined
Nov 6, 2019
Messages
96
so your is already loaded? if not remove the package then install the other way. to check success of either module:
1) loaded? should show an entry
kldstat|grep atlantic
2) loaded? all atlantic logs with highlight of the target status
dmesg|grep atlantic|grep -z "loaded"
3) visible?
check UI\Network\Interfaces
 

Zyrox

Dabbler
Joined
Aug 7, 2019
Messages
10
I have updated FreeNAS now. Does it mattter if I write if_atlantic_load="YES" at the end of /boot/loader.conf ?

Before I restarted FreeNAS

# kldstat|grep atlantic
25 1 0xffffffff82e37000 9e10 if_atlantic.ko
# dmesg|grep atlantic|grep -z "loaded"
#

After it shows that

# kldstat|grep atlantic
# dmesg|grep atlantic|grep -z "loaded"
#
 
Top