OSD Simulator Module
Exporter Module
This module takes entry from OSD configuration file /etc/osd_export.conf.
Format of entry in /etc/osd_export.conf is given as $osd_target_name $lun_no_per_target $osd_lun_base_directory $capacity_in_Hex $osd_system_id $username
e.g.
iqn.2006-09.com.ac.iitk:riyaz-osd.lvm 0 /tmp/osd/ FFFF iitk_kanpur iitk_user
For each entry it makes corresponding entry in iSCSI configuration file and Creates OSD LUN structure
OSD Request Server
-
Listens for OSD task processing requests from iSCSI-OSD module
-
Initializes OSD system parameters such as utility variables,attribute page structures
-
Parameters for get/set attribute processing
OSD Task Processor
-
Accepts task processing request from iSCSI-OSD module
-
Each request contains
-
Basic SCSI OSD packet
-
AHS for OSD
-
Data IN if any
-
-
Allocates OSD REQUEST and initializes parameters
-
Processes OSD request depending on service action
-
Generates OSD Sense Data in case of error
-
Update metadata information in pages corresponding to the object and its
parent as side effect of processing command -
Processes GET/SET attribute list from OSD command
-
Sends response to OSD-iSCSI module
OSD-iSCSI
Module and Overview of Working of IET
IET (iSCSI
Enterprise target) is extended for support of OSD
devices using
OSD-iSCSI Module.
We are describing in brief about implementation
about IET. This information
is obtained by analyzing the source code. Module
names used are assigned by
us depending on their functionality. We will be
describing modules and information related to
exporting LUN and iSCSI command processing. Note
that, this is not verified by IET developers.
IET consists of User mode and Kernel Mode modules
which communicate using netlink.
User Mode Program :ietd daemon
This is iSCSI Target program management utility.
-
It is used to configure many parameters such as iSCSI target port,uid,gid.
-
Information about this is available on iSCSI-target site.
-
As far as working of ietd is concerned,it takes entry from iSCSI configuration file "/etc/ietd.conf" and submit it to Kernel mode module.
-
Exporter module from OSD simulator makes entry for OSD LUN in iSCSI
configuration file.ietd daemon submits this entry to kernel module.
Kernel Mode Program:(Module File : iscsi_tgt.ko)
There are
various modules of this program. We are describing
only related
modules.
IOTYPE
This
module is responsible for creating iSCSI LUN that
can be exported to
initiator. Device IOTypes can be registered to this
module. User mode program
i.e.ietd daemon communicate to IOTYPE module.
Communication includes passing
various configuration parameters, see /etc/ietd.conf
for details.
For each entry in configuration file ietd daemon
submits information containing target name,lun,
device io-type,path. IOTYPE creates iSCSI LUN for
each entry and initialize its access methods
depending on its io-type.
We are registering new device IOTYPE as osd-io to
this module.All callback functions for osd-io
devices type are implemented.
NTHREAD (Network Thread)
-
listens for iSCSI request from iSCSI Initiator.
-
Accepts iSCSI request
-
Initializes iSCSI command structure and corresponding LUN parameters.
-
Allocates data buffers
-
Handles Processing of r2t data, if any.
This module is extended for support of OSD commands which includes
-
Accepting OSD commands and OSD SCSI AHS data
-
Calculate r2t data size. Unlike other SCSI commands where r2t data field is present in SCSI CDB, in OSD SCSI command it depends on OSD service action
and GET/SET ATTR parameters in OSD request.So it need to be calculated. -
Send request to receive r2t data
WTHREAD (Worker Thread)
-
This does task of processing iSCSI Command. Commands are classified into two classes
LUN io-type specific and LUN io-type independent -
For each command a callback function need to be implemented. This will be
called by WTHREAD module for processing of corresponding command. -
For LUN io-specific commands it invokes corresponding callback function
registered for the LUN device IO-type.
This module is extended for support of OSD commands
which includes calling
callback function for processing OSD command.
Callback function handles
processing of OSD command depending on service
action.
This function does following
-
Communicate with OSD simulator
-
Send OSD task request to OSD Task processor module which contains
OSD SCSI CDB,OSD SCSI AHS, OSD LUN for iSCSI request, Data IN if any -
Receive OSD response, OSD response status, OSD Sense Data in case of error and OSD DATA OUT, if any.
iSCSI RESPONSE Module
-
After processing of iSCSI command, WTHREAD passes processing to this module.
-
Depending on status of command it generates corresponding response.
-
If error while processing, it sends SCSI sense data depending on type of
error. -
r2t data processing if there is any response data.
-
This module is extended for support of OSD commands. In case of error,it
transfers sense data generated by OSD simulator module.