Re: [PATCH vhost v10 03/10] virtio_ring: split: support add premapped buf

2023-06-27 Thread Jason Wang
On Wed, Jun 28, 2023 at 2:02 PM Xuan Zhuo wrote: > > On Wed, 28 Jun 2023 12:07:10 +0800, Jason Wang wrote: > > On Tue, Jun 27, 2023 at 5:05 PM Xuan Zhuo > > wrote: > > > > > > On Tue, 27 Jun 2023 16:03:26 +0800, Jason Wang > > > wrote: > > > > On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo > > >

Re: [PATCH vhost v10 03/10] virtio_ring: split: support add premapped buf

2023-06-27 Thread Xuan Zhuo
On Wed, 28 Jun 2023 12:07:10 +0800, Jason Wang wrote: > On Tue, Jun 27, 2023 at 5:05 PM Xuan Zhuo wrote: > > > > On Tue, 27 Jun 2023 16:03:26 +0800, Jason Wang wrote: > > > On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo > > > wrote: > > > > > > > > If the vq is the premapped mode, use the sg_dma_add

Re: [PATCH vhost v10 03/10] virtio_ring: split: support add premapped buf

2023-06-27 Thread Jason Wang
On Tue, Jun 27, 2023 at 5:05 PM Xuan Zhuo wrote: > > On Tue, 27 Jun 2023 16:03:26 +0800, Jason Wang wrote: > > On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo wrote: > > > > > > If the vq is the premapped mode, use the sg_dma_address() directly. > > > > > > Signed-off-by: Xuan Zhuo > > > --- > > > dr

Re: [PATCH v1 2/2] vduse: enable Virtio-net device type

2023-06-27 Thread Jason Wang
On Tue, Jun 27, 2023 at 7:37 PM Maxime Coquelin wrote: > > This patch adds Virtio-net device type to the supported > devices types. Initialization fails if the device does > not support VIRTIO_F_VERSION_1 feature, in order to > guarantee the configuration space is read-only. > > Signed-off-by: Max

Re: [PATCH v1 1/2] vduse: validate block features only with block devices

2023-06-27 Thread Jason Wang
On Tue, Jun 27, 2023 at 7:37 PM Maxime Coquelin wrote: > > This patch is preliminary work to enable network device > type support to VDUSE. > > As VIRTIO_BLK_F_CONFIG_WCE shares the same value as > VIRTIO_NET_F_HOST_TSO4, we need to restrict its check > to Virtio-blk device type. > > Signed-off-by

Re: [PATCH v1 3/5] mm/memory_hotplug: make offline_and_remove_memory() timeout instead of failing on fatal signals

2023-06-27 Thread kernel test robot
Hi David, kernel test robot noticed the following build warnings: [auto build test WARNING on 6995e2de6891c724bfeb2db33d7b87775f913ad1] url: https://github.com/intel-lab-lkp/linux/commits/David-Hildenbrand/mm-memory_hotplug-check-for-fatal-signals-only-in-offline_pages/20230627-192444 base

Re: [PATCH vhost v10 02/10] virtio_ring: introduce virtqueue_set_premapped()

2023-06-27 Thread Xuan Zhuo
On Tue, 27 Jun 2023 10:56:54 -0400, "Michael S. Tsirkin" wrote: > On Tue, Jun 27, 2023 at 04:50:01PM +0800, Xuan Zhuo wrote: > > On Tue, 27 Jun 2023 16:03:23 +0800, Jason Wang wrote: > > > On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo > > > wrote: > > > > > > > > This helper allows the driver chang

Re: [PATCH v1 3/5] mm/memory_hotplug: make offline_and_remove_memory() timeout instead of failing on fatal signals

2023-06-27 Thread John Hubbard via Virtualization
On 6/27/23 08:14, Michal Hocko wrote: On Tue 27-06-23 16:57:53, David Hildenbrand wrote: ... IIUC (John can correct me if I am wrong): 1) The process holds the device node open 2) The process gets killed or quits 3) As the process gets torn down, it closes the device node 4) Closing the device

Re: [PATCH v6 0/3] Add sync object UAPI support to VirtIO-GPU driver

2023-06-27 Thread Rob Clark
On Fri, May 12, 2023 at 2:23 PM Gurchetan Singh wrote: > > > > On Thu, May 11, 2023 at 7:33 PM Dmitry Osipenko > wrote: >> >> On 5/12/23 03:17, Gurchetan Singh wrote: >> ... >> > Can we get one of the Mesa MRs reviewed first? There's currently no >> > virtio-intel MR AFAICT, and the amdgpu one

Re: [PATCH v1 3/5] mm/memory_hotplug: make offline_and_remove_memory() timeout instead of failing on fatal signals

