On Friday, November 8, 2019 at 10:40:08 AM UTC-8, Bobby wrote: > > > Hi Ulrich, > > Thanks for the hint. Can you please help me regarding following two > questions. > > - Linux block layer perform IO scheduling IO submissions to storage device > driver. If there is a physical device, the block layer interacts with it > through SCSI mid layer and SCSI low level drivers. So, how *actually* a > software initiator (*Open-iSCSI*) interacts with "*block layer*"? > > - What confuses me, where does the "*disk driver*" comes into play? > > Thanks :-) > > In an iSCSI connection (session), there is the initiator and the target. I assume you are talking about the initiator.
On the initiator, the "magic" is done by the kernel, in particular the iSCSI initiator code in the kernel, specifically by the scsi_transport_iscsi.c in drivers/scsi. When an iSCSI connection is made, the code creates a new "host" object, and then tests the device at the other end of the connection. If it's a disc drive, then an instance of sd is created (the disc driver). If the device is tape, a tape driver is instantiated (st). Unrecognized devices still get a generic SCSI device node, I believe. So, in this way, iSCSI is acting like an adapter driver, which plugs into the SCSI mid-layer. You can run "sudo journalctl -xe --follow" in one window, then log into an existing target in another (I used "sudo iscsiadm -m node -l"), and you should see this kind of output from journalctl: ... > Nov 09 10:46:59 linux-dell kernel: iscsi: registered transport (tcp) > Nov 09 10:46:59 linux-dell kernel: scsi host3: iSCSI Initiator over TCP/IP > Nov 09 10:46:59 linux-dell iscsid[13175]: iscsid: Connection1:0 to > [target: iqn.2003-01.org.linux-iscsi.linux-dell.x8664:sn.2a6e21b1b53c, > portal: 192.168.20.3,3260] through [iface: default] is operational now > Nov 09 10:46:59 linux-dell kernel: scsi 3:0:0:0: Direct-Access > LIO-ORG test-disc 4.0 PQ: 0 ANSI: 5 > Nov 09 10:46:59 linux-dell kernel: scsi 3:0:0:0: alua: supports implicit > and explicit TPGS > Nov 09 10:46:59 linux-dell kernel: scsi 3:0:0:0: alua: device > naa.6001405de01c6e7933b414e901e22b0f port group 0 rel port 1 > Nov 09 10:46:59 linux-dell kernel: sd 3:0:0:0: Attached scsi generic sg1 > type 0 > Nov 09 10:46:59 linux-dell kernel: sd 3:0:0:0: [sdb] 2097152 512-byte > logical blocks: (1.07 GB/1.00 GiB) > Nov 09 10:46:59 linux-dell kernel: sd 3:0:0:0: [sdb] Write Protect is off > Nov 09 10:46:59 linux-dell kernel: sd 3:0:0:0: [sdb] Mode Sense: 43 00 10 > 08 > Nov 09 10:46:59 linux-dell kernel: sd 3:0:0:0: [sdb] Write cache: enabled, > read cache: enabled, supports DPO and FUA > Nov 09 10:46:59 linux-dell kernel: > iSCSI/iqn.1996-04.de.suse:01:54cab487975b: Unsupported SCSI Opcode 0xa3, > sending CHECK_CONDITION. > Nov 09 10:46:59 linux-dell kernel: sd 3:0:0:0: [sdb] Optimal transfer size > 8388608 bytes > Nov 09 10:46:59 linux-dell kernel: sd 3:0:0:0: [sdb] Attached SCSI disk > Nov 09 10:46:59 linux-dell kernel: sd 3:0:0:0: alua: transition timeout > set to 60 seconds > Nov 09 10:46:59 linux-dell kernel: sd 3:0:0:0: alua: port group 00 state A > non-preferred supports TOlUSNA > ... -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/open-iscsi/ac95713b-ca5e-47f5-ad64-96ff6c43196a%40googlegroups.com.