Open c4milo opened 7 years ago
@mrmonday thanks for answering so soon! I'm still in exploration phase and not sure yet if I should use Rust.
It depends what you're up to - Rust is definitely a great choice for many things.
If you're looking at DPDK then Rust is definitely worth considering - the main downside will be having to deal with bindings yourself. That's a potentially only a small inconvenience, but it really depends what you're up to.
I'm happy to give some advise if you share your requirements. Alternatively there are people on the Rust forums, the Rust subreddit, and the IRC channels, if you'd like a wider range of opinions.
Thanks a lot for the resources. I'm not sure I have the time to learn Rust and write the bindings for this. I think I'll leave the data plane in C11 and Go for control plane since it's already being used throughout this app. Thanks again for your help!
since there's no libpnet backend for DPDK right now
@mrmonday Can you elaborate on this? what would that entail & would such a contribution be considered?
A backend for libpnet is loosely "a thing that lets us put packets/get packets from somewhere".
There are backends for native OS network stack, netmap, and libpcap (you could actually use DPDK via libpcap via libpnet if you wanted...)
The source code for the existing backends is here: https://github.com/libpnet/libpnet/tree/master/pnet_datalink/src. To implement a backend based on DPDK you would implement the same interface as the existing backends, but using DPDK.
I'm sure libpnet's new maintainers would happily accept such a contribution, if you were to put the effort in.
I'm currently working on DPDK with Rust and hope this might help in your purpose.
Ok. Technically I am not porting over DPDK. I'm working with openNetVM. I just want to check if someone can help me with this. I am using Rust to build a NF that will run as a secondary process. The primary process is in C. And my NF continuously segfaults at an rte_mempool_get call. Let me know if anyone would be able to help.
Specifically, it fails at return ops->dequeue(mp, obj_table, n);
in rte_mempool.h
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x0000555555574aa3 in rte_mempool_ops_dequeue_bulk (n=1, obj_table=0x7fffffffdd40, mp=0x7f07b0d8700) at /home/ratnadeepb/micro-lb-parent/micro-lb-working/tools/openNetVM-dev/dpdk/x86_64-native-linuxapp-gcc/include/rte_mempool.h:657
#2 __mempool_generic_get (cache=<optimized out>, n=<optimized out>, obj_table=<optimized out>, mp=<optimized out>) at /home/ratnadeepb/micro-lb-parent/micro-lb-working/tools/openNetVM-dev/dpdk/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1391
#3 rte_mempool_generic_get (cache=<optimized out>, n=<optimized out>, obj_table=<optimized out>, mp=<optimized out>) at /home/ratnadeepb/micro-lb-parent/micro-lb-working/tools/openNetVM-dev/dpdk/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1426
#4 rte_mempool_get_bulk (n=1, obj_table=0x7fffffffdd40, mp=0x7f07b0d8700) at /home/ratnadeepb/micro-lb-parent/micro-lb-working/tools/openNetVM-dev/dpdk/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1459
#5 rte_mempool_get (obj_p=0x7fffffffdd40, mp=0x7f07b0d8700) at /home/ratnadeepb/micro-lb-parent/micro-lb-working/tools/openNetVM-dev/dpdk/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1485
#6 onvm_nflib_init_nf_init_cfg (tag=0x7fffffffde88 "H\340\377\377\377\177") at /home/ratnadeepb/micro-lb-parent/micro-lb-working/tools/openNetVM-dev/onvm/onvm_nflib/onvm_nflib.c:753
#7 0x0000555555574d6e in onvm_nflib_init (argc=4, argv=0x555555917dc0, nf_tag=0x7fffffffde88 "H\340\377\377\377\177", nf_local_ctx=0x555555917ef0, nf_function_table=0x555555917f10)
at /home/ratnadeepb/micro-lb-parent/micro-lb-working/tools/openNetVM-dev/onvm/onvm_nflib/onvm_nflib.c:345
#8 0x0000555555560db3 in tcp_lb::tcp_run (src=..., name=0x7fffffffe048) at framework/tcp_lb/src/lib.rs:80
#9 0x000055555555d966 in tcp_exe::main () at framework/tcp_exe/src/main.rs:20
I have no plans to, since there's no libpnet backend for DPDK right now.
If you'd like to take over maintenance you're welcome to. I will also happily receive pull requests if anyone is willing to work on it. It's mostly auto-generated anyway - might be better to start from scratch. What's there is a long way out of date now.