On 10/28/14 at 06:43pm, WANG Chao wrote:
Currently we retrieve all the necessary information of an iSCSI
session
and pass them to 2nd kernel. This is wrong way to go for hardware iscsi,
because dracut has already had its own infrastructure to do bring up any
iscsi device configured in firmware of an HBA (Host Bus Bridge).
This patch will determine if an iscsi session is established by firmware
configured iscsi. If it does, then we don't pass anything down to 2nd
kernel. dracut will handle it.
I read some iscsi code and I also talked with storage QE. It's confirmed
that software iscsi will use "tcp" transport class while hardware iscsi
will use like "be2iscsi" "bnx2i" transport class. It's ok to use
the transport name of an iface of a scsi session to determine hardware
iscsi or not. Additionally using "iscsi_firmware" "rd.iscsi.firmware"
to
determine if the system is iscsi boot, because dracut can only handle
this case.
Along this patch, I add the infrastructure of determine iBFT, but it's
not complete yet. Mark the part as "FIXME". Once customer is asking or
maybe I get hold of iBFT box, I can start working on it.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
dracut-module-setup.sh | 77 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 76 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index dcebc47..9616866 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -411,7 +411,78 @@ kdump_get_iscsi_initiator() {
return 1
}
-# No ibft handling yet.
+# Determine hardware iscsi by an iface's transport class.
+# If transport class is tcp, it's software iscsi.
+# If it's be2iscsi, bnx2i, cxgb3i, cxgb4i, it's hardware iscsi.
+kdump_is_iscsi_hw_session() {
+ if [ "$(kdump_iscsi_get_rec_val $1 "iface.transport_name")" =
tcp ]; then
+ return 1
+ fi
+
+ return 0
+}
+
+# FIXME: determine iBFT
+kdump_is_iscsi_ibft_session() {
+ return 1
+}
+
+# kernel cmdline must contain these either of the following arguments
+# for booting off hardware iSCSI:
+# rd.iscsi.firmware[=1], iscsi_firmware
+kdump_is_iscsi_hw_cmdline() {
How about name it as kdump_check_iscsi_hw_cmdline? Have the same
concern about above 2 functions.
+ local cmdline
+
+ cmdline="$(cat /proc/cmdline)"
+
+ for arg in $cmdline; do
+ case "$arg" in
+ "rd.iscsi.firmware" |\
+ "rd.iscsi.firmware=1" |\
+ "iscsi_firmware")
+ return 0
+ ;;
+ esac
+ done
+
+ return 1
+}
+
+# kernel cmdline must contain these either of the following arguments
+# for booting off iBFT:
+# rd.iscsi.ibft[=1], ip=ibft
+kdump_is_iscsi_ibft_cmdline() {
ditto.
+ local cmdline
+
+ cmdline="$(cat /proc/cmdline)"
+
+ for arg in $cmdline; do
+ case "$arg" in
+ "rd.iscsi.ibft" |\
+ "rd.iscsi.ibft=1" |\
+ "ip=ibft")
+ return 0
+ ;;
+ esac
+ done
+
+ return 1
+}
+
+# Sanity check if an iscsi session is established by iBFT or firmware
+kdump_is_iscsi_fw() {
+
+ if kdump_is_iscsi_hw_cmdline && kdump_is_iscsi_hw_session $1; then
+ return 0
+ fi
+
+ if kdump_is_iscsi_ibft_cmdline && kdump_is_iscsi_ibft_session $1; then
+ return 0
+ fi
+
+ return 1
+}
+
kdump_setup_iscsi_device() {
local path=$1
local tgt_name; local tgt_ipaddr;
@@ -434,6 +505,10 @@ kdump_setup_iscsi_device() {
return 1
fi
Could you add the reason why we needn't take care of hw iscsi and ibft
cases in kdump? This can make code more readable.
+ if kdump_is_iscsi_fw ${path}; then
+ return 0;
+ fi
+
tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name")
tgt_ipaddr=$(kdump_iscsi_get_rec_val ${path} "node.conn\[0\].address")
Besides above several small concerns, this patch looks good to me.
Thanks, Chao.
--
1.9.3
_______________________________________________
kexec mailing list
kexec(a)lists.fedoraproject.org
https://lists.fedoraproject.org/mailman/listinfo/kexec