Re: [PATCH 1/3] sched/headers: Fix compilation error with GCC 12

2022-04-14 Thread Peter Zijlstra
On Thu, Apr 14, 2022 at 05:08:53PM +0200, Christophe de Dinechin wrote: > With gcc version 12.0.1 20220401 (Red Hat 12.0.1-0) (GCC), the following > errors are reported in sched.h when building after `make defconfig`: > Rewrite the definitions of sched_class_highest and for_class_range to >

[PATCH 4.19 297/338] virtio_console: eliminate anonymous module_init & module_exit

2022-04-14 Thread Greg Kroah-Hartman
From: Randy Dunlap [ Upstream commit fefb8a2a941338d871e2d83fbd65fbfa068857bd ] Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique

[PATCH 5.4 417/475] virtio_console: eliminate anonymous module_init & module_exit

2022-04-14 Thread Greg Kroah-Hartman
From: Randy Dunlap [ Upstream commit fefb8a2a941338d871e2d83fbd65fbfa068857bd ] Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique

Re: [PATCH 2/3] nodemask.h: Fix compilation error with GCC12

2022-04-14 Thread Peter Zijlstra
On Thu, Apr 14, 2022 at 05:08:54PM +0200, Christophe de Dinechin wrote: > diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h > index 567c3ddba2c4..c6199dbe2591 100644 > --- a/include/linux/nodemask.h > +++ b/include/linux/nodemask.h > @@ -375,14 +375,13 @@ static inline void

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

2022-04-14 Thread Jason Wang
On Wed, Apr 13, 2022 at 4:47 PM Xuan Zhuo wrote: > > 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 >

Re: [PATCH v9 01/32] virtio: add helper virtqueue_get_vring_max_size()

2022-04-14 Thread Jason Wang
On Wed, Apr 13, 2022 at 10:30 AM Xuan Zhuo wrote: > > On Tue, 12 Apr 2022 10:41:03 +0800, Jason Wang wrote: > > > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > > Record the maximum queue num supported by the device. > > > > > > virtio-net can display the maximum (supported by hardware) ring size in >

Re: [PATCH v9 22/32] virtio_pci: queue_reset: extract the logic of active vq for modern pci

2022-04-14 Thread Jason Wang
On Thu, Apr 14, 2022 at 2:25 PM Xuan Zhuo wrote: > > On Tue, 12 Apr 2022 14:58:19 +0800, Jason Wang wrote: > > > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > > Introduce vp_active_vq() to configure vring to backend after vq attach > > > vring. And configure vq vector if necessary. > > > > > >

Re: [PATCH v9 12/32] virtio_ring: packed: extract the logic of alloc queue

2022-04-14 Thread Jason Wang
On Wed, Apr 13, 2022 at 11:26 AM Xuan Zhuo wrote: > > On Tue, 12 Apr 2022 14:28:24 +0800, Jason Wang wrote: > > > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > > Separate the logic of packed to create vring queue. > > > > > > For the convenience of passing parameters, add a structure > > >

Re: [PATCH v9 23/32] virtio_pci: queue_reset: support VIRTIO_F_RING_RESET

2022-04-14 Thread Jason Wang
On Wed, Apr 13, 2022 at 11:23 AM Xuan Zhuo wrote: > > On Tue, 12 Apr 2022 15:07:58 +0800, Jason Wang wrote: > > > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > > This patch implements virtio pci support for QUEUE RESET. > > > > > > Performing reset on a queue is divided into these steps: > > > > > >

[PATCH] VMCI: Add support for ARM64

2022-04-14 Thread vdasa
From: Vishnu Dasa Add support for ARM64 architecture so that the driver can now be built and VMCI device can be used. Update Kconfig file to allow the driver to be built on ARM64 as well. Fail vmci_guest_probe_device() on ARM64 if the device does not support MMIO register access. Lastly, add

Re: [PATCH 1/3] sched/headers: Fix compilation error with GCC 12

2022-04-14 Thread Andrew Morton
On Thu, 14 Apr 2022 17:21:01 +0200 Peter Zijlstra wrote: > > +/* The + 1 below places the pointers within the range of their array */ > > #define for_class_range(class, _from, _to) \ > > - for (class = (_from); class != (_to); class--) > > + for (class = (_from); class + 1 != (_to) + 1;

Re: [PATCH 2/3] virtio_net: Add control VQ struct to carry vlan id

