> The virtio-vsock RX worker currently acquires and releases the socket lock > and looks up the socket for every received packet. Keep the lock and lookup > reference across a bounded run of packets that belongs to the same socket. > > Only ordinary RW packets for an established STREAM socket whose transport > and protocol remain unchanged are eligible. Control packets, SEQPACKET > traffic, state or transport changes, malformed packets, and sockets whose > protocol has been replaced end the active batch and retain their existing > handling. > > A psock is published in sk_user_data before sockmap replaces the protocol > or callbacks. Exclude sockets carrying that marker from batching, and check > it again at every packet boundary. Thus an attach racing an active native > batch makes the next packet end the batch without changing the sockmap > update result. > [ ... ] > > Introduce virtio_transport_rx_batch_finish() to tear down the batch and > release the socket lock and lookup reference. > > Signed-off-by: Jia Jia <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=2
