From cc2c48a0b3b97781e7e10e8fc9bd0a74c4c5bce2 Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Fri, 16 Aug 2024 22:33:18 +0200 Subject: [PATCH] fix(iscsi): don't require network setup for bnx2i The bnx2i iSCSI transport doesn't require networking to be set up in order to bring up iSCSI connections. Quite to the contrary, trying to bring up the network may actually disturb the iSCSI connection. This holds in particular for bnx2i device with NPAR (network partitioning) support, where a given network interface can be used for both iSCSI and regular networking. Setting certain network parameters like MTU on the network side can fatally disrupt an existing iSCSI connection. Even if this does not happen, trying to bring up the regular network interfaces is pointless because iSCSI won't be enabled over regular TCP/IP anyway. Trying to bring up the network interfaces and possibly failing delays booting unecessarily and may cause timeout, without benefit. Detect the bnx2i offload module at setup time and communicate it to parse-iscsiroot.sh using a new parameter, "rd.iscsi.transport". It's currently only effective for bnx2i. It might be useful for other transports as well, but we haven't been able to test the other transports as thoroughly as bnx2i. Signed-off-by: Martin Wilck --- man/dracut.cmdline.7.adoc | 8 ++++++++ modules.d/95iscsi/module-setup.sh | 1 + modules.d/95iscsi/parse-iscsiroot.sh | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/man/dracut.cmdline.7.adoc b/man/dracut.cmdline.7.adoc index 19b11fbfa..5492165ae 100644 --- a/man/dracut.cmdline.7.adoc +++ b/man/dracut.cmdline.7.adoc @@ -877,6 +877,14 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30 **rd.iscsi.testroute=0**: Turn off checking, if the route to the iSCSI target IP is possible before trying to login. +**rd.iscsi.transport=____**:: + Set the iSCSI transport name (see man:iscsiadm[8,external]). iSCSI offload + transports like **bnx2i** don't need the network to be up in order to bring + up iSCSI connections. This parameter indicates that network setup can be + skipped in the initramfs, which makes booting with iSCSI offload cards + faster and more reliable. This parameter currently only has an effect for + _=bnx2i_. + FCoE ~~~~ **rd.fcoe=0**:: diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh index 94cd5858c..1b2ea1106 100755 --- a/modules.d/95iscsi/module-setup.sh +++ b/modules.d/95iscsi/module-setup.sh @@ -54,6 +54,7 @@ install_ibft() { echo -n "rd.iscsi.ibft=1 " fi echo -n "rd.iscsi.firmware=1 " + [ -z "$ibft_mod" ] || echo -n "rd.iscsi.transport=$ibft_mod " fi done } diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh index 7a584a5fe..2dace3a63 100755 --- a/modules.d/95iscsi/parse-iscsiroot.sh +++ b/modules.d/95iscsi/parse-iscsiroot.sh @@ -28,6 +28,7 @@ if [ -z "$netroot" ]; then fi [ -z "$iscsiroot" ] && iscsiroot=$(getarg iscsiroot=) [ -z "$iscsi_firmware" ] && getargbool 0 rd.iscsi.firmware -y iscsi_firmware && iscsi_firmware="1" +[ -z "$iscsi_transport" ] && iscsi_transport=$(getarg rd.iscsi.transport=) [ -n "$iscsiroot" ] && [ -n "$iscsi_firmware" ] && die "Mixing iscsiroot and iscsi_firmware is dangerous" @@ -79,7 +80,7 @@ fi # iscsi_firmware does not need argument checking if [ -n "$iscsi_firmware" ]; then if [ "$root" != "dhcp" ] && [ "$netroot" != "dhcp" ]; then - [ -z "$netroot" ] && netroot=iscsi: + [ -z "$netroot" ] && [ "$iscsi_transport" != bnx2i ] && netroot=iscsi: fi modprobe -b -q iscsi_boot_sysfs 2> /dev/null modprobe -b -q iscsi_ibft -- 2.47.3