When I installed a Mellanox ConnectX-2 in my Dell PowerEdge R210ii running pfSense, I had one major issue: It was almost as if the card wasn't being recognized by pfSense at all. After looking around, I realized that pfSense does not include drivers for this Mellanox SFP+ network adapter by default. However, these can easily be installed with the following steps.

Credit to https://github.com/eliplan312/Mellanox-ConnectX-2-pfSense for providing the kernel modules and installation guide for this.

To install these kernel modules, simply go to the pfSense command prompt under "Diagnostics".

First of all, download the drivers using the following command:

curl -L https://github.com/eliplan312/Mellanox-ConnectX-2-pfSense/releases/download/v1.0/Mellanox.zip -o Mellanox.zip

After executing that command, you will have to unzip the folder, so run the following command next:

unzip Mellanox.zip

Now that all the kernel modules are unzipped, you will have to copy them to /boot/kernel so they will be loaded at boot:

cp Mellanox/*.ko /boot/kernel/

Next, set the proper permissions on the modules by running the following command:

chmod 555 /boot/kernel/ml*.ko
chmod 555 /boot/kernel/linuxkpi.ko

After this, you can run the following command to load the module without restarting:

kldload mlx4en

If everything worked properly, your ConnectX-2 card should show up in pfSense, however it will not be automatically loaded on boot. To automatically load this kernel module on boot, add mlx4en_load="YES" to the end of /boot/loader.conf by typing the following command:

echo "mlx4en_load="YES"" >> /boot/loader.conf

After following all the previous steps, you can remove the original .zip and extracted kernel modules you downloaded:

rm -r Mellanox*

Congrats, your Mellanox ConnectX-2 should now work on pfSense!

Disclaimer: The drivers in this are not provided by me. If you would prefer to compile your own kernel modules for this (a lot more work, however), you can follow this guide instead: https://forum.netgate.com/topic/116768/howto-mellanox-connectx-2-10gb-sfp