Re: [PATCH v9 06/32] virtio_ring: split: extract the logic of alloc queue

2022-04-12 Thread Xuan Zhuo
On Tue, 12 Apr 2022 11:22:33 +0800, Jason Wang wrote: > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > Separate the logic of split to create vring queue. > > > > This feature is required for subsequent virtuqueue reset vring. > > > > Signed-off-by: Xuan Zhuo > > --- > > drivers/virtio/virtio_ring.c |

Re: [PATCH v9 07/32] virtio_ring: split: extract the logic of alloc state and extra

2022-04-12 Thread Xuan Zhuo
On Tue, 12 Apr 2022 11:26:49 +0800, Jason Wang wrote: > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > Separate the logic of creating desc_state, desc_extra, and subsequent > > patches will call it independently. > > > > Signed-off-by: Xuan Zhuo > > --- > > drivers/virtio/virtio_ring.c | 53 ++

Re: [PATCH v9 08/32] virtio_ring: split: extract the logic of attach vring

2022-04-12 Thread Xuan Zhuo
On Tue, 12 Apr 2022 11:31:08 +0800, Jason Wang wrote: > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > Separate the logic of attach vring, subsequent patches will call it > > separately. > > > > Signed-off-by: Xuan Zhuo > > --- > > drivers/virtio/virtio_ring.c | 20 ++-- > > 1 file ch

Re: [PATCH v9 11/32] virtio_ring: split: introduce virtqueue_resize_split()

2022-04-12 Thread Xuan Zhuo
On Tue, 12 Apr 2022 13:53:44 +0800, Jason Wang wrote: > > 在 2022/4/6 上午11:43, Xuan Zhuo 写道: > > virtio ring split supports resize. > > > > Only after the new vring is successfully allocated based on the new num, > > we will release the old vring. In any case, an error is returned, > > indicating t

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

2022-04-12 Thread Xuan Zhuo
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 > > vring_packed. > > > > This feature is required for subsequent virtuqueue reset

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

2022-04-12 Thread Xuan Zhuo
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: > > > > 1. notify the device to reset the queue > > 2. recycle the buffer s

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

2022-04-12 Thread Xuan Zhuo
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 > > ethtool -g eth0. > > > > When the subsequent patch implements vr

Re: [PATCH v3 01/10] timekeeping: add raw clock fallback for random_get_entropy()

2022-04-12 Thread Jason A. Donenfeld
Hi Thomas, On Tue, Apr 12, 2022 at 10:57 PM Thomas Gleixner wrote: > > On Tue, Apr 12 2022 at 19:27, Jason A. Donenfeld wrote: > > +/** > > + * random_get_entropy_fallback - Returns the raw clock source value, > > + * used by random.c for platforms with no valid random_get_entropy(). > > + */ > >

Re: [PATCH v3 01/10] timekeeping: add raw clock fallback for random_get_entropy()

