drivers for thunderbolt HBAs

Hello Humans,

I'd like to experiment with writing device drivers for various thunderbolt PCIe cards. The end goal is to use FreeBSD as a ZFS backed Thunderbolt DAS for my macs. I'd figured Thunderbolt and ZFS would be a great match for post production work without having to fill up drive space on my main drive.. As some may know, the Apple SSD upgrade tax is ridiculous. This will be my first attempt at low level stuff.

Could someone point me in the right direction to get started? Which part of the kernel/driver code should I dig into?

Thanks :)
 
Seems to me you are confused about what a DAS is.

For a Mac you may be better off getting a USB4/Thunderbird 3/4 NVME SSD enclosure and Directly Attach it as a Storage device. It may not be as fast as Mac's builtin SSD but will be faster than whatever you can cobble up with FreeBSD.
 
Seems to me you are confused about what a DAS is.

For a Mac you may be better off getting a USB4/Thunderbird 3/4 NVME SSD enclosure and Directly Attach it as a Storage device. It may not be as fast as Mac's builtin SSD but will be faster than whatever you can cobble up with FreeBSD.

I'm fully aware of what a DAS is. This will basically be a whitebox raid-array, connected via thunderbolt. Think QNAP, Synology, etc.

I appreciate your input, but it doesn't answer my question.

I'm open to real suggestions. thanks.
 
writing device drivers for various thunderbolt PCIe cards
So this would involve the USB layer as well correct?
That is where we are lacking now for USB3 docking ports and USB3 Video I think.

I dont mean to diverge from your topic but all roads lead thru USB stack correct?
 
AFAIK Hans Peter Selasky was the last person to work on USB4 but much work remains. His code is in his github directory under usb4. AFAIK there was another person who was going to take over but didn't in the end -- not sure if there is any newer code. I have started looking at USB4 support and gathering information but I have a lot of bootstrapping to do. Happy to work with anyone else.
 
Think QNAP, Synology, etc.
I looked at what QNAP offers. They seem to offer DAS as well as connection using IP over TB (as a faster network connection) for NAS. I still say that if you want something to work *now* you are better off using USB4 NVME enclosure or commercial devices like QNAP. Separate from anything you may wish to do for FreeBSD!
 
Let me see if I understand your question correctly:

You want to build a box that inside it contains FreeBSD, ZFS, and some storage devices (such as disk drives). On the outside, it will have a Thunderbolt TARGET port that a Mac INITIATOR can plug into, and the Mac will think that the box you built is a disk drive, and store data there.

So your zeroest step is to acquire the hardware required to have a Thunderbolt port on your FreeBSD machine; that might be a freebie if you are using the correct laptop or motherboard (some modern devices use USB4, which is a common superset of Thunderbolt). Then the first step needs to be implementing a Thunderbolt target.

It might be a good idea to start by reading about what Thunderbolt really is. My (foggy?) memory says that in reality, Thunderbolt is just a wiring specification, which underneath contains high speed serial lines that are actually PCIe and/or DP (display port) lines. So I think what you are really wanting to do is to implement a PCIe device, using software emulation.

More or less correct?
 
So this would involve the USB layer as well correct?
That is where we are lacking now for USB3 docking ports and USB3 Video I think.

I dont mean to diverge from your topic but all roads lead thru USB stack correct?

No problem at all mate.

I recall Scott Long previously working on Thunderbolt code some time ago, but that's as far as my knowledge goes. I think his work was mainly done on laptops too.

I'm not sure where to start for accessing the chipset itself on the HBA.

AFAIK Hans Peter Selasky was the last person to work on USB4 but much work remains. His code is in his github directory under usb4. AFAIK there was another person who was going to take over but didn't in the end -- not sure if there is any newer code. I have started looking at USB4 support and gathering information but I have a lot of bootstrapping to do. Happy to work with anyone else.

Appreciate it. That'll give me a place to start looking and review things. Now that I think about it; this'll be great for FreeBSD desktop users also.
 
Let me see if I understand your question correctly:

You want to build a box that inside it contains FreeBSD, ZFS, and some storage devices (such as disk drives). On the outside, it will have a Thunderbolt TARGET port that a Mac INITIATOR can plug into, and the Mac will think that the box you built is a disk drive, and store data there.

So your zeroest step is to acquire the hardware required to have a Thunderbolt port on your FreeBSD machine; that might be a freebie if you are using the correct laptop or motherboard (some modern devices use USB4, which is a common superset of Thunderbolt). Then the first step needs to be implementing a Thunderbolt target.

It might be a good idea to start by reading about what Thunderbolt really is. My (foggy?) memory says that in reality, Thunderbolt is just a wiring specification, which underneath contains high speed serial lines that are actually PCIe and/or DP (display port) lines. So I think what you are really wanting to do is to implement a PCIe device, using software emulation.

More or less correct?

Precisely. Except I'm looking to assemble a barebones system with maybe 4 drives and just a thunderbolt HBA. If i can find a motherboard with built in thunderbolt ports; that'd be even better.
 
I looked at what QNAP offers. They seem to offer DAS as well as connection using IP over TB (as a faster network connection) for NAS. I still say that if you want something to work *now* you are better off using USB4 NVME enclosure or commercial devices like QNAP. Separate from anything you may wish to do for FreeBSD!

I thought about that also. But I figured for us mere mortals this idea would be cleaner, and more simple. Once networking is involved I have to worry about 10gb hubs, switches, cabling, power and all. I just want this to be idiot proof with a simple script to setup in the end.
 
Thunderbolt supports networking across the interface. So you can just configure an IP address on the FreeBSD machine and connect that your computer to it via Thunderbolt network.

However if you want the host to be "invisible" then that would be much more difficult as you would need to get Thunderbolt to work like a USB Mass Storage device. Looks like you would need to add support for NVMe-oF, but exactly how to accomplish that I'm not sure.
 
Looks like you would need to add support for NVMe-oF, but exactly how to accomplish that I'm not sure.
Chelsio Network adapter and Storage Appliance with NVMe over Fiber.
I don't think its ready for production yet. I would not be suprised if you need T6 series.
 
Thunderbolt supports networking across the interface. So you can just configure an IP address on the FreeBSD machine and connect that your computer to it via Thunderbolt network.

That defeats the whole purpose of using Thunderbolt. The idea here is to saturate the 40Gbps interface with a fast, high capacity ZFS array using one cable.
 
Back
Top