Re: [PATCH] Add iSCSI iBFT support (v0.4.6)

Previous thread: [PATCH 20/23 -v8] trace preempt off critical timings by Steven Rostedt on Wednesday, January 30, 2008 - 5:04 pm. (1 message)

Next thread: [GIT PATCH] intermediate SCSI update for 2.6.24 by James Bottomley on Wednesday, January 30, 2008 - 5:44 pm. (1 message)
To: Andrew Morton <akpm@...>, <linux-kernel@...>, Greg KH <greg@...>, <michaelc@...>
Cc: <dwm@...>, <darnok@...>, <pjones@...>, <konradr@...>, <konradr@...>, <randy.dunlap@...>, <hpa@...>, <lenb@...>, <mike.anderson@...>, <dwm@...>, <arjan@...>, Andy Whitcroft <apw@...>, <James.Bottomley@...>
Date: Wednesday, January 30, 2008 - 5:37 pm

This patch (v0.4.6) adds /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_f...

Signed-off-by: Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: Peter Jones <pjones@redhat.com>

---

Documentation/ABI/testing/sysfs-ibft | 23
arch/x86/kernel/setup_32.c | 3
arch/x86/kernel/setup_64.c | 4
drivers/firmware/Kconfig ...

To: Konrad Rzeszutek <konrad@...>
Cc: Andrew Morton <akpm@...>, <linux-kernel@...>, Greg KH <greg@...>, <michaelc@...>, <dwm@...>, <darnok@...>, <pjones@...>, <konradr@...>, <konradr@...>, <randy.dunlap@...>, <hpa@...>, <lenb@...>, <mike.anderson@...>, <dwm@...>, <arjan@...>, Andy Whitcroft <apw@...>
Date: Friday, February 1, 2008 - 8:18 pm

Some pieces of the patch are obviously wrong: find_ibft() shouldn't be
in ibft_init ... if ibft_phys was zero, it means the bootmem reservation
wasn't done and you shouldn't be poking about in memory which has likely
now been overwritten.

Also, why is ibft_phys the global variable you pass? You never actually
want to use the physical address, what you always end up using is the
kernel virtual address.

I'd simply use the ibft variable to point to the virtual address of the
ibft or null if not found, then you can throw out all the phys_to_virt()
calls.

Also, move the reserve_bootmem into the ibft_find routines and ensure
they're only called once on boot. Refuse to attach the ibft driver if
the virtual pointer ibft is null.

James

--

To: James Bottomley <James.Bottomley@...>
Cc: Andrew Morton <akpm@...>, <linux-kernel@...>, Greg KH <greg@...>, <michaelc@...>, <dwm@...>, <darnok@...>, <pjones@...>, <konradr@...>, <konradr@...>, <randy.dunlap@...>, <hpa@...>, <lenb@...>, <mike.anderson@...>, <dwm@...>, <arjan@...>, Andy Whitcroft <apw@...>
Date: Friday, February 8, 2008 - 4:37 pm

James,

Thanks for your review. If you wouldn't mind, can you take a look
at the version 0.4.7 (http://lkml.org/lkml/2008/2/8/350) which has your
suggestions incorporated.

Thanks again.
--

To: James Bottomley <James.Bottomley@...>
Cc: <konrad@...>, <linux-kernel@...>, <greg@...>, <michaelc@...>, <dwm@...>, <darnok@...>, <pjones@...>, <konradr@...>, <konradr@...>, <randy.dunlap@...>, <hpa@...>, <lenb@...>, <mike.anderson@...>, <dwm@...>, <arjan@...>, <apw@...>
Date: Friday, February 1, 2008 - 8:44 pm

On Fri, 01 Feb 2008 18:18:09 -0600

And note that the reserve_bootmem() interface is about to change.

http://userweb.kernel.org/~akpm/mmotm/broken-out/introduce-flags-for-res...
--

Previous thread: [PATCH 20/23 -v8] trace preempt off critical timings by Steven Rostedt on Wednesday, January 30, 2008 - 5:04 pm. (1 message)

Next thread: [GIT PATCH] intermediate SCSI update for 2.6.24 by James Bottomley on Wednesday, January 30, 2008 - 5:44 pm. (1 message)