2022-04-14 Thread Jason Wang
在 2022/4/11 20:29, Eli Cohen 写道: Add structure to define the payload of control VQ messages carrying the configured vlan ID. It will be used in subsequent patches of this series. Signed-off-by: Eli Cohen --- include/uapi/linux/virtio_net.h | 3 +++ 1 file changed, 3 insertions(+) diff

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

2022-04-14 Thread Xuan Zhuo
On Thu, 14 Apr 2022 17:30:02 +0800, Jason Wang wrote: > On Wed, Apr 13, 2022 at 4:47 PM Xuan Zhuo wrote: > > > > 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. > > > >

RE: [RFC PATCH 1/6] hv_sock: Check hv_pkt_iter_first_raw()'s return value

2022-04-14 Thread Michael Kelley (LINUX) via Virtualization
From: Andrea Parri (Microsoft) Sent: Wednesday, April 13, 2022 1:48 PM > > The function returns NULL if the ring buffer has no enough space > available for a packet descriptor. The ring buffer's write_index The first sentence wording is a bit scrambled. I think you mean the ring buffer

RE: [RFC PATCH 2/6] hv_sock: Copy packets sent by Hyper-V out of the ring buffer

2022-04-14 Thread Michael Kelley (LINUX) via Virtualization
From: Andrea Parri (Microsoft) Sent: Wednesday, April 13, 2022 1:48 PM > > Pointers to VMbus packets sent by Hyper-V are used by the hv_sock driver > within the gues VM. Hyper-V can send packets with erroneous values or s/gues/guest/ > modify packet fields after they are processed by the

RE: [RFC PATCH 5/6] Drivers: hv: vmbus: Accept hv_sock offers in isolated guests

2022-04-14 Thread Michael Kelley (LINUX) via Virtualization
From: Andrea Parri (Microsoft) Sent: Wednesday, April 13, 2022 1:48 PM > > So that isolated guests can communicate with the host via hv_sock > channels. > > Signed-off-by: Andrea Parri (Microsoft) > --- > drivers/hv/channel_mgmt.c | 9 +++-- > include/linux/hyperv.h| 8 ++-- > 2

RE: [RFC PATCH 4/6] hv_sock: Initialize send_buf in hvs_stream_enqueue()

2022-04-14 Thread Michael Kelley (LINUX) via Virtualization
From: Andrea Parri (Microsoft) Sent: Wednesday, April 13, 2022 1:48 PM > > So that padding or uninitialized bytes can't leak guest memory contents. > > Signed-off-by: Andrea Parri (Microsoft) > --- > net/vmw_vsock/hyperv_transport.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >

RE: [RFC PATCH 6/6] Drivers: hv: vmbus: Refactor the ring-buffer iterator functions

2022-04-14 Thread Michael Kelley (LINUX) via Virtualization
From: Andrea Parri (Microsoft) Sent: Wednesday, April 13, 2022 1:48 PM > > With no users of hv_pkt_iter_next_raw() and no "external" users of > hv_pkt_iter_first_raw(), the iterator functions can be refactored > and simplified to remove some indirection/code. > > Signed-off-by: Andrea Parri

Re: [PATCH 3/3] vdpa/mlx5: Add RX MAC VLAN filter support

2022-04-14 Thread Jason Wang
在 2022/4/11 20:29, Eli Cohen 写道: Support HW offloaded filtering of MAC/VLAN packets. To allow that, we add a handler to handle VLAN configurations coming through the control VQ. Two operations are supported. 1. Adding VLAN - in this case, an entry will be added to the RX flow table that

[PATCH 26/27] block: decouple REQ_OP_SECURE_ERASE from REQ_OP_DISCARD

2022-04-14 Thread Christoph Hellwig
Secure erase is a very different operation from discard in that it is a data integrity operation vs hint. Fully split the limits and helper infrastructure to make the separation more clear. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Christoph Böhmwalder [drbd]

[PATCH 24/27] block: remove QUEUE_FLAG_DISCARD

2022-04-14 Thread Christoph Hellwig
Just use a non-zero max_discard_sectors as an indicator for discard support, similar to what is done for write zeroes. The only places where needs special attention is the RAID5 driver, which must clear discard support for security reasons by default, even if the default stacking rules would

[PATCH 27/27] direct-io: remove random prefetches

