scsi: add iSCSI iBFT Support
Subsystems (3)
PATCH 16/17 scsi: add iSCSI iBFT Support
From: Konrad Rzeszutek <[email protected]>
Add /sysfs/firmware/ibft/[initiator|targetX|ethernetX] directories along with text properties which export the the iSCSI Boot Firmware Table (iBFT) structure.
What is iSCSI Boot Firmware Table? It is a mechanism for the iSCSI tools to extract from the machine NICs the iSCSI connection information so that they can automagically mount the iSCSI share/target. Currently the iSCSI information is hard-coded in the initrd. The /sysfs entries are read-only one-name-and-value fields.
The usual set of data exposed is:
# for a in `find /sys/firmware/ibft/ -type f -print`; do echo -n "$a: "; cat $a; done /sys/firmware/ibft/target0/target-name: iqn.2007.com.intel-sbx44:storage-10gb /sys/firmware/ibft/target0/nic-assoc: 0 /sys/firmware/ibft/target0/chap-type: 0 /sys/firmware/ibft/target0/lun: 00000000 /sys/firmware/ibft/target0/port: 3260 /sys/firmware/ibft/target0/ip-addr: 192.168.79.116 /sys/firmware/ibft/target0/flags: 3 /sys/firmware/ibft/target0/index: 0 /sys/firmware/ibft/ethernet0/mac: 00:11:25:9d:8b:01 /sys/firmware/ibft/ethernet0/vlan: 0 /sys/firmware/ibft/ethernet0/gateway: 192.168.79.254 /sys/firmware/ibft/ethernet0/origin: 0 /sys/firmware/ibft/ethernet0/subnet-mask: 255.255.252.0 /sys/firmware/ibft/ethernet0/ip-addr: 192.168.77.41 /sys/firmware/ibft/ethernet0/flags: 7 /sys/firmware/ibft/ethernet0/index: 0 /sys/firmware/ibft/initiator/initiator-name: iqn.2007-07.com:konrad.initiator /sys/firmware/ibft/initiator/flags: 3 /sys/firmware/ibft/initiator/index: 0
For full details of the IBFT structure please take a look at:
ftp://ftp.software.ibm.com/systems/support/system_x_pdf/ibm_iscsi_boot_firmware_table_v1.02.pdf
---
Documentation/ABI/testing/sysfs-ibft | 23 arch/x86/kernel/setup_32.c | 3 arch/x86/kernel/setup_64.c | 4 drivers/firmware/Kconfig | 20 drivers/firmware/Makefile | 2 drivers/firmware/iscsi_ibft.c | 982 +++++++++++++++++++++++++ drivers/firmware/iscsi_ibft_find.c | 84 ++ include/linux/iscsi_ibft.h | 50 + 8 files changed, 1168 insertions(+)
Documentation/ABI/testing/sysfs-ibft new file +23 -0
@@ -0,0 +1,23 @@ +What: /sys/firmware/ibft/initiator +Date: November 2007 +Contact: Konrad Rzeszutek <[email protected]> +Description: The /sys/firmware/ibft/initiator directory will contain + files that expose the iSCSI Boot Firmware Table initiator data. + Usually this contains the Initiator name. + +What: /sys/firmware/ibft/targetX +Date: November 2007 +Contact: Konrad Rzeszutek <[email protected]> +Description: The /sys/firmware/ibft/targetX directory will contain + files that expose the iSCSI Boot Firmware Table target data. + Usually this contains the target's IP address, boot LUN, + target name, and what NIC it is associated with. It can also + contain the CHAP name (and password), the reverse CHAP + name (and password) + +What: /sys/firmware/ibft/ethernetX +Date: November 2007 +Contact: Konrad Rzeszutek <[email protected]> +Description: The /sys/firmware/ibft/ethernetX directory will contain + files that expose the iSCSI Boot Firmware Table NIC data. + This can this can the IP address, MAC, and gateway of the NIC.
arch/x86/kernel/setup_32.c renamed from arch/x86/kernel/setup_32.c~scsi-add-iscsi-ibft-support +3 -0
@@ -39,6 +39,7 @@#include <linux/efi.h> #include <linux/init.h> #include <linux/edd.h> +#include <linux/iscsi_ibft.h> #include <linux/nodemask.h> #include <linux/kexec.h> #include <linux/crash_dump.h>
@@ -691,6 +692,8 @@ void __init setup_bootmem_allocator(void#endif numa_kva_reserve ();reserve_crashkernel (); + +reserve_ibft_region (); }/*
arch/x86/kernel/setup_64.c renamed from arch/x86/kernel/setup_64.c~scsi-add-iscsi-ibft-support +4 -0
@@ -34,6 +34,7 @@#include <linux/acpi.h> #include <linux/kallsyms.h> #include <linux/edd.h> +#include <linux/iscsi_ibft.h> #include <linux/mmzone.h> #include <linux/kexec.h> #include <linux/cpufreq.h>
@@ -446,6 +447,9 @@ void __init setup_arch(char **cmdline_p) }#endif reserve_crashkernel (); + +reserve_ibft_region (); +paging_init ();map_vsyscall ();
drivers/firmware/Kconfig renamed from drivers/firmware/Kconfig~scsi-add-iscsi-ibft-support +20 -0
@@ -93,4 +93,24 @@ config DMIID information from userspace through /sys/class/dmi/id/ or if you want DMI-based module auto-loading. +config ISCSI_IBFT_FIND + bool "iSCSI Boot Firmware Table Attributes" + depends on X86 + default n + help + This option enables the kernel to find the region of memory + in which the ISCSI Boot Firmware Table (iBFT) resides. This + is necessary for iSCSI Boot Firmware Table Attributes module to work + properly. + +config ISCSI_IBFT + tristate "iSCSI Boot Firmware Table Attributes module" + depends on ISCSI_IBFT_FIND + default n + help + This option enables support for detection and exposing of iSCSI + Boot Firmware Table (iBFT) via sysfs to userspace. If you wish to + detect iSCSI boot parameters dynamically during system boot, say Y. + Otherwise, say N. + endmenu
drivers/firmware/Makefile renamed from drivers/firmware/Makefile~scsi-add-iscsi-ibft-support +2 -0
@@ -8,3 +8,5 @@ obj-$(CONFIG_EFI_PCDP) += pcdp.o obj-$(CONFIG_DELL_RBU) += dell_rbu.o obj-$(CONFIG_DCDBAS) += dcdbas.o obj-$(CONFIG_DMIID) += dmi-id.o +obj-$(CONFIG_ISCSI_IBFT_FIND) += iscsi_ibft_find.o +obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o
drivers/firmware/iscsi_ibft.c new file +982 -0
982 lines not on this page · raw message
drivers/firmware/iscsi_ibft_find.c new file +84 -0
84 lines not on this page · raw message
include/linux/iscsi_ibft.h new file +50 -0
50 lines not on this page · raw message
_
James Bottomley
maintainerQuoted 47 lines · On Fri, 2008-03-28 at 14:48 -0700, [email protected] wrote:
From: Konrad Rzeszutek <[email protected]>
Add /sysfs/firmware/ibft/[initiator|targetX|ethernetX] directories along with text properties which export the the iSCSI Boot Firmware Table (iBFT) structure.
What is iSCSI Boot Firmware Table? It is a mechanism for the iSCSI tools to extract from the machine NICs the iSCSI connection information so that they can automagically mount the iSCSI share/target. Currently the iSCSI information is hard-coded in the initrd. The /sysfs entries are read-only one-name-and-value fields.
The usual set of data exposed is:
# for a in `find /sys/firmware/ibft/ -type f -print`; do echo -n "$a: "; cat $a; done /sys/firmware/ibft/target0/target-name: iqn.2007.com.intel-sbx44:storage-10gb /sys/firmware/ibft/target0/nic-assoc: 0 /sys/firmware/ibft/target0/chap-type: 0 /sys/firmware/ibft/target0/lun: 00000000 /sys/firmware/ibft/target0/port: 3260 /sys/firmware/ibft/target0/ip-addr: 192.168.79.116 /sys/firmware/ibft/target0/flags: 3 /sys/firmware/ibft/target0/index: 0 /sys/firmware/ibft/ethernet0/mac: 00:11:25:9d:8b:01 /sys/firmware/ibft/ethernet0/vlan: 0 /sys/firmware/ibft/ethernet0/gateway: 192.168.79.254 /sys/firmware/ibft/ethernet0/origin: 0 /sys/firmware/ibft/ethernet0/subnet-mask: 255.255.252.0 /sys/firmware/ibft/ethernet0/ip-addr: 192.168.77.41 /sys/firmware/ibft/ethernet0/flags: 7 /sys/firmware/ibft/ethernet0/index: 0 /sys/firmware/ibft/initiator/initiator-name: iqn.2007-07.com:konrad.initiator /sys/firmware/ibft/initiator/flags: 3 /sys/firmware/ibft/initiator/index: 0For full details of the IBFT structure please take a look at:
ftp://ftp.software.ibm.com/systems/support/system_x_pdf/ibm_iscsi_boot_firmware_table_v1.02.pdf[[email protected]: fix build]Signed-off-by Konrad Rzeszutek <[email protected]>Cc Mike Christie <[email protected]>Cc Peter Jones <[email protected]>Cc James Bottomley <[email protected]>Cc Greg KH <[email protected]>Signed-off-by Andrew Morton <[email protected]>
Quoted 9 lines
Documentation/ABI/testing/sysfs-ibft | 23 arch/x86/kernel/setup_32.c | 3 arch/x86/kernel/setup_64.c | 4 drivers/firmware/Kconfig | 20 drivers/firmware/Makefile | 2 drivers/firmware/iscsi_ibft.c | 982 +++++++++++++++++++++++++ drivers/firmware/iscsi_ibft_find.c | 84 ++ include/linux/iscsi_ibft.h | 50 + 8 files changed, 1168 insertions(+)
Um, this has no piece in the SCSI tree or any of our allied files ... it's basically partly in arch/x86 and partly in drivers/firmware. It's job is to export parameters from a rom bios. I think it belongs to Greg ...
James
On Friday 28 March 2008 18:
Quoted 11 lines
Quoted 10 lines
Documentation/ABI/testing/sysfs-ibft | 23 arch/x86/kernel/setup_32.c | 3 arch/x86/kernel/setup_64.c | 4 drivers/firmware/Kconfig | 20 drivers/firmware/Makefile | 2 drivers/firmware/iscsi_ibft.c | 982 +++++++++++++++++++++++++ drivers/firmware/iscsi_ibft_find.c | 84 ++ include/linux/iscsi_ibft.h | 50 + 8 files changed, 1168 insertions(+)
Quoted 6 lines
Um, this has no piece in the SCSI tree or any of our allied files ... it's basically partly in
arch/x86and partly indrivers/firmware. It's job is to export parameters from a rom bios. I think it belongs to Greg ...James
Greg,
If it wouldn't be too much trouble, could you give this an ACK please?
Thanks
Quoted 17 lines · Konrad Rzeszutek
On Friday 28 March 2008 18:
Quoted 16 lines
Quoted 10 lines
Documentation/ABI/testing/sysfs-ibft | 23 arch/x86/kernel/setup_32.c | 3 arch/x86/kernel/setup_64.c | 4 drivers/firmware/Kconfig | 20 drivers/firmware/Makefile | 2 drivers/firmware/iscsi_ibft.c | 982 +++++++++++++++++++++++++ drivers/firmware/iscsi_ibft_find.c | 84 ++ include/linux/iscsi_ibft.h | 50 + 8 files changed, 1168 insertions(+)Um, this has no piece in the SCSI tree or any of our allied files ... it's basically partly in
arch/x86and partly indrivers/firmware. It's job is to export parameters from a rom bios. I think it belongs to Greg ...
Quoted 6 lines
Quoted 1 line
James
Greg,
If it wouldn't be too much trouble, could you give this an ACK please?
Hm, I thought I did, my appologies.
Send it on over to me, I'll send it through my tree, as no one else seems to want it :)
thanks,
greg k-h