Revert "virtio_ring: add a func argument 'recycle_done' to virtqueue_reset()"

This reverts commit 343a77562c which is
commit 8d2da07c813ad333c20eb803e15f8c4541f25350 upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: If7c1dad1218664f0cd6763004b01890f9258d461
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2025-06-03 08:31:57 +00:00
parent 81930ac28a
commit 60eb68c4d8
3 changed files with 4 additions and 9 deletions
+2 -2
View File
@@ -5547,7 +5547,7 @@ static int virtnet_rq_bind_xsk_pool(struct virtnet_info *vi, struct receive_queu
virtnet_rx_pause(vi, rq); virtnet_rx_pause(vi, rq);
err = virtqueue_reset(rq->vq, virtnet_rq_unmap_free_buf, NULL); err = virtqueue_reset(rq->vq, virtnet_rq_unmap_free_buf);
if (err) { if (err) {
netdev_err(vi->dev, "reset rx fail: rx queue index: %d err: %d\n", qindex, err); netdev_err(vi->dev, "reset rx fail: rx queue index: %d err: %d\n", qindex, err);
@@ -5576,7 +5576,7 @@ static int virtnet_sq_bind_xsk_pool(struct virtnet_info *vi,
virtnet_tx_pause(vi, sq); virtnet_tx_pause(vi, sq);
err = virtqueue_reset(sq->vq, virtnet_sq_free_unused_buf, NULL); err = virtqueue_reset(sq->vq, virtnet_sq_free_unused_buf);
if (err) { if (err) {
netdev_err(vi->dev, "reset tx fail: tx queue index: %d err: %d\n", qindex, err); netdev_err(vi->dev, "reset tx fail: tx queue index: %d err: %d\n", qindex, err);
pool = NULL; pool = NULL;
+1 -5
View File
@@ -2815,7 +2815,6 @@ EXPORT_SYMBOL_GPL(virtqueue_set_dma_premapped);
* virtqueue_reset - detach and recycle all unused buffers * virtqueue_reset - detach and recycle all unused buffers
* @_vq: the struct virtqueue we're talking about. * @_vq: the struct virtqueue we're talking about.
* @recycle: callback to recycle unused buffers * @recycle: callback to recycle unused buffers
* @recycle_done: callback to be invoked when recycle for all unused buffers done
* *
* Caller must ensure we don't call this with other virtqueue operations * Caller must ensure we don't call this with other virtqueue operations
* at the same time (except where noted). * at the same time (except where noted).
@@ -2827,8 +2826,7 @@ EXPORT_SYMBOL_GPL(virtqueue_set_dma_premapped);
* -EPERM: Operation not permitted * -EPERM: Operation not permitted
*/ */
int virtqueue_reset(struct virtqueue *_vq, int virtqueue_reset(struct virtqueue *_vq,
void (*recycle)(struct virtqueue *vq, void *buf), void (*recycle)(struct virtqueue *vq, void *buf))
void (*recycle_done)(struct virtqueue *vq))
{ {
struct vring_virtqueue *vq = to_vvq(_vq); struct vring_virtqueue *vq = to_vvq(_vq);
int err; int err;
@@ -2836,8 +2834,6 @@ int virtqueue_reset(struct virtqueue *_vq,
err = virtqueue_disable_and_recycle(_vq, recycle); err = virtqueue_disable_and_recycle(_vq, recycle);
if (err) if (err)
return err; return err;
if (recycle_done)
recycle_done(_vq);
if (vq->packed_ring) if (vq->packed_ring)
virtqueue_reinit_packed(vq); virtqueue_reinit_packed(vq);
+1 -2
View File
@@ -103,8 +103,7 @@ int virtqueue_resize(struct virtqueue *vq, u32 num,
void (*recycle)(struct virtqueue *vq, void *buf), void (*recycle)(struct virtqueue *vq, void *buf),
void (*recycle_done)(struct virtqueue *vq)); void (*recycle_done)(struct virtqueue *vq));
int virtqueue_reset(struct virtqueue *vq, int virtqueue_reset(struct virtqueue *vq,
void (*recycle)(struct virtqueue *vq, void *buf), void (*recycle)(struct virtqueue *vq, void *buf));
void (*recycle_done)(struct virtqueue *vq));
void virtqueue_disable_dma_api_for_buffers(struct virtqueue *vq); void virtqueue_disable_dma_api_for_buffers(struct virtqueue *vq);