Hi guys, Nowadays, in order to limit the guest's TX bandwidth, we can apply tc on tap device's ingress Qdisc on host. But I think it is based on dropping packets in the host's Qdisc layer(Right?). If my assumption is right, then on guest, whether the sender process will lower its output or not, will depend on protocol layer implement. As to protocol armed with congestion control such as tcp, the sender process will block and save cpu. But as to udp, it seems that the sender process just generate some unnecessary dropped packets. In order to save cpu, we can introduce control vhost-net, then the guest udp sender will block on sk.sk_wmem_alloc to get the same effect as blocking on congestion like tcp.
But all of above are based on the Qdisc layer's behavior when network over-limit on host. Is it simply drop skb or defer its transferring? If deferring, any example code? Any comments? Thanks and regards, pingfan