]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(iscsi): don't require network setup for bnx2i
authorMartin Wilck <mwilck@suse.com>
Fri, 16 Aug 2024 20:33:18 +0000 (22:33 +0200)
committerLaszlo <laszlo.gombos@gmail.com>
Sat, 18 Jan 2025 00:42:31 +0000 (19:42 -0500)
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 <mwilck@suse.com>
man/dracut.cmdline.7.adoc
modules.d/95iscsi/module-setup.sh
modules.d/95iscsi/parse-iscsiroot.sh

index 19b11fbfad00ffaace8f59fe13301acf47b11a59..5492165ae1c1562d9341853e6c1dbc398aeebfb4 100644 (file)
@@ -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=__<transport_name>__**::
+    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
+    _<transport_name>=bnx2i_.
+
 FCoE
 ~~~~
 **rd.fcoe=0**::
index 94cd5858cc87b6d10b43201cc2183d77a4f14cbe..1b2ea1106a43e6f4c9673bacb7d83805f99908a6 100755 (executable)
@@ -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
 }
index 7a584a5fe3cfaf50f1a1e29076143571de7a8e7c..2dace3a63665b77d348936170257dbf3293b968b 100755 (executable)
@@ -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