Re: [grpc-io] kernel mode

167 views
Skip to first unread message

Basem Barakat

unread,
Jul 13, 2023, 7:29:43 PM7/13/23
to smita deshpande, grpc.io
I will probably recommend running in user space but use something like eBPF to read and relay your kernel grpc commands 

Basem


On Jul 13, 2023, at 4:57 PM, smita deshpande <smitades...@gmail.com> wrote:

Can we run grpc in kernel mode?
I want to communicate over gRPC while in kernel mode. So there should not be any multithreading and use of minimal memory.
What are the configurations to be used in proto file. Is there any documentation on that?

Thanks,
Smita

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/ae6fde13-85fd-45c2-9b48-52866fbeb65en%40googlegroups.com.
Message has been deleted

smita deshpande

unread,
Jul 25, 2023, 9:52:10 AM7/25/23
to grpc.io

Hello,

I read about eBPF. However, if there is any sample example in grpc which is relaying the kernel commands would really help me understand. I want to know if there is any feature is available in grpc or a plugin that I could use to relay the kernel commands. Is there a delegation mechanism to userspace (where the gRCP client would be rooted) that could generate the client-side stubs, so we wouldn't have to write and maintain them manually?

Thanks,
Smita

Patrick Gili

unread,
Jul 27, 2023, 11:36:21 AM7/27/23
to grpc.io
Basem, would you mind expanding on your recommendation, "running in user space but using something like eBPF to read and relay..."?

Basem Barakat

unread,
Jul 27, 2023, 12:21:57 PM7/27/23
to Patrick Gili, grpc.io
The gRPC framework like most frameworks is user space based 

Assuming a Linux like os, so to relay rpcs from/to kernel the communication need to go through a user space.

Not sure on which side is kernel: client or server ? But the principle remains the same:

User space and kernel applications could communicate in many ways:
Ioctl is once simple way:

And depending on the type of communication eBPF could be more suitable ?

The advantage of eBPF is already present in Linux kernel and not kernel modification is required, you will need to learn it as it has its own language but c like compilers and tool kit are available 



Basem


On Jul 27, 2023, at 10:36 AM, Patrick Gili <gili.pa...@gmail.com> wrote:

Basem, would you mind expanding on your recommendation, "running in user space but using something like eBPF to read and relay..."?

Patrick Gili

unread,
Jul 27, 2023, 12:58:46 PM7/27/23
to grpc.io
Thanks Basem, your feedback is helpful. This would be on the client side, and we would need to support Windows and macOS. While Windows has eBPF support (work-in-progress), I cannot find anything for macOS.

Basem Barakat

unread,
Jul 27, 2023, 2:38:10 PM7/27/23
to Patrick Gili, grpc.io
Yah eBPF is not on the Mac for sure. And hence this does not look a suitable solution in your case

But the principle remains to identify a supported user space kernel space communication method for your client.  And plumb this into your grpc client in user space.

Basem


On Jul 27, 2023, at 11:58 AM, Patrick Gili <gili.pa...@gmail.com> wrote:

Thanks Basem, your feedback is helpful. This would be on the client side, and we would need to support Windows and macOS. While Windows has eBPF support (work-in-progress), I cannot find anything for macOS.
Reply all
Reply to author
Forward
0 new messages