diff --git a/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/Enable-mlx5-onboard-udev-name.patch b/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/Enable-mlx5-onboard-udev-name.patch new file mode 100644 index 00000000..7c1f6aaa --- /dev/null +++ b/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/Enable-mlx5-onboard-udev-name.patch @@ -0,0 +1,33 @@ +From 0eb52f4a2a5d4d041afae205516515c4393fac2f Mon Sep 17 00:00:00 2001 +From: Steven Webster +Date: Mon, 11 Jul 2022 16:16:13 -0400 +Subject: [PATCH] Enable mlx5 onboard udev name + +Signed-off-by: Steven Webster +--- + SPECS/mlnx-ofa_kernel.spec | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/SPECS/mlnx-ofa_kernel.spec b/SPECS/mlnx-ofa_kernel.spec +index 2a1b956..d83da56 100644 +--- a/SPECS/mlnx-ofa_kernel.spec ++++ b/SPECS/mlnx-ofa_kernel.spec +@@ -91,6 +91,7 @@ Group: System Environment/Base + Source: %{_basename}-%{_version}.tgz + Source100: modules-load.conf + Patch01: 0001-mlx5-pci_irq-Use-irq_update_affinity_hint.patch ++Patch02: 0002-Enable-mlx5-onboard-udev-name.patch + BuildRoot: %{?build_root:%{build_root}}%{!?build_root:/var/tmp/OFED} + Vendor: Mellanox Technologies + Obsoletes: kernel-ib +@@ -267,6 +268,7 @@ mv "$@" source/ + mkdir obj + + %patch01 -p1 ++%patch02 -p1 + + %build + %if 0%{?rhel} == 7 +-- +2.29.2 + diff --git a/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/PATCH_ORDER b/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/PATCH_ORDER index 26d64bcc..8ee40c99 100644 --- a/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/PATCH_ORDER +++ b/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/PATCH_ORDER @@ -1,3 +1,4 @@ Support-STX-system-and-introduce-devtoolset-8.patch mlx5-pci_irq-Use-irq_update_affinity_hint.patch Ensure-that-modules-are-signed.patch +Enable-mlx5-onboard-udev-name.patch diff --git a/kernel-modules/mlnx-ofa_kernel/centos/patches/0002-Enable-mlx5-onboard-udev-name.patch b/kernel-modules/mlnx-ofa_kernel/centos/patches/0002-Enable-mlx5-onboard-udev-name.patch new file mode 100644 index 00000000..5c75a973 --- /dev/null +++ b/kernel-modules/mlnx-ofa_kernel/centos/patches/0002-Enable-mlx5-onboard-udev-name.patch @@ -0,0 +1,57 @@ +From 74ecb6be9dd81ff6a3c28d2d8f9e557cb76009c3 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 +--- + source/ofed_scripts/vf-net-link-name.sh | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/source/ofed_scripts/vf-net-link-name.sh b/source/ofed_scripts/vf-net-link-name.sh +index 65d8a7b..3bf87cc 100755 +--- a/source/ofed_scripts/vf-net-link-name.sh ++++ b/source/ofed_scripts/vf-net-link-name.sh +@@ -68,7 +68,9 @@ if [ "$ID_NET_DRIVER" == "mlx5e_rep" ]; then + fi + + 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:]]}" +@@ -176,9 +178,12 @@ 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 ++ parent_path=`get_pci_name $pci ID_NET_NAME_PATH` ++ fi + fi + echo "NAME=${parent_path}_$PORT" + exit +-- +2.29.2 + diff --git a/kernel-modules/mlnx-ofa_kernel/debian/patches/0002-Enable-mlx5-onboard-udev-name.patch b/kernel-modules/mlnx-ofa_kernel/debian/patches/0002-Enable-mlx5-onboard-udev-name.patch new file mode 100644 index 00000000..aa098fe4 --- /dev/null +++ b/kernel-modules/mlnx-ofa_kernel/debian/patches/0002-Enable-mlx5-onboard-udev-name.patch @@ -0,0 +1,57 @@ +From 74ecb6be9dd81ff6a3c28d2d8f9e557cb76009c3 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 +--- + source/ofed_scripts/vf-net-link-name.sh | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/ofed_scripts/vf-net-link-name.sh b/ofed_scripts/vf-net-link-name.sh +index 65d8a7b..3bf87cc 100755 +--- a/ofed_scripts/vf-net-link-name.sh ++++ b/ofed_scripts/vf-net-link-name.sh +@@ -68,7 +68,9 @@ if [ "$ID_NET_DRIVER" == "mlx5e_rep" ]; then + fi + + 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:]]}" +@@ -176,9 +178,12 @@ 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 ++ parent_path=`get_pci_name $pci ID_NET_NAME_PATH` ++ fi + fi + echo "NAME=${parent_path}_$PORT" + exit +-- +2.29.2 + diff --git a/kernel-modules/mlnx-ofa_kernel/debian/patches/series b/kernel-modules/mlnx-ofa_kernel/debian/patches/series index 5a715395..ef30fbd9 100644 --- a/kernel-modules/mlnx-ofa_kernel/debian/patches/series +++ b/kernel-modules/mlnx-ofa_kernel/debian/patches/series @@ -1 +1,2 @@ 0001-mlx5-pci_irq-Use-irq_update_affinity_hint.patch +0002-Enable-mlx5-onboard-udev-name.patch