From 5f0e385fdafb7d6c8ded6464fa6421c735d96caf Mon Sep 17 00:00:00 2001 From: Joe Eykholt Date: Tue, 30 Nov 2010 16:20:18 -0800 Subject: [SCSI] libfc: fix statistics for FCP input/output megabytes The statistics for InputMegabytes and OutputMegabytes are misnamed. They're accumulating bytes, not megabytes. The statistic returned via /sys must be in megabytes, however, which is what the HBA-API wants. The FCP code needs to accumulate it in bytes and then divide by 1,000,000 (not 2^20) before it presented via sysfs. This affects fcoe.ko only, not fnic. The fnic driver correctly by accumulating bytes and then converts to megabytes. I checked that libhbalinux is using the /sys file directly without conversion. BTW, qla2xxx does divide by 2^20, which I'm not fixing here. Signed-off-by: Joe Eykholt Signed-off-by: Robert Love Signed-off-by: James Bottomley --- include/scsi/libfc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/scsi') diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 3eb3915eb557..f53c8e31d5fb 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h @@ -221,8 +221,8 @@ struct fc_rport_priv { * @InputRequests: Number of input requests * @OutputRequests: Number of output requests * @ControlRequests: Number of control requests - * @InputMegabytes: Number of received megabytes - * @OutputMegabytes: Number of transmitted megabytes + * @InputBytes: Number of received bytes + * @OutputBytes: Number of transmitted bytes * @VLinkFailureCount: Number of virtual link failures * @MissDiscAdvCount: Number of missing FIP discovery advertisement */ @@ -241,8 +241,8 @@ struct fcoe_dev_stats { u64 InputRequests; u64 OutputRequests; u64 ControlRequests; - u64 InputMegabytes; - u64 OutputMegabytes; + u64 InputBytes; + u64 OutputBytes; u64 VLinkFailureCount; u64 MissDiscAdvCount; }; -- cgit v1.2.3