2022-04-14 Thread Christoph Hellwig
Randomly poking into block device internals for manual prefetches isn't exactly a very maintainable thing to do. And none of the performance criticil direct I/O implementations still use this library function anyway, so just drop it. Signed-off-by: Christoph Hellwig --- fs/direct-io.c | 32

[PATCH 25/27] block: add a bdev_discard_granularity helper

2022-04-14 Thread Christoph Hellwig
Abstract away implementation details from file systems by providing a block_device based helper to retrieve the discard granularity. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Christoph Böhmwalder [drbd] Acked-by: Ryusuke Konishi Acked-by: David Sterba [btrfs]

[PATCH 23/27] block: add a bdev_max_discard_sectors helper

2022-04-14 Thread Christoph Hellwig
Add a helper to query the number of sectors support per each discard bio based on the block device and use this helper to stop various places from poking into the request_queue to see if discard is supported and if so how much. This mirrors what is done e.g. for write zeroes as well.

[PATCH 19/27] block: remove queue_discard_alignment

2022-04-14 Thread Christoph Hellwig
Just use bdev_alignment_offset in disk_discard_alignment_show instead. That helpers is the same except for an always false branch that doesn't matter in this slow path. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/genhd.c | 2 +- include/linux/blkdev.h |

[PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line

2022-04-14 Thread Christoph Hellwig
No need to inline these fairly larger helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/blk-settings.c | 23 +++ include/linux/blkdev.h | 21 + 2 files changed, 24 insertions(+), 20 deletions(-) diff --git

[PATCH 21/27] block: move {bdev, queue_limit}_discard_alignment out of line

2022-04-14 Thread Christoph Hellwig
No need to inline these fairly larger helpers. Also fix the return value to be unsigned, just like the field in struct queue_limits. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/blk-settings.c | 35 +++ include/linux/blkdev.h |

[PATCH 20/27] block: use bdev_discard_alignment in part_discard_alignment_show

2022-04-14 Thread Christoph Hellwig
Use the bdev based alignment helper instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/partitions/core.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/block/partitions/core.c b/block/partitions/core.c index

[PATCH 22/27] block: refactor discard bio size limiting

2022-04-14 Thread Christoph Hellwig
Move all the logic to limit the discard bio size into a common helper so that it is better documented. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Coly Li --- block/blk-lib.c | 59 - block/blk.h | 14

Re: [PATCH] vDPA/ifcvf: assign nr_vring to the MSI vector of config_intr by default

2022-04-14 Thread Jason Wang
On Wed, Apr 13, 2022 at 5:16 PM Zhu, Lingshan wrote: > > > > On 4/13/2022 4:14 PM, Jason Wang wrote: > > > > 在 2022/4/8 下午8:10, Zhu Lingshan 写道: > >> This commit assign struct ifcvf_hw.nr_vring to the MSIX vector of the > >> config interrupt by default in ifcvf_request_config_irq(). > >>

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

2022-04-14 Thread Jason Wang
On Fri, Apr 15, 2022 at 10:23 AM Xuan Zhuo wrote: > > On Thu, 14 Apr 2022 17:30:02 +0800, Jason Wang wrote: > > On Wed, Apr 13, 2022 at 4:47 PM Xuan Zhuo > > wrote: > > > > > > On Wed, 13 Apr 2022 16:00:18 +0800, Jason Wang > > > wrote: > > > > > > > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > >

[PATCH 13/27] block: add a bdev_fua helper

2022-04-14 Thread Christoph Hellwig
Add a helper to check the FUA flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- drivers/block/rnbd/rnbd-srv.c | 3 +-- drivers/target/target_core_iblock.c | 3 +--

[PATCH 10/27] mm: use bdev_is_zoned in claim_swapfile

2022-04-14 Thread Christoph Hellwig
Use the bdev based helper instead of poking into the queue. Signed-off-by: Christoph Hellwig --- mm/swapfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/swapfile.c b/mm/swapfile.c index 63c61f8b26118..4c7537162af5e 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@

[PATCH 11/27] block: add a bdev_nonrot helper

2022-04-14 Thread Christoph Hellwig
Add a helper to check the nonrot flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: David Sterba [btrfs] --- block/ioctl.c | 2 +-

[PATCH 12/27] block: add a bdev_write_cache helper

2022-04-14 Thread Christoph Hellwig
Add a helper to check the write cache flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: David Sterba [btrfs] --- drivers/block/rnbd/rnbd-srv.c | 2 +-

[PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue

2022-04-14 Thread Christoph Hellwig
The SCSI target drivers is a consumer of the block layer and shoul d generally work on struct block_device. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- drivers/target/target_core_device.c | 5 +++-- drivers/target/target_core_file.c| 7 ---

[PATCH 03/27] target: fix discard alignment on partitions

2022-04-14 Thread Christoph Hellwig
Use the proper bdev_discard_alignment helper that accounts for partition offsets. Fixes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6") Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- drivers/target/target_core_device.c | 4 ++-- 1 file changed, 2

[PATCH 05/27] drbd: use bdev based limit helpers in drbd_send_sizes

2022-04-14 Thread Christoph Hellwig
Use the bdev based limits helpers where they exist. Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder --- drivers/block/drbd/drbd_main.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/block/drbd/drbd_main.c

[PATCH 04/27] drbd: remove assign_p_sizes_qlim

2022-04-14 Thread Christoph Hellwig
Fold each branch into its only caller. Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder --- drivers/block/drbd/drbd_main.c | 47 +++--- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/drivers/block/drbd/drbd_main.c

use block_device based APIs in block layer consumers v3

2022-04-14 Thread Christoph Hellwig
Hi Jens, this series cleanups up the block layer API so that APIs consumed by file systems are (almost) only struct block_devic based, so that file systems don't have to poke into block layer internals like the request_queue. I also found a bunch of existing bugs related to partition offsets and

[PATCH 01/27] target: remove an incorrect unmap zeroes data deduction

2022-04-14 Thread Christoph Hellwig
For block devices, the SCSI target drivers implements UNMAP as calls to blkdev_issue_discard, which does not guarantee zeroing just because Write Zeroes is supported. Note that this does not affect the file backed path which uses fallocate to punch holes. Fixes: 2237498f0b5c ("target/iblock:

[PATCH 14/27] block: add a bdev_stable_writes helper

2022-04-14 Thread Christoph Hellwig
Add a helper to check the stable writes flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- drivers/md/dm-table.c | 4 +--- fs/super.c | 2 +-

[PATCH 16/27] block: use bdev_alignment_offset in part_alignment_offset_show

2022-04-14 Thread Christoph Hellwig
Replace the open coded offset calculation with the proper helper. This is an ABI change in that the -1 for a misaligned partition is properly propagated, which can be considered a bug fix and matches what is done on the whole device. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K.

[PATCH 15/27] block: add a bdev_max_zone_append_sectors helper

2022-04-14 Thread Christoph Hellwig
Add a helper to check the max supported sectors for zone append based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig Acked-by: Damien Le Moal Reviewed-by: Martin K. Petersen Reviewed-by: Johannes Thumshirn ---

[PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show

2022-04-14 Thread Christoph Hellwig
This does the same as the open coded variant except for an extra branch, and allows to remove queue_alignment_offset entirely. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/genhd.c | 2 +- include/linux/blkdev.h | 8 2 files changed, 1

[PATCH 09/27] ntfs3: use bdev_logical_block_size instead of open coding it

2022-04-14 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- fs/ntfs3/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index 278dcf5024102..cd30e81abbce0 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -920,7 +920,7

[PATCH 06/27] drbd: use bdev_alignment_offset instead of queue_alignment_offset

2022-04-14 Thread Christoph Hellwig
The bdev version does the right thing for partitions, so use that. Fixes: 9104d31a759f ("drbd: introduce WRITE_SAME support") Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder --- drivers/block/drbd/drbd_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 07/27] drbd: cleanup decide_on_discard_support

2022-04-14 Thread Christoph Hellwig
Sanitize the calling conventions and use a goto label to cleanup the code flow. Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder --- drivers/block/drbd/drbd_nl.c | 68 +++- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git

[PATCH 08/27] btrfs: use bdev_max_active_zones instead of open coding it

2022-04-14 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Acked-by: David Sterba --- fs/btrfs/zoned.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index 1b1b310c3c510..f72cad7391a11 100644 --- a/fs/btrfs/zoned.c +++

Re: [PATCH v9 22/32] virtio_pci: queue_reset: extract the logic of active vq for modern pci

2022-04-14 Thread Xuan Zhuo
On Tue, 12 Apr 2022 14:58:19 +0800, Jason Wang wrote: > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > Introduce vp_active_vq() to configure vring to backend after vq attach > > vring. And configure vq vector if necessary. > > > > Signed-off-by: Xuan Zhuo > > --- > >