cifsd-team / ksmbd

ksmbd kernel server(SMB/CIFS server)
151 stars 23 forks source link

RDMA and RSS capabilities always 0 for infiniband interfaces. #608

Closed heppu closed 7 months ago

heppu commented 7 months ago

OS: Voidlinux Kernel: Linux 6.5.12_1 Adapter: Mellanox ConnectX-4

I followed the standalone instructions from the readme but wasn't able to establish SMB Direct (RDMA) connection. With wireshark I was able to notice that in FSCTL_QUERY_NETWORK_INTERFACE_INFO the RSS_CAPABLE and RDMA_CAPABLE bits are always set to 0 for my infiniband interface. I added some debug prints into code and noticed that ksmbd_rdma_capable_netdev doesn't get called from transport_rdma.c but instead the stub from header which returns always false. After this discovery I tried compiling with make CONFIG_SMB_SERVER_SMBDIRECT=y but got issues with missing rdma/ib_verbs.h header although I have installed rdma-core-devel package.

I wasn't able to find any documentation or instructions from internet so what would be the proper way to install ksmbd with rdma support working?

namjaejeon commented 7 months ago

You need to enable "Support for SMB Direct protocol" in kernel config first.

<M>   SMB3 server support                                                   │ │  
  │ │      [*]     Support for SMB Direct protocol                                     │ │  
  │ │      [*]     Enable check network administration capability                      │ │  
  │ │      [*]     Support for Kerberos 5
namjaejeon commented 7 months ago

And add "server multi channel support = yes" parameter in ksmb.conf

server multi channel support (G)
              Use of SMB3 multi-channel is supported.  SMB3 multi-channel support is experimental
              and may corrupt data under race conditions.

              Default: server multi channel support = no
namjaejeon commented 7 months ago

Ah,, standalone instruction... You need to find the way to set "CONFIG_SMB_SERVER_SMBDIRECT". Please check Makefile.

heppu commented 7 months ago

Finally noticed my mistake, I had to change CONFIG_SMB_SERVER from y to m and then Support for SMB Direct protocol became visible in config menu. Thanks for the tips!