Hi Paolo and Stefano, Sorry for the (super) late reply! I haven't had much time to work on it, I hope to send a v3 by the end of this month! Thanks both of you for your comments and reviews! :) > > This will add 2 atomic operations per packet, possibly on contended > > cachelines. Have you considered leveraging the existing transport-level > > lock to protect the counter updates? > Good point! > Maybe we can handle it together with `tx_cnt` in > virtio_transport_get_credit()/virtio_transport_put_credit(). > WDYT? I'll take a look at it! That's a very good idea. > Should virtio_transport_bytes_unsent() returns size_t? Yes! int was because of atomic_int, size_t is more appropriate. Thanks, Luigi