Re: [PATCH for-8.0] nbd/server: Request TCP_NODELAY

2023-03-27 Thread Eric Blake
On Tue, Mar 28, 2023 at 12:42:59AM +0200, Florian Westphal wrote: > Eric Blake wrote: > > Nagle's algorithm adds latency in order to reduce network packet > > overhead on small packets. But when we are already using corking to > > merge smaller packets into transactional requests, the extra

Re: [PATCH for-8.0] nbd/server: Request TCP_NODELAY

2023-03-27 Thread Florian Westphal
Eric Blake wrote: > Nagle's algorithm adds latency in order to reduce network packet > overhead on small packets. But when we are already using corking to > merge smaller packets into transactional requests, the extra delay > from TCP defaults just gets in the way. > > For reference, qemu as an

[PATCH for-8.0] block/export: fix assume_graph_lock() assertion failure

2023-03-27 Thread Stefan Hajnoczi
When I/O request parameters are validated for virtio-blk exports like vhost-user-blk and vduse-blk, we call blk_get_geometry() from a coroutine. This hits an assume_graph_lock() assertion failure. Use blk_co_nb_sectors() instead and mark virtio_blk_sect_range_ok() with coroutine_fn. This

Re: [PATCH-for-8.0] block/dmg: Ignore C99 prototype declaration mismatch from

2023-03-27 Thread Paolo Bonzini
Il lun 27 mar 2023, 20:58 Philippe Mathieu-Daudé ha scritto: > > The warning can also be suppressed if the build uses `-isystem > > /opt/homebrew/include` instead of `-I/opt/homebrew/include` as I just > > have tested. > Is that option added by QEMU's configure or meson.build? Or is it added by

[PATCH for-8.0] nbd/server: Request TCP_NODELAY

2023-03-27 Thread Eric Blake
Nagle's algorithm adds latency in order to reduce network packet overhead on small packets. But when we are already using corking to merge smaller packets into transactional requests, the extra delay from TCP defaults just gets in the way. For reference, qemu as an NBD client already requests

Re: [PATCH-for-8.0] block/dmg: Ignore C99 prototype declaration mismatch from

2023-03-27 Thread Philippe Mathieu-Daudé
+Marc-André & Paolo On 27/3/23 19:08, Stefan Weil wrote: Am 27.03.23 um 17:13 schrieb Philippe Mathieu-Daudé: When liblzfe (Apple LZFSE compression library) is present (for example installed via 'brew') on Darwin, QEMU build fails as:    Has header "lzfse.h" : YES    Library lzfse found: YES

[PULL 0/2] hw/nvme fixes

2023-03-27 Thread Klaus Jensen
From: Klaus Jensen Hi Peter, The following changes since commit e3debd5e7d0ce031356024878a0a18b9d109354a: Merge tag 'pull-request-2023-03-24' of https://gitlab.com/thuth/qemu into staging (2023-03-24 16:08:46 +) are available in the Git repository at:

[PULL 2/2] hw/nvme: fix missing DNR on compare failure

2023-03-27 Thread Klaus Jensen
From: Klaus Jensen Even if the host is somehow using compare to do compare-and-write, the host should be notified immediately about the compare failure and not have to wait for the driver to potentially retry the command. Fixes: 0a384f923f51 ("hw/block/nvme: add compare command") Reported-by:

[PULL 1/2] hw/nvme: Change alignment in dma functions for nvme_blk_*

2023-03-27 Thread Klaus Jensen
From: Mateusz Kozlowski Since the nvme_blk_read/write are used by both the data and metadata portions of the IO, it can't have the 512B alignment requirement. Without this change any metadata transfer, which length isn't a multiple of 512B and which is bigger than 512B, will result in only a

Re: [PATCH-for-8.0] block/dmg: Ignore C99 prototype declaration mismatch from

2023-03-27 Thread Stefan Weil via
Am 27.03.23 um 17:13 schrieb Philippe Mathieu-Daudé: When liblzfe (Apple LZFSE compression library) is present (for example installed via 'brew') on Darwin, QEMU build fails as: Has header "lzfse.h" : YES Library lzfse found: YES Dependencies lzo support :

[PATCH-for-8.0] block/dmg: Ignore C99 prototype declaration mismatch from

2023-03-27 Thread Philippe Mathieu-Daudé
When liblzfe (Apple LZFSE compression library) is present (for example installed via 'brew') on Darwin, QEMU build fails as: Has header "lzfse.h" : YES Library lzfse found: YES Dependencies lzo support : NO snappy support : NO bzip2

[PATCH v9 3/5] block: add accounting for zone append operation

2023-03-27 Thread Sam Li
Taking account of the new zone append write operation for zoned devices, BLOCK_ACCT_ZONE_APPEND enum is introduced as other I/O request type (read, write, flush). Signed-off-by: Sam Li --- block/qapi-sysemu.c| 11 ++ block/qapi.c | 18 ++ hw/block/virtio-blk.c

