Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sendmmsg & Generic Segmentation Offloading? #220

Open
CreativePSofficial opened this issue Feb 6, 2023 · 4 comments
Open

sendmmsg & Generic Segmentation Offloading? #220

CreativePSofficial opened this issue Feb 6, 2023 · 4 comments

Comments

@CreativePSofficial
Copy link

CreativePSofficial commented Feb 6, 2023

Hello,

I wanted to ask you @lsalzman, whether ENet could see an optimization with GSO and sendmmsg (instead of the plain 'sendmsg') in order to optimize throughput?
( see: https://blog.cloudflare.com/accelerating-udp-packet-transmission-for-quic/ )
I have heard QUIC already leverages these, so I am asking how much sense it would make to implement them in ENet at least on the unix/linux side of things...

Thank you!

@CreativePSofficial
Copy link
Author

@lsalzman
Hello,

are there any updates on this?

@dimage1
Copy link

dimage1 commented Mar 21, 2024

Hi, sendmmsg optimizes CPU by reducing system calls. It should be relatively easy to implement by accumulating mmsghdr inside enet_socket_send and flushing it on buffers' limit reach or by direct calls of enet_socket_send_flush. ENetSocket can be extended to a structure to store intermediate buffers. BTW, a similar technique can be used for receiving, with recvmmsg.

@CreativePSofficial
Copy link
Author

Hello sir, thanks for your reply.

Yes... We have sendmmsg in already, but now I am asking about GSO, how could this be possibly done?

I am looking forward to hearing from you.
Thank you.

@dimage1
Copy link

dimage1 commented Mar 21, 2024

Sorry, I don't know a good way to benefit from GSO on enet. Enet already tries to split data close to the MTU size. All enet packets are below MTU, but have various sizes. So pushing them to the kernel as one big buffer (e.g. 64K) with predefined segment size might break enet. 
A complete OS kernel bypassing can be another way to go. Technologies like DPDK will help there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants