Message ID | 20241022162359.2713094-8-ap420073@gmail.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | bnxt_en: implement device memory TCP for bnxt | expand |
On Tue, Oct 22, 2024 at 9:25 AM Taehee Yoo <ap420073@gmail.com> wrote: > > The netmem_is_pfmemalloc() is a netmem version of page_is_pfmemalloc(). > > Tested-by: Stanislav Fomichev <sdf@fomichev.me> > Suggested-by: Mina Almasry <almasrymina@google.com> > Signed-off-by: Taehee Yoo <ap420073@gmail.com> Reviewed-by: Mina Almasry <almasrymina@google.com>
diff --git a/include/net/netmem.h b/include/net/netmem.h index 8a6e20be4b9d..49ae2bf05362 100644 --- a/include/net/netmem.h +++ b/include/net/netmem.h @@ -171,4 +171,12 @@ static inline unsigned long netmem_get_dma_addr(netmem_ref netmem) return __netmem_clear_lsb(netmem)->dma_addr; } +static inline bool netmem_is_pfmemalloc(netmem_ref netmem) +{ + if (netmem_is_net_iov(netmem)) + return false; + + return page_is_pfmemalloc(netmem_to_page(netmem)); +} + #endif /* _NET_NETMEM_H */