Sorry for the delay, On Wed, 20 Jun 2012 19:01:42 +0300 Alexander Nezhinsky <alexandern@xxxxxxxxxxxx> wrote: > To introduce statistics on SCSI device level we need to accumulate them > for each ITL (initiator-target-lun) nexus. > > For example in case of iscsi, this is a granularity which is finer than > a session (IT nexus), as it represents access to a specific lun within > the session. > > Statistics counters are added to the ITL object, "struct it_nexus_lu_info". > They need to be shown later in various scopes (connection, device, target etc.) > requiring two-way access, both from a device (lun to all its ITLs) and > from an IT nexus (IT nexus to all its ITLs). > > Thus a linked list's head called "it_nexus_lu_info_list" is added to both > struct scsi_lu and struct it_nexus, while struct it_nexus_lu_info Please use different names for each. > becomes a memeber in these two lists, thru the entries called: > itn_siblings and lu_siblings. > > Signed-off-by: Alexander Nezhinsky <alexandern@xxxxxxxxxxxx> > --- > usr/scsi.c | 16 +++++++++++++- > usr/target.c | 67 +++++++++++++++++++++++++++++++++++++++------------------ > usr/tgtd.h | 27 ++++++++++++++++++++++- > 3 files changed, 87 insertions(+), 23 deletions(-) > > diff --git a/usr/scsi.c b/usr/scsi.c > index 5ec3b4d..861d213 100644 > --- a/usr/scsi.c > +++ b/usr/scsi.c > @@ -201,6 +201,20 @@ int scsi_cmd_perform(int host_no, struct scsi_cmd *cmd) > unsigned char op = cmd->scb[0]; > struct it_nexus_lu_info *itn_lu; > > + if (scsi_get_data_dir(cmd) == DATA_WRITE) { > + cmd->itn_lu_info->stat.wr_subm_sect += scsi_get_out_length(cmd) / 512; I'm not still not sure about this. How about the case that the sector size is not the multiple of 512? How about just using bytes? -- To unsubscribe from this list: send the line "unsubscribe stgt" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html