ACTION!="add", GOTO="mlnx_ofed_name_end"
SUBSYSTEM!="net", GOTO="mlnx_ofed_name_end"

# Rename physical interfaces (first case) of virtual functions (second case).
# Example names:
# enp8s0f0np0 -> enp8s0f0
# enp8s0f0np1v12 -> enp8s0f0v12
DRIVERS=="mlx5_core", \
PROGRAM="/bin/sh -c 'echo $env{ID_NET_NAME_PATH} | sed -r -e s/np[01]$// -e s/np[01]v/v/'", \
        ENV{ID_NET_NAME_PATH}="$result"

LABEL="mlnx_ofed_name_end"

