netmem_priv.h 727 B

12345678910111213141516171819202122232425262728293031
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __NETMEM_PRIV_H
  3. #define __NETMEM_PRIV_H
  4. static inline unsigned long netmem_get_pp_magic(netmem_ref netmem)
  5. {
  6. return __netmem_clear_lsb(netmem)->pp_magic;
  7. }
  8. static inline void netmem_or_pp_magic(netmem_ref netmem, unsigned long pp_magic)
  9. {
  10. __netmem_clear_lsb(netmem)->pp_magic |= pp_magic;
  11. }
  12. static inline void netmem_clear_pp_magic(netmem_ref netmem)
  13. {
  14. __netmem_clear_lsb(netmem)->pp_magic = 0;
  15. }
  16. static inline void netmem_set_pp(netmem_ref netmem, struct page_pool *pool)
  17. {
  18. __netmem_clear_lsb(netmem)->pp = pool;
  19. }
  20. static inline void netmem_set_dma_addr(netmem_ref netmem,
  21. unsigned long dma_addr)
  22. {
  23. __netmem_clear_lsb(netmem)->dma_addr = dma_addr;
  24. }
  25. #endif