Hey, Obviously I can't vouch for the below being the right fit for you, and frankly it likely install a bunch of crud you don't need, however, when I install a new node with a connectx-2 card, I run the below as part of my setup, and it just works. YMMV, and generally you may want to research each of these to determine if it makes sense for you, but this is out of my setup notes.
Code:
apt-get -y install mdadm libibverbs1 ibverbs-utils librdmacm1 rdmacm-utils libdapl2 ibsim-utils ibutils libcxgb3-1 libibmad5 libibumad3 libmlx4-1 libmthca1 libnes1 infiniband-diags mstflint opensm perftest srptools
apt-get -y -t buster-backports install libibverbs1 librdmacm1 libibmad5 libibumad3 librdmacm1 ibverbs-providers rdmacm-utils infiniband-diags libfabric1 ibverbs-utils
apt-get -y install libmlx4-1 infiniband-diags ibutils ibverbs-utils rdmacm-utils perftest
#Then add to /etc/network/interfaces:
# Insert your own device name in place of ibs4 all throughout:
auto ibs4
iface ibs4 inet static
address 192.168.2.4
netmask 255.255.255.0
broadcast 192.168.2.255
#hwaddress ether random
mtu 65520
pre-up modprobe ib_ipoib
pre-up echo connected > /sys/class/net/ibs4/mode