Re: [PATCH vhost v6 02/10] virtio_ring: packed: remove double check of the unmap ops

2024-03-28 Thread Jason Wang
On Thu, Mar 28, 2024 at 4:16 PM Xuan Zhuo wrote: > > On Thu, 28 Mar 2024 16:07:14 +0800, Jason Wang wrote: > > On Thu, Mar 28, 2024 at 3:32 PM Xuan Zhuo > > wrote: > > > > > > On Thu, 28 Mar 2024 14:56:47 +0800, Jason Wang > > > wrote: > > > > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo > > >

Re: [PATCH vhost v6 09/10] virtio_net: set premapped mode by find_vqs()

2024-03-28 Thread Jason Wang
On Thu, Mar 28, 2024 at 4:27 PM Xuan Zhuo wrote: > > On Thu, 28 Mar 2024 16:05:02 +0800, Jason Wang wrote: > > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo > > wrote: > > > > > > Now, the virtio core can set the premapped mode by find_vqs(). > > > If the premapped can be enabled, the dma array wil

Re: [PATCH vhost v6 06/10] virtio_ring: no store dma info when unmap is not needed

2024-03-28 Thread Jason Wang
On Thu, Mar 28, 2024 at 3:42 PM Xuan Zhuo wrote: > > On Thu, 28 Mar 2024 15:06:33 +0800, Jason Wang wrote: > > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo > > wrote: > > > > > > As discussed: > > > http://lore.kernel.org/all/CACGkMEug-=C+VQhkMYSgUKMC==04m7-uem_yc21bggkkzh8...@mail.gmail.com > > >

Re: [PATCH net v2] virtio-net: fix possible dim status unrecoverable

2024-03-28 Thread Heng Qi
在 2024/3/28 下午6:34, Paolo Abeni 写道: On Tue, 2024-03-26 at 14:25 +0800, Heng Qi wrote: When the dim worker is scheduled, if it fails to acquire the lock, dim may not be able to return to the working state later. For example, the following single queue scenario: 1. The dim worker of rxq0 is

Re: [PATCH net-next v2 2/6] virtio_net: Remove command data from control_buf

2024-03-28 Thread kernel test robot
Hi Daniel, kernel test robot noticed the following build warnings: [auto build test WARNING on net-next/main] url: https://github.com/intel-lab-lkp/linux/commits/Daniel-Jurgens/virtio_net-Store-RSS-setting-in-virtnet_info/20240328-125022 base: net-next/main patch link: https

Re: [PATCH net-next 2/4] virtio_net: Remove command data from control_buf

2024-03-28 Thread Michael S. Tsirkin
On Thu, Mar 28, 2024 at 01:35:16PM +, Simon Horman wrote: > On Mon, Mar 25, 2024 at 04:49:09PM -0500, Daniel Jurgens wrote: > > Allocate memory for the data when it's used. Ideally the could be on the > > stack, but we can't DMA stack memory. With this change only the header > > and status memo

Re: [PATCH net-next 2/4] virtio_net: Remove command data from control_buf

2024-03-28 Thread Simon Horman
On Mon, Mar 25, 2024 at 04:49:09PM -0500, Daniel Jurgens wrote: > Allocate memory for the data when it's used. Ideally the could be on the > stack, but we can't DMA stack memory. With this change only the header > and status memory are shared between commands, which will allow using a > tighter loc

Re: [PATCH net v2] virtio-net: fix possible dim status unrecoverable

2024-03-28 Thread Paolo Abeni
On Tue, 2024-03-26 at 14:25 +0800, Heng Qi wrote: > When the dim worker is scheduled, if it fails to acquire the lock, > dim may not be able to return to the working state later. > > For example, the following single queue scenario: > 1. The dim worker of rxq0 is scheduled, and the dim status is

Re: [PATCH vhost v6 09/10] virtio_net: set premapped mode by find_vqs()

2024-03-28 Thread Xuan Zhuo
On Thu, 28 Mar 2024 16:05:02 +0800, Jason Wang wrote: > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > > > Now, the virtio core can set the premapped mode by find_vqs(). > > If the premapped can be enabled, the dma array will not be > > allocated. So virtio-net use the api of find_vqs to en

Re: [PATCH vhost v6 03/10] virtio_ring: packed: structure the indirect desc table

2024-03-28 Thread Xuan Zhuo
On Thu, 28 Mar 2024 16:07:03 +0800, Jason Wang wrote: > On Thu, Mar 28, 2024 at 3:38 PM Xuan Zhuo wrote: > > > > On Thu, 28 Mar 2024 14:56:55 +0800, Jason Wang wrote: > > > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo > > > wrote: > > > > > > > > This commit structure the indirect desc table. > >

Re: [PATCH vhost v6 02/10] virtio_ring: packed: remove double check of the unmap ops

