On Wed, Dec 18, 2019 at 02:01:47AM +0000, Yi Yang (杨�D)-云服务集团 wrote: > Ben, thank for your review, for recvmmsg, we have to prepare some buffers > for it, but we have no way to know how many packets are there for socket, so > these mallocs are must-have overhead, maybe self-adaptive malloc mechanism > is better, for example, the first receive just mallocs 4 buffers, if it > receives 4 buffers successfully, we can increase it to 8, till it is up to > 32, if it can't receive all the buffers, we can decrease it by one half, but > this will make code complicated a bit.
I don't know whether this is actually a performance problem in practice. My thought is caching: maintain a per-thread collection of buffers and receive into those, then return only the ones that actually got populated and keep the rest for next time. > Your fix is right, I should be set to 0 when retval < 0, thank for your > review again, I'll update it with your fix patch and send another version. Would you mind reviewing the patch I posted that adds recvmmsg() emulation for systems that don't have it? I CCed you on it. _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev