Re: [PATCH] libfc: fix stats computation in fc_queuecommand()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 26, 2010 at 9:01 AM, Hillf Danton <dhillf@xxxxxxxxx> wrote:
> There seems accumulation needed.

I'm looking at the code but why increment in queue-command. What if
the cmd-fails then
we would need to decrement the counters. If not done already then
fc_io_cmpl would be
a nice place to handle the counters.

Chetan Loke


> ---
>
> --- a/drivers/scsi/libfc/fc_fcp.c    2010-09-13 07:07:38.000000000 +0800
> +++ b/drivers/scsi/libfc/fc_fcp.c    2010-10-26 20:52:46.000000000 +0800
> @@ -1821,11 +1821,11 @@ int fc_queuecommand(struct scsi_cmnd *sc
> Â Â Â Âif (sc_cmd->sc_data_direction == DMA_FROM_DEVICE) {
> Â Â Â Â Â Â Â Âfsp->req_flags = FC_SRB_READ;
> Â Â Â Â Â Â Â Âstats->InputRequests++;
> - Â Â Â Â Â Â Â stats->InputMegabytes = fsp->data_len;
> + Â Â Â Â Â Â Â stats->InputMegabytes += fsp->data_len;
> Â Â Â Â} else if (sc_cmd->sc_data_direction == DMA_TO_DEVICE) {
> Â Â Â Â Â Â Â Âfsp->req_flags = FC_SRB_WRITE;
> Â Â Â Â Â Â Â Âstats->OutputRequests++;
> - Â Â Â Â Â Â Â stats->OutputMegabytes = fsp->data_len;
> + Â Â Â Â Â Â Â stats->OutputMegabytes += fsp->data_len;
> Â Â Â Â} else {
> Â Â Â Â Â Â Â Âfsp->req_flags = 0;
> Â Â Â Â Â Â Â Âstats->ControlRequests++;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at Âhttp://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux