erpc-io / eRPC

Efficient RPCs for datacenter networks
https://erpc.io/
Other
835 stars 137 forks source link

How does this work? #29

Closed Ye-Tian-Zero closed 5 years ago

Ye-Tian-Zero commented 5 years ago

image In the red frame,some packages are received, but can it be guaranteed that this is a full package? check_magic() is called in the blue frame, but how to guarantee that we have already received enough data for the struct pkthdr_t. As far as I know, packages may be split during data transfer, so how can this works well?

anujkaliaiitd commented 5 years ago

Yes, it's guaranteed by DPDK that num_pkts is the number of full packets received. Each packet might be part of a larger eRPC request or reply message, but that's OK.

Ye-Tian-Zero commented 5 years ago

Ok, I see~, I'm not very familiar with dpdk. Thanks for your reply. BTW, I notice that a user-space UDP protocol is used for parsing message, but packets can also be split in IP protocol, how to deal with this situation?

Ye-Tian-Zero commented 5 years ago

As I know, dpdk is a library for receiving data directly from L2(ethernet). So do we need deal with data split in IP level?

Like that: Machine A --- MTU=1500 ---> Switch --- MTU=100 ---> Machine B At that situation, well Machine B receive multi packets from ethernet device?

anujkaliaiitd commented 5 years ago

IP splitting is a possibility, but it's safe to assume that datacenter switch MTU is at least 1500 bytes.

Ye-Tian-Zero commented 5 years ago

Thanks a lot~ I forget that this is an rpc facing datacenter~ And ~ one more question. I notice that you use just one cpu core for dpdk's packet receiving and sending, will it be more efficient if we just give all cores to dpdk and run every event loop in dpdk's internal threads?

anujkaliaiitd commented 5 years ago

In the common use case for eRPC, multiple threads create exclusive Rpc objects. Each thread runs its Rpc's event loop, which performs packet I/O. So packet I/O not restricted to one core.

Ye-Tian-Zero commented 5 years ago

I mean, here image -c 1 option tells that dpdk can only use one core for it's own event loop? What will this core do? Not very clear....

anujkaliaiitd commented 5 years ago

That parameter doesn't actually affect the number of cores that perform packet I/O. DPDK doesn't have an internal event loop.

Ye-Tian-Zero commented 5 years ago

I get the point, thanks a lot!