Revert "virtio/vsock: don't drop skbuff on copy failure"

This reverts commit 1e5f00e9db which is
commit 8daaf39f7f6ef53a11817f6a11ec104016c3545f upstream.

It needs to be reverted, as the function virtio_transport_free_pkt() is
in the stable Android ABI, and this function is removed in the 6.1.63
kernel as part of a series of fixes and optimizations of the virtio
networking connection.  To preserve the ABI (and thereby keeping the
slower interface), revert the commit for now.

If this needs to come back in the future, if performance for this
interface needs to be resolved, it can be done so in an ABI-safe way.

Bug: 161946584
Change-Id: Ie929bb2fbb4e3dc3cadc1e0d3b63ed8e83257a4a
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2023-11-29 13:00:11 +00:00
parent ec573670da
commit 5b9223a56f

View file

@ -368,7 +368,7 @@ virtio_transport_stream_do_dequeue(struct vsock_sock *vsk,
spin_lock_bh(&vvs->rx_lock);
while (total < len && !skb_queue_empty(&vvs->rx_queue)) {
skb = skb_peek(&vvs->rx_queue);
skb = __skb_dequeue(&vvs->rx_queue);
bytes = len - total;
if (bytes > skb->len)
@ -392,8 +392,9 @@ virtio_transport_stream_do_dequeue(struct vsock_sock *vsk,
u32 pkt_len = le32_to_cpu(virtio_vsock_hdr(skb)->len);
virtio_transport_dec_rx_pkt(vvs, pkt_len);
__skb_unlink(skb, &vvs->rx_queue);
consume_skb(skb);
} else {
__skb_queue_head(&vvs->rx_queue, skb);
}
}