nvmet: fix data units read and written counters in SMART log
authorTom Wu <tomwu@mellanox.com>
Thu, 8 Aug 2019 02:22:36 +0000 (02:22 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Oct 2019 11:09:52 +0000 (13:09 +0200)
commit9edc229b9c905fd349035e7790e21f2e425c1a95
treef810083fed50216635faedf94362385a8eeda577
parent7bbb7a9dd2c38e9a35fd73ee29fccf1a580353bd
nvmet: fix data units read and written counters in SMART log

[ Upstream commit 3bec2e3754becebd4c452999adb49bc62c575ea4 ]

In nvme spec 1.3 there is a definition for data write/read counters
from SMART log, (See section 5.14.1.2):
This value is reported in thousands (i.e., a value of 1
corresponds to 1000 units of 512 bytes read) and is rounded up.

However, in nvme target where value is reported with actual units,
but not thousands of units as the spec requires.

Signed-off-by: Tom Wu <tomwu@mellanox.com>
Reviewed-by: Israel Rukshin <israelr@mellanox.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/target/admin-cmd.c