# Mellanox ConnectX-3 w/FreeBSD 11.2 p6



## KYP112 (May 1, 2019)

Hi Everyone,

I just setup PfSense 2.4.4 p2 with FreeBSD 11.2 Release p6 on an HP server node. Now I am looking to install the drivers for a dual 40gbe port Mellanox network card that I have in the slot.

I followed the tutorials online to install FreeBSD in a vm and compile the drivers. However I noticed mlxen module is no where to be found in any folder and when I go to compile.

I can compile mlx4, mlx4en, mlx5, and mlx5en but no mlxen. I have been checking online everywhere to see why as I am on the correct branch for 11.2 and did git clone in the vm so everything else worked just fine.

This card is new to me and first time going through this process before.

Any thoughts? or advice on where I can best find that module? I am searching through the forum to see if this was answered before unless I missed it.

Thank you!


----------



## Phishfry (May 2, 2019)

No need to compile anything. Drivers are already built.








						Mellanox MCX311A running at 10GbE.
					

Well I picked up a MCX311A card because I need a 4x PCIe 10-Gigabit Ethernet card for my firewall. The card is so small it is amazing. Half the height of a Low Profile bracket. One SFP+ socket. They are selling for $27 bucks used on ebay so I bought one. I was happy to find out that it works...




					forums.freebsd.org


----------



## KYP112 (May 2, 2019)

Thank you for the reply and great to hear drivers are already built. This is what I followed initially: 








						HowTo: Mellanox Connectx-2 10gb SFP+
					

I managed to pull this off with some help all over the internet, but I want to compile it all in one place, especially for those who are non-freebsd/linux/not-windows savvy. As for the "why" the reason is simple. I had a stack of these cards, they're in a...




					forum.netgate.com
				




So basically I just need to add to loader.conf the necessary lines for mlx4en?

Such as you mentioned in that thread link?
/etc/rc.conf
ifconfig_mlxen0="DHCP"

/boot/loader.conf
mlx4en_load="YES"

Also I was following online it is suggested to do a kldload mlxen to load the drivers and the problem is mlxen does not exist on my pfsense box. I did previously compile and transfer mlx4, mlx4en, mlx5, and mlx5en ko files before I posted this thread.

This is what I was following previously and noticed more people compiling drivers for FreeBSD 11+.
https://www.freebsd.org/cgi/man.cgi?query=mlx4en&sektion=&manpath=freebsd-release-ports (I see it says run kldload mlx4en)


----------



## KYP112 (May 2, 2019)

Okay when I try to do a kldload mlx4en this is the response I get in PfSense shell see attached. Version mismatch and unsupported file type. I am thinking when I compiled the drivers I transferred over to /boot/kernel/ they are from 11.2p4 FreeBSD and not p6 would that have anything to do with it?


----------



## Phishfry (May 2, 2019)

I have never copied over modules before. I did not think it was possible, but I see it in this post too.








						NIC Broadcom 57412 10Gb not recognized
					

Hi, We're running pfSense 2.4.4 on a Dell Poweredge R640 with 2 Broadcom 57412, one with two 1Gb and two 10gb ports and the other with two 10gb ports. None of the four 10Gb ports are recognized. I checked with "pciconf -lv", the ports appear as none@ : no...




					forum.netgate.com
				



Patch level should not matter unless the patch was related to the the module.

We have strayed over the line here. pfSense is not an appropriate support topic here. Don't want to be a jerk but it is the rule.
Without rules we have anarchy.


----------



## Phishfry (May 3, 2019)

The answer lies here in the manual for module(9)


> MODULE_DEPEND(foo,    bar, 1,    3, 4);


So modules have dependencies. Now look at the messages you presented.
linuxkpi and mlx4 modules are also going to be needed by pfSense. They are dependencies.
You might need to run through it several times until you have copied over all depend modules.
linuxkpi might have its own set of dependencies.


----------



## KYP112 (May 3, 2019)

Thank you and sorry about that I was not sure how much I could mention about that software but will keep it out of here understood. 

I see you mean run it through compiling the drivers or adding them on directly? Sorry still figuring out whether I should get it from the FreeBSD VM or do it directly. Now are they should be all located on the latest release 11.2 p6.


----------



## Phishfry (May 3, 2019)

It looks like you can copy the modules over directly. I wouldn't worry about the patch level.
Copy those two ko's over and reboot, see if it compains about any more missing links.


----------



## KYP112 (May 3, 2019)

Okay I will check tomorrow morning back at the office. Thank you for the help. I will let you know the results.


----------



## KYP112 (May 3, 2019)

Okay some reason looking for linuxkpi to create a ko but unable to locate it as of yet. I am completely newbie to all this. Thought it would be in the modules folder but nothing there. I have it under boot/kernel. Ah ok let me try transferring again. I have attached my results after copying over new linuxkpi, mlx4, mlx4en ko files into boot/kernel/


----------



## KYP112 (May 4, 2019)

Is there a better route than instead of compiling the drivers? If the modules are already with FreeBSD 11.2 I would think I could load them on the main FreeBSD machine itself.


----------



## KYP112 (May 4, 2019)

Progress added the linuxkpi ko again and have a different message this time. 

mlx4en.ko: Unsupported file layout


----------



## KYP112 (May 4, 2019)

Okay I believe figured it out here is a screenshot of the ports getting initialized after running _kldload mlx4en_ command. Are there any further steps required?


----------



## Phishfry (May 4, 2019)

Not that I know of. Since your using that other OS you might not use the /etc/rc.conf setting and just use the /boot/loader.conf part.
That starts the driver, then I would use the WebGUI to configure it.
Consider me out. You must use the other forum now.


----------

