Extending sockmap and future of L7 BPF framework ================================================ At Plumbers ‘19 we presented our plan to make socket dispatch programmable using BPF [0]. A key component is the ability to look up sockets from a map. Our proof-of-concept patch-set used the sockarray map designed for reuseport BPF programs. Based on feedback from the community we’re doing work to transition to sockmap and sockhash. Specifically, we are adding support for TCP sockets in TCP_LISTEN state and UDP sockets in general. Additionally, we’ll let the reuseport BPF use sockmap and sockhash in addition to sockarray. We propose giving an overview of this work, and the user-space and BPF API changes it entails. This work brings up questions revolving around the future of L7 BPF frameworks and how it should evolve that we would like to discuss: - Should sockmap be extended further to hold sockets in any state? Would this make the user-experience better? - How to make sockmap and sockarray gracefully share sk_user_data, i.e. the link from the sock object to the map? - Is there a potential for code sharing between sockmap and sockarray? Would that make maintenance easier? - How should API redirecting to UDP sockets with sockmap look like, considering use of connected UDP sockets is not recommended? - Can we have a common helper for map-based redirect that works with all map types that can hold sockets, i.e. sockmap, sockhash, and sockarray? [0] https://www.youtube.com/watch?v=qRDoUpqvYjY