xdp-tutorial icon indicating copy to clipboard operation
xdp-tutorial copied to clipboard

Unfortunate / misleading use of -M for command line option?

Open simonhf opened this issue 5 years ago • 0 comments

I noticed that this tutorial implements the command line -M option for Reuse pinned maps [1], whereas the Linux kernel source tree xdpsock example implements the command line -M option for Enable XDP_SHARED_UMEM [2].

This is a little confusing to a beginner because initially you think it might be the same thing and that both options are dealing with shared memory... but it seems to me -- if I understand correctly -- that they are completely different and perhaps one of them should consider moving away from -M? Possibly the tutorial because it came along later?

Maps can be reused / shared by 'pinning' them UMEM can also be shared. This also makes me wonder why UMEM itself was not implemented in XDP similarly to 'pinned maps'? Any ideas?

[1] https://github.com/xdp-project/xdp-tutorial/blob/master/basic-solutions/xdp_loader.c#L50 [2] https://github.com/torvalds/linux/blob/master/samples/bpf/xdpsock_user.c#L655

simonhf avatar Mar 03 '20 17:03 simonhf