[PATCH v9 5/5] docs/zoned-storage:add zoned emulation use case

2023-03-27 Thread Sam Li
Add the documentation about the example of using virtio-blk driver to pass the zoned block devices through to the guest. Signed-off-by: Sam Li --- docs/devel/zoned-storage.rst | 17 + 1 file changed, 17 insertions(+) diff --git a/docs/devel/zoned-storage.rst

[PATCH v9 2/5] virtio-blk: add zoned storage emulation for zoned devices

2023-03-27 Thread Sam Li
This patch extends virtio-blk emulation to handle zoned device commands by calling the new block layer APIs to perform zoned device I/O on behalf of the guest. It supports Report Zone, four zone oparations (open, close, finish, reset), and Append Zone. The VIRTIO_BLK_F_ZONED feature bit will only

[PATCH v9 4/5] virtio-blk: add some trace events for zoned emulation

2023-03-27 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- hw/block/trace-events | 7 +++ hw/block/virtio-blk.c | 12 2 files changed, 19 insertions(+) diff --git a/hw/block/trace-events b/hw/block/trace-events index 2c45a62bd5..34be8b9135 100644 --- a/hw/block/trace-events +++

[PATCH v9 1/5] include: update virtio_blk headers to v6.3-rc1

2023-03-27 Thread Sam Li
Use scripts/update-linux-headers.sh to update headers to 6.3-rc1. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev --- include/standard-headers/drm/drm_fourcc.h| 12 +++ include/standard-headers/linux/ethtool.h | 48 -

[PATCH v9 0/5] Add zoned storage emulation to virtio-blk driver

2023-03-27 Thread Sam Li
This patch adds zoned storage emulation to the virtio-blk driver. It implements the virtio-blk ZBD support standardization that is recently accepted by virtio-spec. The link to related commit is at https://github.com/oasis-tcs/virtio-spec/commit/b4e8efa0fa6c8d844328090ad15db65af8d7d981 The Linux

Re: [PATCH for-8.0] block/export: Fix graph locking in blk_get_geometry() call

2023-03-27 Thread Kevin Wolf
Am 27.03.2023 um 13:39 hat Kevin Wolf geschrieben: > blk_get_geometry() eventually calls bdrv_nb_sectors(), which is a > co_wrapper_mixed_bdrv_rdlock. This means that when it is called from > coroutine context, it already assume to have the graph locked. > > However, virtio_blk_sect_range_ok() in

Re: [PATCH for-8.0 v2] aio-posix: fix race between epoll upgrade and aio_set_fd_handler()

2023-03-27 Thread Kevin Wolf
Am 23.03.2023 um 15:48 hat Stefan Hajnoczi geschrieben: > If another thread calls aio_set_fd_handler() while the IOThread event > loop is upgrading from ppoll(2) to epoll(7) then we might miss new > AioHandlers. The epollfd will not monitor the new AioHandler's fd, > resulting in hangs. > > Take

Re: [PATCH for-8.0] block/export: Fix graph locking in blk_get_geometry() call

2023-03-27 Thread Emanuele Giuseppe Esposito
Am 27/03/2023 um 13:39 schrieb Kevin Wolf: > blk_get_geometry() eventually calls bdrv_nb_sectors(), which is a > co_wrapper_mixed_bdrv_rdlock. This means that when it is called from > coroutine context, it already assume to have the graph locked. > > However, virtio_blk_sect_range_ok() in

Re: [PATCH] block/export: only acquire AioContext once for vhost_user_server_stop()

2023-03-27 Thread Kevin Wolf
Am 23.03.2023 um 15:58 hat Stefan Hajnoczi geschrieben: > vhost_user_server_stop() uses AIO_WAIT_WHILE(). AIO_WAIT_WHILE() > requires that AioContext is only acquired once. > > Since blk_exp_request_shutdown() already acquires the AioContext it > shouldn't be acquired again in

Re: [PATCH 1/1] nbd/server: push pending frames after sending reply

2023-03-27 Thread Kevin Wolf
Am 24.03.2023 um 11:47 hat Florian Westphal geschrieben: > qemu-nbd doesn't set TCP_NODELAY on the tcp socket. > > Kernel waits for more data and avoids transmission of small packets. > Without TLS this is barely noticeable, but with TLS this really shows. > > Booting a VM via qemu-nbd on

[PATCH for-8.0] block/export: Fix graph locking in blk_get_geometry() call

2023-03-27 Thread Kevin Wolf
blk_get_geometry() eventually calls bdrv_nb_sectors(), which is a co_wrapper_mixed_bdrv_rdlock. This means that when it is called from coroutine context, it already assume to have the graph locked. However, virtio_blk_sect_range_ok() in block/export/virtio-blk-handler.c (used by vhost-user-blk