xcp icon indicating copy to clipboard operation
xcp copied to clipboard

kernel: enable thunderbolt driver

Open hoerup opened this issue 5 years ago • 17 comments

currently thunderbolt driver is not compiled with the kernel, please enable it as a module

hoerup avatar Jun 29 '20 08:06 hoerup

Hi,

Can you please provide a bit more context? Use case, why etc?

olivierlambert avatar Jun 29 '20 08:06 olivierlambert

For using TB3 10gb NIC connected over thunderbolt. See https://xcp-ng.org/forum/topic/3239/10gbe-over-thunderbolt3

hoerup avatar Jul 01 '20 08:07 hoerup

That's a bit better with the forum post linked :)

Your contribution is welcome, how should we proceed @stormi so @hoerup can contribute by bringing TB support in XCP-ng? Should we have an extra kernel for it?

olivierlambert avatar Jul 01 '20 08:07 olivierlambert

No extra kernel, but can be built as a module. Whether to include it by default in main kernel (for 8.2) or make it an additional package is to be decided. I suppose @rushikeshjadhav can also add it to kernel-alt.

stormi avatar Jul 01 '20 09:07 stormi

So you can "distribute" a kernel module via a RPM? Is that mutually exclusive by make it into kernel-alt? I'm thinking from user perspective, what's the easiest path.

olivierlambert avatar Jul 01 '20 09:07 olivierlambert

Will have to check if that module can independently go in a RPM. Sometimes apart from module, some kernel enablement is needed.

If works, It will be independent rpm for main kernel and the module will be baked inside kernel-alt. We don't maintain separate module RPMs for kernel-alt.

rushikeshjadhav avatar Jul 01 '20 09:07 rushikeshjadhav

We already distribute kernel modules via RPMs for the main kernel: alternate drivers, modified coretemp module, zfs modules, etc. For kernel-alt currently all modules must be included in the kernel-alt package.

See https://xcp-ng.org/docs/develprocess.html#kernel-module-policy

stormi avatar Jul 01 '20 09:07 stormi

@hoerup can you share # lspci -k and # lsmod from your setup of thunderbolt? I could package thunderbolt.ko but I see there is also another module as thunderbolt-net.ko and want to confirm whether that's being used.

rushikeshjadhav avatar Jul 01 '20 13:07 rushikeshjadhav

afaik thunderbolt-net is used for direct host-2-host communication over a thunderbolt cable (which is a whole other scenario)

requested output is here https://gist.github.com/hoerup/37b5315c192cce4c04fa59ed789f74a9

hoerup avatar Jul 01 '20 14:07 hoerup

there is also the matter of packaging the bolt utilities (http://vault.centos.org/7.6.1810/os/Source/SPackages/bolt-0.4-3.el7.src.rpm ). @stormi if you could create a new repo in xcp-ng-rpms i'd gladly create a pr for it

hoerup avatar Jul 02 '20 07:07 hoerup

Those bolt utilities pull dependencies that I'm not sure we want on dom0:

===================================================================================================
 Package                                          Arch                                 Version                                       Repository                          Size
===================================================================================================
Installing:
 bolt                                             x86_64                               0.7-1.el7                                     base                               149 k
Installing for dependencies:
 mozjs17                                          x86_64                               17.0.0-20.el7                                 base                               1.4 M
 polkit                                           x86_64                               0.112-26.el7                                  base                               170 k
 polkit-pkla-compat                               x86_64                               0.1-4.el7                                     base                                39 k

Can it be made to work without those (at least, without polkit)?

stormi avatar Jul 02 '20 09:07 stormi

@hoerup can you check question above Can it be made to work without those (at least, without polkit)?

rushikeshjadhav avatar Jul 23 '20 06:07 rushikeshjadhav

Maybe it is possible to create a fork and rewrite it without polkit but its not a trivial task

hoerup avatar Jul 23 '20 07:07 hoerup

We will need to get some community testing dome with those polkit on its effect on dom0.

rushikeshjadhav avatar Aug 02 '20 06:08 rushikeshjadhav

AFAIR polkit api was used all over the bolt source code but, bolt is more or less a helper tool wrapping /sys/bus/thunderbolt/ making it more convenient - so even thought would be nice it's not a hard requirement in order to get tb3/tb4 devices running

ref: https://www.kernel.org/doc/html/latest/admin-guide/thunderbolt.html

hoerup avatar Jul 14 '21 11:07 hoerup

It would be nice to gain access to this, using ip over thunderbolt as a backplane would be pretty ideal in certain situations.

personally, i want to plug a thunderbolt to thunderbolt cable between some server motherboard pairs.

dezren39 avatar Jul 19 '22 07:07 dezren39

@dezren39 thunderbolt.ko is already built with recent versions of xcpng. But it sounds like you are regering to thunderbolt-net, which afair isnt built by default. But i think that is an entirely different issue, so please open a separate issue

hoerup avatar Jul 19 '22 07:07 hoerup