[PATCH vhost 0/4] refactor the params of find_vqs()

2024-03-04 Thread Xuan Zhuo
This pathset is splited from the http://lore.kernel.org/all/20240229072044.77388-1-xuanz...@linux.alibaba.com That may needs some cycles to discuss. But that notifies too many people. But just the four commits need to notify so many people. And four commits are independent. So I split that

[PATCH vhost 1/4] virtio: find_vqs: pass struct instead of multi parameters

2024-03-04 Thread Xuan Zhuo
Now, we pass multi parameters to find_vqs. These parameters may work for transport or work for vring. And find_vqs has multi implements in many places: arch/um/drivers/virtio_uml.c drivers/platform/mellanox/mlxbf-tmfifo.c drivers/remoteproc/remoteproc_virtio.c drivers/s390/virtio/virtio_ccw.c

[PATCH vhost 2/4] virtio: vring_create_virtqueue: pass struct instead of multi parameters

2024-03-04 Thread Xuan Zhuo
Now, we pass multi parameters to vring_create_virtqueue. These parameters may from transport or from driver. vring_create_virtqueue is called by many places. Every time, we try to add a new parameter, that is difficult. If parameters from the driver, that should directly be passed to vring. Then

[PATCH vhost 4/4] virtio_ring: simplify the parameters of the funcs related to vring_create/new_virtqueue()

2024-03-04 Thread Xuan Zhuo
As the refactor of find_vqs()/vring_new_virtqueue()/vring_create_virtqueue the struct cfg/tp_cfg are passed to vring. This patch refactors the vring by these structures. This can simplify the code. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 157 +++--

[PATCH vhost 3/4] virtio: vring_new_virtqueue(): pass struct instead of multi parameters

2024-03-04 Thread Xuan Zhuo
Just like find_vqs(), it is time to refactor the vring_new_virtqueue(). We pass the similar struct to vring_new_virtqueue. Signed-off-by: Xuan Zhuo --- drivers/platform/mellanox/mlxbf-tmfifo.c | 13 +--- drivers/remoteproc/remoteproc_virtio.c | 11 --- drivers/virtio/virtio_ring.c