From c6a43833d3b9bf97049e373d20a6eb7daff91c36 Mon Sep 17 00:00:00 2001 From: Steven Webster Date: Thu, 11 Aug 2022 12:32:48 -0400 Subject: [PATCH] Enable mlx5 onboard udev name This patch prioritizes the udev renaming rule for mlx5 controlled devices to take the onboard name over the slot/path name. This is consistent with the 70-persistent-net.rules file written by the StarlingX installer. It is also consistent with the naming order in the 99-default.link file. Without this patch, there could be an inconsistency with the 70-persistent-net.rules first re-naming the device to its slot/path name, and then being overridden by the Mellanox specific 82-net-setup-link.rules. Signed-off-by: Steven Webster [jm: Adapted the patch for context change] Signed-off-by: Jiping Ma --- ofed_scripts/vf-net-link-name.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ofed_scripts/vf-net-link-name.sh b/ofed_scripts/vf-net-link-name.sh index e22ae76..1134629 100755 --- a/ofed_scripts/vf-net-link-name.sh +++ b/ofed_scripts/vf-net-link-name.sh @@ -93,7 +93,9 @@ function test_if_pf() { } if [ "$skip" == "0" ]; then - if [ -n "$ID_NET_NAME_SLOT" ]; then + if [ -n "$ID_NET_NAME_ONBOARD" ]; then + NAME="${ID_NET_NAME_ONBOARD%%np[[:digit:]]}" + elif [ -n "$ID_NET_NAME_SLOT" ]; then NAME="${ID_NET_NAME_SLOT%%np[[:digit:]]}" elif [ -n "$ID_NET_NAME_PATH" ]; then NAME="${ID_NET_NAME_PATH%%np[[:digit:]]}" @@ -226,11 +228,14 @@ for cnt in {1..2}; do continue fi - parent_path=`get_pci_name $pci ID_NET_NAME_SLOT` + parent_path=`get_pci_name $pci ID_NET_NAME_ONBOARD` if [ -z "$parent_path" ]; then - parent_path=`get_pci_name $pci ID_NET_NAME_PATH` + parent_path=`get_pci_name $pci ID_NET_NAME_SLOT` if [ -z "$parent_path" ]; then - continue + parent_path=`get_pci_name $pci ID_NET_NAME_PATH` + if [ -z "$parent_path" ]; then + continue + fi fi fi echo "NAME=${parent_path}_$PORT" -- 2.43.0