2023-06-27 Thread David Hildenbrand
On 27.06.23 16:17, Michal Hocko wrote: On Tue 27-06-23 15:14:11, David Hildenbrand wrote: On 27.06.23 14:40, Michal Hocko wrote: On Tue 27-06-23 13:22:18, David Hildenbrand wrote: John Hubbard writes [1]: Some device drivers add memory to the system via memory hotplug. Whe

Re: [PATCH vhost v10 02/10] virtio_ring: introduce virtqueue_set_premapped()

2023-06-27 Thread Michael S. Tsirkin
On Tue, Jun 27, 2023 at 04:50:01PM +0800, Xuan Zhuo wrote: > On Tue, 27 Jun 2023 16:03:23 +0800, Jason Wang wrote: > > On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo wrote: > > > > > > This helper allows the driver change the dma mode to premapped mode. > > > Under the premapped mode, the virtio core d

Re: [PATCH v1 1/5] mm/memory_hotplug: check for fatal signals only in offline_pages()

2023-06-27 Thread David Hildenbrand
On 27.06.23 14:34, Michal Hocko wrote: On Tue 27-06-23 13:22:16, David Hildenbrand wrote: Let's check for fatal signals only. That looks cleaner and still keeps the documented use case for manual user-space triggered memory offlining working. From Documentation/admin-guide/mm/memory-hotplug.rst:

Re: [PATCH v1 3/5] mm/memory_hotplug: make offline_and_remove_memory() timeout instead of failing on fatal signals

2023-06-27 Thread David Hildenbrand
On 27.06.23 14:40, Michal Hocko wrote: On Tue 27-06-23 13:22:18, David Hildenbrand wrote: John Hubbard writes [1]: Some device drivers add memory to the system via memory hotplug. When the driver is unloaded, that memory is hot-unplugged. However, memory hot unplug c

Re: [PATCH v6 3/3] drm/virtio: Support sync objects

2023-06-27 Thread Geert Uytterhoeven
Hi Dmitry, On Mon, Jun 26, 2023 at 6:11 PM Dmitry Osipenko wrote: > On 6/25/23 18:36, Geert Uytterhoeven wrote: > > On Sun, Jun 25, 2023 at 2:41 PM Dmitry Osipenko > > wrote: > >> On 6/25/23 11:47, Geert Uytterhoeven wrote: > >>> On Sun, Apr 16, 2023 at 1:55 PM Dmitry Osipenko > >>> wrote: > >>

[PATCH v1 2/2] vduse: enable Virtio-net device type

2023-06-27 Thread Maxime Coquelin
This patch adds Virtio-net device type to the supported devices types. Initialization fails if the device does not support VIRTIO_F_VERSION_1 feature, in order to guarantee the configuration space is read-only. Signed-off-by: Maxime Coquelin --- drivers/vdpa/vdpa_user/vduse_dev.c | 6 ++ 1 f

[PATCH v1 1/2] vduse: validate block features only with block devices

2023-06-27 Thread Maxime Coquelin
This patch is preliminary work to enable network device type support to VDUSE. As VIRTIO_BLK_F_CONFIG_WCE shares the same value as VIRTIO_NET_F_HOST_TSO4, we need to restrict its check to Virtio-blk device type. Signed-off-by: Maxime Coquelin --- drivers/vdpa/vdpa_user/vduse_dev.c | 9 +

[PATCH v1 0/2] vduse: add support for networking devices

2023-06-27 Thread Maxime Coquelin
This small series enables virtio-net device type in VDUSE. With it, basic operation have been tested, both with virtio-vdpa and vhost-vdpa using DPDK Vhost library series adding VDUSE support using split rings layout (merged in DPDK v23.07-rc1). Control queue support (and so multiqueue) has also b

[PATCH v1 3/5] mm/memory_hotplug: make offline_and_remove_memory() timeout instead of failing on fatal signals

2023-06-27 Thread David Hildenbrand
John Hubbard writes [1]: Some device drivers add memory to the system via memory hotplug. When the driver is unloaded, that memory is hot-unplugged. However, memory hot unplug can fail. And these days, it fails a little too easily, with respect to the above case. S

[PATCH v1 4/5] virtio-mem: set the timeout for offline_and_remove_memory() to 10 seconds

2023-06-27 Thread David Hildenbrand
Currently we use the default (30 seconds), let's reduce it to 10 seconds. In BBM, we barely deal with blocks larger than 1/2 GiB, and after 10 seconds it's most probably best to give up on that memory block and try another one (or retry this one later). In the common fake-offline case where we eff

[PATCH v1 5/5] virtio-mem: check if the config changed before (fake) offlining memory

2023-06-27 Thread David Hildenbrand
If we repeatedly fail to (fake) offline memory, we won't be sending any unplug requests to the device. However, we only check if the config changed when sending such (un)plug requests. So we could end up trying for a long time to offline memory, even though the config changed already and we're not

