Skip to content

hwrng: virtio - add an internal buffer

Laurent Vivier linux-crypto lkml virtualization 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 8 repliesIn review
  2. v14 patches 8 repliesSuperseded

Changes in v2 from the cover letter

fixes issue reported by [email protected] by reseting data_idx to 0 when the buffer is submitted not when it is received as the consumer checks for data_avail, not only for the completion.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4hwrng: virtio - add an internal bufferdrivers/char/hw_random/virtio-rng.c+33 -100 replies
2/4hwrng: virtio - don't wait on cleanupdrivers/char/hw_random/virtio-rng.c+6 -10 replies
3/4hwrng: virtio - don't waste entropydrivers/char/hw_random/virtio-rng.c+35 -170 replies
4/4hwrng: virtio - always add a pending requestdrivers/char/hw_random/virtio-rng.c+12 -148 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] hwrng: virtio - add an internal buffer

hwrng core uses two buffers that can be mixed in the virtio-rng queue.

This series fixes the problem by adding an internal buffer in virtio-rng.

Once the internal buffer is added, we can fix two other problems:

- to be able to release the driver without waiting the device releases the buffer

- actually returns some data when wait=0 as we can have some already available data

It also tries to improve the performance by always having a buffer in the queue of the device.

v2:
fixes issue reported by [email protected] by reseting data_idx to 0 when the buffer is submitted not when it is received as the consumer checks for data_avail, not only for the completion.

Laurent Vivier (4):
hwrng: virtio - add an internal buffer
hwrng: virtio - don't wait on cleanup
hwrng: virtio - don't waste entropy
hwrng: virtio - always add a pending request

 drivers/char/hw_random/virtio-rng.c | 86 ++++++++++++++++++++++-------
 1 file changed, 65 insertions(+), 21 deletions(-)
Signature · 1 line
2.31.1