How to add a mellanox SR-IOV VF to a docker container ?

I’m looking to see if anyone has managed to add a VF created from a mellanox ConnectX-3 card to a docker container.

I also would like to be able to assign my own mac address to that VF. If I add probe_vf parameter to /etc/modprobe.d/mlx4_core.conf, it appears

the interface ensxxx is brought up and gets assigned a random mac address.

Message was edited by: Chandrasekar Kannan

Hi,

See also here.

https://hub.docker.com/r/mellanox/passthrough-plugin/ https://hub.docker.com/r/mellanox/passthrough-plugin/

This is new plugin addition for Ethernet traffic.

Ophir.

Looks like the best way to set the MAC for for the VF is 'ip link set vf mac '.

Are you looking to run RoCE traffic over the VF or ip traffic?

for ip traffic you can use this - Rakurai/pipework · GitHub. https://github.com/Rakurai/pipework here is the explanation on how it works - Exposing Docker containers with SR-IOV . http://jason.digitalinertia.net/exposing-docker-containers-with-sr-iov/

The idea is to move the interface into the container network namespace. Note that this works for probed VFs (to the host OS).

If you plan to run the commands manually note that 'ip netns exec … ’ will not work since docker is not creating the required symlinks. use nsenter -t -n , for example - nsenter -t 28685 -n ip addr show

Regarding RoCE - RDMA-CM is sadly not aware of network names spaces at the moment. As a result, for time being, you cannot use RoCE from containers that are not part of the host network name space. Some work is being done to enable it.

I will do some research on RoCE and fixed MAC and get back to you soon.

I’ve done only basic testing so if you see any issues please let me know.

Just IP traffic**.** Thanks for the article references.