Commit 8e234317 authored by Chaitanya Kulkarni's avatar Chaitanya Kulkarni Committed by Yang Yingliang
Browse files

nvme-pci: use unsigned for io queue depth



mainline inclusion
from mainline-5.9-rc1
commit 61f3b896
category: bugfix
bugzilla: 175286
CVE: NA

---------------------------

The NVMe PCIe declares module parameter io_queue_depth as int. Change
this to u16 as queue depth can never be negative. Now to reflect this
update module parameter getter function from param_get_int() ->
param_get_uint() and respective setter function with type of n changed
from int to u16 with param_set_int() to param_set_ushort(). Finally
update struct nvme_dev q_depth member to u16 and use u16 in min_t()
when calculating dev->q_depth in the nvme_pci_enable() (since q_depth is
now u16) and use unsigned int instead of int when calculating
dev->tagset.queue_depth as target variable tagset->queue_depth is of type
unsigned int in nvme_dev_add().

Signed-off-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>

Conflicts:
	drivers/nvme/host/pci.c
	[ Feature patch 3b6592f7("nvme: utilize two queue maps, one
	  for reads and one for writes") is not applied.
	  ed92ad37("nvme-pci: only set nr_maps to 2 if poll queues
	  are supported") is not applied.
	  aa22c8e6("nvme-pci: set ctrl sqsize to the device q_depth")
	  is not applied. ]

Signed-off-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: default avatarHou Tao <houtao1@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 309f6c1f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment