> Each received packet can update peer credit and call sk_write_space(). A > writer cannot consume that credit while the virtio RX worker retains the > socket lock, so repeated native write-space notifications in one RX batch > are unnecessary. > > This patch coalesces write-space notifications on the native AF_VSOCK path; > data-ready remains per-packet here. > > The batching patch establishes batch ownership before its first packet. > This lets this patch record a pending notification for that packet and > flush it even if the packet immediately ends the batch. Deliver it while > holding the socket lock to preserve the callback context of the existing > receive path. A following patch changes that timing together with > data-ready handling. > > Capture the native write-space callback before socket publication and > access it through AF_VSOCK helpers. Sockmap can change the protocol, > write-space callback, and psock marker without the socket lock. Serialize > each batch eligibility check with sk_callback_lock; if a packet boundary > observes a replacement, finish the batch and use the regular per-packet > path. > > Packets admitted on the native path use the saved native callback at batch > finish. Reloading a current sockmap callback would not synchronize its > invocation with teardown; a wrapper seen before teardown need not forward > the native wakeup after its psock is gone. > > Signed-off-by: Jia Jia <[email protected]>
Sashiko has reviewed this patch and found no issues. -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=4
