On Thu, 2026-11-05 at 19:19 -0500, Michael S. Tsirkin wrote:
> On Wed, Nov 04, 2026 at 07:01:41PM -0500, Oleg Drokin wrote:
> >
> >
> > #define VIRTIO_VSOCK_SKB_CB(skb) ((struct virtio_vsock_skb_cb
> > *)((skb)->cb))
> > @@ -167,6 +168,9 @@ struct virtio_vsock_sock {
> > u32 buf_used;
> > struct sk_buff_head rx_queue;
> > u32 msg_count;
> > + struct sk_buff *credit_update;
> > +
> > + refcount_t refcnt;
>
> why all this complexity? can you not just peek at the queue tail
> instead?
Thanks for the suggestion. The send queues are per device, not per
socket: vhost has one per guest, and the guest driver and loopback
have one each. A peer with two connections can alternate its credit
requests between them, so the tail is always the other connection's
update and nothing would ever be merged.
v2 reworks this third patch:
vsock_sock remembers its newest queued packet while that packet is a
credit update, together with the queue it is in.
The refcount, the skb destructor and the transmit hooks
are gone, and vhost and the guest driver are not touched.