2024-03-28 Thread Xuan Zhuo
On Thu, 28 Mar 2024 16:07:14 +0800, Jason Wang wrote: > On Thu, Mar 28, 2024 at 3:32 PM Xuan Zhuo wrote: > > > > On Thu, 28 Mar 2024 14:56:47 +0800, Jason Wang wrote: > > > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo > > > wrote: > > > > > > > > In the functions vring_unmap_extra_packed and vrin

Re: [PATCH vhost v6 02/10] virtio_ring: packed: remove double check of the unmap ops

2024-03-28 Thread Jason Wang
On Thu, Mar 28, 2024 at 3:32 PM Xuan Zhuo wrote: > > On Thu, 28 Mar 2024 14:56:47 +0800, Jason Wang wrote: > > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo > > wrote: > > > > > > In the functions vring_unmap_extra_packed and vring_unmap_desc_packed, > > > multiple checks are made whether unmap is

Re: [PATCH vhost v6 03/10] virtio_ring: packed: structure the indirect desc table

2024-03-28 Thread Jason Wang
On Thu, Mar 28, 2024 at 3:38 PM Xuan Zhuo wrote: > > On Thu, 28 Mar 2024 14:56:55 +0800, Jason Wang wrote: > > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo > > wrote: > > > > > > This commit structure the indirect desc table. > > > Then we can get the desc num directly when doing unmap. > > > > >

Re: [PATCH vhost v6 09/10] virtio_net: set premapped mode by find_vqs()

2024-03-28 Thread Jason Wang
On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > Now, the virtio core can set the premapped mode by find_vqs(). > If the premapped can be enabled, the dma array will not be > allocated. So virtio-net use the api of find_vqs to enable the > premapped. > > Judge the premapped mode by the vq->pre

Re: [PATCH vhost v6 08/10] virtio_ring: export premapped to driver by struct virtqueue

2024-03-28 Thread Jason Wang
On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > Export the premapped to drivers, then drivers can check > the vq premapped mode after the find_vqs(). > Because the find_vqs() just try to enable the vq premapped mode, > the driver must check that after find_vqs(). What's the reason for this?

Re: [PATCH vhost v6 07/10] virtio: find_vqs: add new parameter premapped

2024-03-28 Thread Jason Wang
On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > If the premapped mode is enabled, the dma array(struct vring_desc_dma) of > virtio core will not be allocated. That is judged when find_vqs() is > called. To avoid allocating dma array in find_vqs() and releasing it > immediately by virtqueue_se

Re: [PATCH vhost v6 05/10] virtio_ring: split: structure the indirect desc table

2024-03-28 Thread Xuan Zhuo
On Thu, 28 Mar 2024 15:01:02 +0800, Jason Wang wrote: > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > > > This commit structure the indirect desc table. > > Then we can get the desc num directly when doing unmap. > > > > And save the dma info to the struct, then the indirect > > will not u

Re: [PATCH vhost v6 06/10] virtio_ring: no store dma info when unmap is not needed

2024-03-28 Thread Xuan Zhuo
On Thu, 28 Mar 2024 15:06:33 +0800, Jason Wang wrote: > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > > > As discussed: > > http://lore.kernel.org/all/CACGkMEug-=C+VQhkMYSgUKMC==04m7-uem_yc21bggkkzh8...@mail.gmail.com > > > > When the vq is premapped mode, the driver manages the dma > > in

Re: [PATCH vhost v6 03/10] virtio_ring: packed: structure the indirect desc table

2024-03-28 Thread Xuan Zhuo
On Thu, 28 Mar 2024 14:56:55 +0800, Jason Wang wrote: > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > > > This commit structure the indirect desc table. > > Then we can get the desc num directly when doing unmap. > > > > And save the dma info to the struct, then the indirect > > will not u

Re: [PATCH vhost v6 02/10] virtio_ring: packed: remove double check of the unmap ops

2024-03-28 Thread Xuan Zhuo
On Thu, 28 Mar 2024 14:56:47 +0800, Jason Wang wrote: > On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > > > In the functions vring_unmap_extra_packed and vring_unmap_desc_packed, > > multiple checks are made whether unmap is performed and whether it is > > INDIRECT. > > > > These two functio

Re: [PATCH vhost v6 06/10] virtio_ring: no store dma info when unmap is not needed

2024-03-28 Thread Jason Wang
On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > As discussed: > http://lore.kernel.org/all/CACGkMEug-=C+VQhkMYSgUKMC==04m7-uem_yc21bggkkzh8...@mail.gmail.com > > When the vq is premapped mode, the driver manages the dma > info is a good way. > > So this commit make the virtio core not to stor

Re: [PATCH vhost v6 05/10] virtio_ring: split: structure the indirect desc table

2024-03-28 Thread Jason Wang
On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote: > > This commit structure the indirect desc table. > Then we can get the desc num directly when doing unmap. > > And save the dma info to the struct, then the indirect > will not use the dma fields of the desc_extra. The subsequent > commits will ma