On Mon, Apr 8, 2019 at 11:38 AM zhenwei pi <pizhenwei@xxxxxxxxxxxxx> wrote: > > Rotation rate is sensitive to some applications, typically database need to > recognize sdx device is HDD or SSD. > > This patch implements basic vpd 0xb1, and supports parameter 'rotation_rate', > we can update rotation_rate by tgtadm command. > > Test case 1: > T# tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 1 --params rotation_rate=1 > I# cat /sys/block/sdb/queue/rotational > 0 > I# sg_vpd -p 0xb1 /dev/sdb > Block device characteristics VPD page (SBC): > Non-rotating medium (e.g. solid state) > > Test case 2: > T# tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 1 --params rotation_rate=15000 > I# cat /sys/block/sdb/queue/rotational > 1 > I# sg_vpd -p 0xb1 /dev/sdb > Block device characteristics VPD page (SBC): > Nominal rotation rate: 15000 rpm > > All of testing case work well. > > Signed-off-by: zhenwei pi <pizhenwei@xxxxxxxxxxxxx> > --- > usr/spc.c | 36 ++++++++++++++++++++++++++++++++++++ > usr/tgtd.h | 2 ++ > 2 files changed, 38 insertions(+) Applied, thanks.