[PATCH v1 2/5] virtio-mem: convert most offline_and_remove_memory() errors to -EBUSY

2023-06-27 Thread David Hildenbrand
Let's prepare for offline_and_remove_memory() to return other error codes that effectively translate to -EBUSY, such as -ETIMEDOUT. Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/virtio/virtio

[PATCH v1 0/5] mm/memory_hotplug: make offline_and_remove_memory() timeout instead of failing on fatal signals

2023-06-27 Thread David Hildenbrand
As raised by John Hubbard [1], offline_and_remove_memory() failing on fatal signals can be sub-optimal for out-of-tree drivers: dying user space might be the last one holding a device node open. As that device node gets closed, the driver might unplug the device and trigger offline_and_remove_memo

[PATCH v1 1/5] mm/memory_hotplug: check for fatal signals only in offline_pages()

2023-06-27 Thread David Hildenbrand
Let's check for fatal signals only. That looks cleaner and still keeps the documented use case for manual user-space triggered memory offlining working. From Documentation/admin-guide/mm/memory-hotplug.rst: % timeout $TIMEOUT offline_block | failure_handling In fact, we even document ther

Re: [PATCH vhost v10 10/10] virtio_net: support dma premapped

2023-06-27 Thread Xuan Zhuo
On Tue, 27 Jun 2023 16:03:35 +0800, Jason Wang wrote: > On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo wrote: > > > > Introduce the module param "experiment_premapped" to enable the function > > that the virtio-net do dma mapping. > > > > If that is true, the vq of virtio-net is under the premapped mod

Re: [PATCH vhost v10 05/10] virtio_ring: split-detach: support return dma info to driver

2023-06-27 Thread Xuan Zhuo
On Tue, 27 Jun 2023 16:03:31 +0800, Jason Wang wrote: > On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo wrote: > > > > Under the premapped mode, the driver needs to unmap the DMA address > > after receiving the buffer. The virtio core records the DMA address, > > so the driver needs a way to get the dma

Re: [PATCH vhost v10 04/10] virtio_ring: packed: support add premapped buf

2023-06-27 Thread Xuan Zhuo
On Tue, 27 Jun 2023 16:03:29 +0800, Jason Wang wrote: > On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo wrote: > > > > If the vq is the premapped mode, use the sg_dma_address() directly. > > > > Signed-off-by: Xuan Zhuo > > --- > > drivers/virtio/virtio_ring.c | 36 ++--

Re: [PATCH vhost v10 03/10] virtio_ring: split: support add premapped buf

2023-06-27 Thread Xuan Zhuo
On Tue, 27 Jun 2023 16:03:26 +0800, Jason Wang wrote: > On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo wrote: > > > > If the vq is the premapped mode, use the sg_dma_address() directly. > > > > Signed-off-by: Xuan Zhuo > > --- > > drivers/virtio/virtio_ring.c | 46 ++--

Re: [PATCH vhost v10 02/10] virtio_ring: introduce virtqueue_set_premapped()

2023-06-27 Thread Xuan Zhuo
On Tue, 27 Jun 2023 16:03:23 +0800, Jason Wang wrote: > On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo wrote: > > > > This helper allows the driver change the dma mode to premapped mode. > > Under the premapped mode, the virtio core do not do dma mapping > > internally. > > > > This just work when the

Re: [PATCH v3 1/8] drm: Disable the cursor plane on atomic contexts with virtualized drivers

2023-06-27 Thread Pekka Paalanen
On Mon, 26 Jun 2023 23:58:32 -0400 Zack Rusin wrote: > From: Zack Rusin > > Cursor planes on virtualized drivers have special meaning and require > that the clients handle them in specific ways, e.g. the cursor plane > should react to the mouse movement the way a mouse cursor would be > expecte

Re: [PATCH vhost v10 10/10] virtio_net: support dma premapped

2023-06-27 Thread Jason Wang
On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo wrote: > > Introduce the module param "experiment_premapped" to enable the function > that the virtio-net do dma mapping. > > If that is true, the vq of virtio-net is under the premapped mode. > It just handle the sg with dma_address. And the driver must ge

Re: [PATCH vhost v10 05/10] virtio_ring: split-detach: support return dma info to driver

2023-06-27 Thread Jason Wang
On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo wrote: > > Under the premapped mode, the driver needs to unmap the DMA address > after receiving the buffer. The virtio core records the DMA address, > so the driver needs a way to get the dma info from the virtio core. A second thought, can we simply offl

Re: [RFC PATCH v4 07/17] vsock: read from socket's error queue