2022-04-12 Thread Thomas Gleixner
On Tue, Apr 12 2022 at 19:27, Jason A. Donenfeld wrote: > +/** > + * random_get_entropy_fallback - Returns the raw clock source value, > + * used by random.c for platforms with no valid random_get_entropy(). > + */ > +unsigned long random_get_entropy_fallback(void) > +{ > + return tk_clock_read

Re: [PATCH v3 02/10] m68k: use fallback for random_get_entropy() instead of zero

2022-04-12 Thread Geert Uytterhoeven
On Tue, Apr 12, 2022 at 7:29 PM Jason A. Donenfeld wrote: > In the event that random_get_entropy() can't access a cycle counter or > similar, falling back to returning 0 is really not the best we can do. > Instead, at least calling random_get_entropy_fallback() would be > preferable, because that

[PATCH v3 10/10] xtensa: use fallback for random_get_entropy() instead of zero

2022-04-12 Thread Jason A. Donenfeld
In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies ev

[PATCH v3 09/10] sparc: use fallback for random_get_entropy() instead of zero

2022-04-12 Thread Jason A. Donenfeld
In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies ev

[PATCH v3 08/10] um: use fallback for random_get_entropy() instead of zero

2022-04-12 Thread Jason A. Donenfeld
In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies ev

[PATCH v3 07/10] x86: use fallback for random_get_entropy() instead of zero

2022-04-12 Thread Jason A. Donenfeld
In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies ev

[PATCH v3 06/10] nios2: use fallback for random_get_entropy() instead of zero

2022-04-12 Thread Jason A. Donenfeld
In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies ev

[PATCH v3 05/10] arm: use fallback for random_get_entropy() instead of zero

2022-04-12 Thread Jason A. Donenfeld
In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies ev

[PATCH v3 04/10] mips: use fallback for random_get_entropy() instead of zero

2022-04-12 Thread Jason A. Donenfeld
In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies ev

[PATCH v3 03/10] riscv: use fallback for random_get_entropy() instead of zero

2022-04-12 Thread Jason A. Donenfeld
In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies ev

[PATCH v3 02/10] m68k: use fallback for random_get_entropy() instead of zero

2022-04-12 Thread Jason A. Donenfeld
In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies ev

[PATCH v3 01/10] timekeeping: add raw clock fallback for random_get_entropy()

2022-04-12 Thread Jason A. Donenfeld
The addition of random_get_entropy_fallback() provides access to whichever time source has the highest frequency, which is useful for gathering entropy on platforms without available cycle counters. It's not necessarily as good as being able to quickly access a cycle counter that the CPU has, but i

[PATCH v3 00/10] archs/random: fallback to best raw ktime when no cycle counter

2022-04-12 Thread Jason A. Donenfeld
Hi folks, The RNG uses a function called random_get_entropy() basically anytime that it needs to timestamp an event. For example, an interrupt comes in, and we mix a random_get_entropy() into the entropy pool somehow. Somebody mashes their keyboard or moves their mouse around? We mix a random_get_

Re: [PATCH v9 29/32] virtio_net: get ringparam by virtqueue_get_vring_max_size()

2022-04-12 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Use virtqueue_get_vring_max_size() in virtnet_get_ringparam() to set tx,rx_max_pending. Signed-off-by: Xuan Zhuo --- Acked-by: Jason Wang drivers/net/virtio_net.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net

Re: [PATCH v9 28/32] virtio_net: set the default max ring size by find_vqs()

2022-04-12 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Use virtio_find_vqs_ctx_size() to specify the maximum ring size of tx, rx at the same time. | rx/tx ring size --- speed == UNKNOWN or < 10G| 1024 speed < 40G | 4096 speed >= 40G

Re: [PATCH v9 27/32] virtio: add helper virtio_find_vqs_ctx_size()

2022-04-12 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Introduce helper virtio_find_vqs_ctx_size() to call find_vqs and specify the maximum size of each vq ring. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- include/linux/virtio_config.h | 12 1 file changed, 12 insertions(+) diff --git

Re: [PATCH v9 26/32] virtio_mmio: support the arg sizes of find_vqs()

2022-04-12 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Virtio MMIO support the new parameter sizes of find_vqs(). Signed-off-by: Xuan Zhuo --- Acked-by: Jason Wang drivers/virtio/virtio_mmio.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_mmio.c b/drive

Re: [PATCH v9 25/32] virtio_pci: support the arg sizes of find_vqs()

2022-04-12 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: Virtio PCI supports new parameter sizes of find_vqs(). Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_pci_common.c | 18 ++ drivers/virtio/virtio_pci_common.h | 1 + drivers/virtio/virtio_pci_legacy.c | 6 +

Re: [PATCH v9 24/32] virtio: find_vqs() add arg sizes

2022-04-12 Thread Jason Wang
在 2022/4/6 上午11:43, Xuan Zhuo 写道: find_vqs() adds a new parameter sizes to specify the size of each vq vring. 0 means use the maximum size supported by the backend. Does this mean driver still need to prepare a array of 0 or it can simply pass NULL to find_vqs()? Thanks In the split s

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

2022-04-12 Thread Jason Wang
在 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: 1. notify the device to reset the queue 2. recycle the buffer submitted 3. reset the vring (may re-alloc) 4. mmap vring to device, and en