Re: [PATCH v9 31/32] virtio_net: support rx/tx queue resize

2022-04-17 Thread Xuan Zhuo
On Wed, 13 Apr 2022 16:00:18 +0800, Jason Wang wrote: > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > This patch implements the resize function of the rx, tx queues. > > Based on this function, it is possible to modify the ring num of the > > queue. > > > > There may be an exception during the resize pr

fix and cleanup discard_alignment handling

2022-04-17 Thread Christoph Hellwig
Hi all, the somewhat confusing name of the discard_alignment queue limit, that really is an offset for the discard granularity mislead a lot of driver authors to set it to an incorrect value. This series tries to fix up all these cases. Diffstat: arch/um/drivers/ubd_kern.c |1 - dri

[PATCH 01/11] ubd: don't set the discard_alignment queue limit

2022-04-17 Thread Christoph Hellwig
The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by ubd is mostly harmless but also useless. Signed-off-by: Christoph Hellwig --- arch/um/drivers/ubd_kern.c |

[PATCH 02/11] nbd: don't set the discard_alignment queue limit

2022-04-17 Thread Christoph Hellwig
The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by nbd is mostly harmless but also useless. Signed-off-by: Christoph Hellwig --- drivers/block/nbd.c | 3 ---

[PATCH 03/11] null_blk: don't set the discard_alignment queue limit

2022-04-17 Thread Christoph Hellwig
The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by null_blk is mostly harmless but also useless. Signed-off-by: Christoph Hellwig --- drivers/block/null_blk/m

[PATCH 04/11] virtio_blk: fix the discard_granularity and discard_alignment queue limits

2022-04-17 Thread Christoph Hellwig
The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. On the other hand the discard_sector_alignment from the virtio 1.1 looks similar to what Linux uses as discard granularity (even if not very well described):

[PATCH 05/11] dm-zoned: don't set the discard_alignment queue limit

2022-04-17 Thread Christoph Hellwig
The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by dm-zoned is mostly harmless but also useless. Signed-off-by: Christoph Hellwig --- drivers/md/dm-zoned-targ

[PATCH 06/11] raid5: don't set the discard_alignment queue limit

2022-04-17 Thread Christoph Hellwig
The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by raid5 is mostly harmless but also useless. Signed-off-by: Christoph Hellwig --- drivers/md/raid5.c | 1 - 1

[PATCH 07/11] dasd: don't set the discard_alignment queue limit

2022-04-17 Thread Christoph Hellwig
The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to PAGE_SIZE while the discard granularity is the block size that is smaller or the same as PAGE_SIZE as done by dasd is mostly harmless but also us

[PATCH 08/11] loop: remove a spurious clear of discard_alignment

2022-04-17 Thread Christoph Hellwig
The loop driver never sets a discard_alignment, so it also doens't need to clear it to zero. Signed-off-by: Christoph Hellwig --- drivers/block/loop.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 976cf987b3920..61b642b966a08 100644 --- a/dr

[PATCH 09/11] nvme: remove a spurious clear of discard_alignment

2022-04-17 Thread Christoph Hellwig
The nvme driver never sets a discard_alignment, so it also doens't need to clear it to zero. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index b9b0fbde97c80..76a9ccd5d064a 100

[PATCH 10/11] rnbd-srv: use bdev_discard_alignment

2022-04-17 Thread Christoph Hellwig
Use bdev_discard_alignment to calculate the correct discard alignment offset even for partitions instead of just looking at the queue limit. Signed-off-by: Christoph Hellwig --- drivers/block/rnbd/rnbd-srv-dev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/rn

[PATCH 11/11] xen-blkback: use bdev_discard_alignment

2022-04-17 Thread Christoph Hellwig
Use bdev_discard_alignment to calculate the correct discard alignment offset even for partitions instead of just looking at the queue limit. Also switch to use bdev_discard_granularity to get rid of the last direct queue reference in xen_blkbk_discard. Signed-off-by: Christoph Hellwig --- drive