2023-06-27 Thread Stefano Garzarella
On Tue, Jun 27, 2023 at 07:49:00AM +0300, Arseniy Krasnov wrote: On 26.06.2023 19:08, Stefano Garzarella wrote: On Sat, Jun 03, 2023 at 11:49:29PM +0300, Arseniy Krasnov wrote: This adds handling of MSG_ERRQUEUE input flag in receive call. This flag is used to read socket's error queue instea

Re: [PATCH vhost v10 04/10] virtio_ring: packed: support add premapped buf

2023-06-27 Thread Jason Wang
On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo wrote: > > If the vq is the premapped mode, use the sg_dma_address() directly. > > Signed-off-by: Xuan Zhuo > --- > drivers/virtio/virtio_ring.c | 36 ++-- > 1 file changed, 26 insertions(+), 10 deletions(-) > > diff --git

Re: [PATCH vhost v10 03/10] virtio_ring: split: support add premapped buf

2023-06-27 Thread Jason Wang
On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo wrote: > > If the vq is the premapped mode, use the sg_dma_address() directly. > > Signed-off-by: Xuan Zhuo > --- > drivers/virtio/virtio_ring.c | 46 ++-- > 1 file changed, 28 insertions(+), 18 deletions(-) > > diff --git

Re: [PATCH vhost v10 02/10] virtio_ring: introduce virtqueue_set_premapped()

2023-06-27 Thread Jason Wang
On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo wrote: > > This helper allows the driver change the dma mode to premapped mode. > Under the premapped mode, the virtio core do not do dma mapping > internally. > > This just work when the use_dma_api is true. If the use_dma_api is false, > the dma options i

Re: [PATCH vhost v10 01/10] virtio_ring: put mapping error check in vring_map_one_sg

2023-06-27 Thread Jason Wang
On Fri, Jun 2, 2023 at 5:22 PM Xuan Zhuo wrote: > > This patch put the dma addr error check in vring_map_one_sg(). > > The benefits of doing this: > > 1. reduce one judgment of vq->use_dma_api. > 2. make vring_map_one_sg more simple, without calling >vring_mapping_error to check the return val

Re: [RFC PATCH v4 00/17] vsock: MSG_ZEROCOPY flag support

2023-06-27 Thread Stefano Garzarella
On Tue, Jun 27, 2023 at 07:55:58AM +0300, Arseniy Krasnov wrote: On 26.06.2023 19:15, Stefano Garzarella wrote: On Sat, Jun 03, 2023 at 11:49:22PM +0300, Arseniy Krasnov wrote: [...]   LET'S SPLIT PATCHSET TO MAKE REVIEW EASIER In v3 Stefano Garzarella asked to split this patchs

Re: [RFC PATCH v4 06/17] vsock: check error queue to set EPOLLERR

2023-06-27 Thread Stefano Garzarella
On Tue, Jun 27, 2023 at 07:44:25AM +0300, Arseniy Krasnov wrote: On 26.06.2023 19:04, Stefano Garzarella wrote: On Sat, Jun 03, 2023 at 11:49:28PM +0300, Arseniy Krasnov wrote: If socket's error queue is not empty, EPOLLERR must be set. Otherwise, reader of error queue won't detect data in it

Re: [RFC PATCH v4 05/17] vsock/virtio: MSG_ZEROCOPY flag support

2023-06-27 Thread Stefano Garzarella
On Tue, Jun 27, 2023 at 07:41:51AM +0300, Arseniy Krasnov wrote: On 26.06.2023 19:03, Stefano Garzarella wrote: On Sat, Jun 03, 2023 at 11:49:27PM +0300, Arseniy Krasnov wrote: This adds handling of MSG_ZEROCOPY flag on transmission path: if this flag is set and zerocopy transmission is possi

Re: [RFC PATCH v4 03/17] vsock/virtio: support to send non-linear skb

2023-06-27 Thread Stefano Garzarella
On Tue, Jun 27, 2023 at 07:39:41AM +0300, Arseniy Krasnov wrote: On 26.06.2023 18:36, Stefano Garzarella wrote: On Sat, Jun 03, 2023 at 11:49:25PM +0300, Arseniy Krasnov wrote: For non-linear skb use its pages from fragment array as buffers in virtio tx queue. These pages are already pinned b

Re: [RFC PATCH v1 2/4] virtio/vsock: support MSG_PEEK for SOCK_SEQPACKET

2023-06-27 Thread Stefano Garzarella
On Tue, Jun 27, 2023 at 07:34:29AM +0300, Arseniy Krasnov wrote: On 26.06.2023 19:28, Stefano Garzarella wrote: On Sun, Jun 18, 2023 at 09:24:49AM +0300, Arseniy Krasnov wrote: This adds support of MSG_PEEK flag for SOCK_SEQPACKET type of socket. Difference with SOCK_STREAM is that this callb