summaryrefslogtreecommitdiff
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorMina Almasry <almasrymina@google.com>2024-02-14 14:34:02 -0800
committerPaolo Abeni <pabeni@redhat.com>2024-02-20 09:22:58 +0100
commit18ddbf5cf0e7553fd05c3e1a02d740514ee3f0a6 (patch)
tree485c2cab0b5a3f72ef437b65b3a30ea79a938519 /include/linux/skbuff.h
parent74293ea1c4db62cb969e741fbfd479a34d935024 (diff)
net: introduce abstraction for network memory
Add the netmem_ref type, an abstraction for network memory. To add support for new memory types to the net stack, we must first abstract the current memory type. Currently parts of the net stack use struct page directly: - page_pool - drivers - skb_frag_t Originally the plan was to reuse struct page* for the new memory types, and to set the LSB on the page* to indicate it's not really a page. However, for compiler type checking we need to introduce a new type. netmem_ref is introduced to abstract the underlying memory type. Currently it's a no-op abstraction that is always a struct page underneath. In parallel there is an undergoing effort to add support for devmem to the net stack: https://lore.kernel.org/netdev/20231208005250.2910004-1-almasrymina@google.com/ netmem_ref can be pointers to different underlying memory types, and the low bits are set to indicate the memory type. Helpers are provided to convert netmem pointers to the underlying memory type (currently only struct page). In the devmem series helpers are provided so that calling code can use netmem without worrying about the underlying memory type unless absolutely necessary. Reviewed-by: Shakeel Butt <shakeelb@google.com> Signed-off-by: Mina Almasry <almasrymina@google.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/linux/skbuff.h')
0 files changed, 0 insertions, 0 deletions