diff options
| author | Mina Almasry <almasrymina@google.com> | 2026-10-21 01:55:58 +0000 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-10-21 17:00:00 -0700 |
| commit | 2620efb2cec11628ff419dc876981e1f8fed664a (patch) | |
| tree | b3b82845ccea2c23e563a113013609d283c20bba /include | |
| parent | bbee99902520f214cafe183f30b9db29ab9b315f (diff) | |
netmem: rename get/put_netmem() to netmem_inc/dec_ref()
Follow the object_action() naming convention for netmem non-page_pool
reference helpers by renaming get_netmem() and put_netmem() to
netmem_inc_ref() and netmem_dec_ref().
Use netmem_inc_ref() and netmem_dec_ref() rather than netmem_ref() and
netmem_unref() because netmem_ref is already a typedef (typedef unsigned
long __bitwise netmem_ref).
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Mina Almasry <almasrymina@google.com>
Link: https://patch.msgid.link/20261021015558.4124825-3-almasrymina@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/skbuff_ref.h | 8 | ||||
| -rw-r--r-- | include/net/netmem.h | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/include/linux/skbuff_ref.h b/include/linux/skbuff_ref.h index f768a3fa1d60..b6f6da556ee9 100644 --- a/include/linux/skbuff_ref.h +++ b/include/linux/skbuff_ref.h @@ -18,7 +18,7 @@ bool napi_pp_get_page(netmem_ref netmem); * * Acquires pp_ref_count via napi_pp_get_page() if @recycle is true and * @netmem belongs to a page_pool; otherwise acquires a non-pp backing - * reference via get_netmem(). Counterpart to skb_netmem_unref(). + * reference via netmem_inc_ref(). Counterpart to skb_netmem_unref(). */ static __always_inline void skb_netmem_ref(netmem_ref netmem, bool recycle) { @@ -26,7 +26,7 @@ static __always_inline void skb_netmem_ref(netmem_ref netmem, bool recycle) if (recycle && napi_pp_get_page(netmem)) return; #endif - get_netmem(netmem); + netmem_inc_ref(netmem); } /** @@ -53,7 +53,7 @@ bool napi_pp_put_page(netmem_ref netmem); * * Drops pp_ref_count via napi_pp_put_page() if @recycle is true and @netmem * belongs to a page_pool; otherwise drops a non-pp backing reference via - * put_netmem(). Counterpart to skb_netmem_ref(). + * netmem_dec_ref(). Counterpart to skb_netmem_ref(). */ static __always_inline void skb_netmem_unref(netmem_ref netmem, bool recycle) { @@ -61,7 +61,7 @@ static __always_inline void skb_netmem_unref(netmem_ref netmem, bool recycle) if (recycle && napi_pp_put_page(netmem)) return; #endif - put_netmem(netmem); + netmem_dec_ref(netmem); } /** diff --git a/include/net/netmem.h b/include/net/netmem.h index 7f36c734edcd..fb693bc1702a 100644 --- a/include/net/netmem.h +++ b/include/net/netmem.h @@ -413,14 +413,14 @@ void net_iov_inc_ref(struct net_iov *niov); void net_iov_dec_ref(struct net_iov *niov); /** - * get_netmem - acquire a non-page_pool reference on a netmem + * netmem_inc_ref - acquire a non-page_pool reference on a netmem * @netmem: netmem to reference * * Acquires a non-pp backing reference (page._refcount via get_page() or * binding->ref via net_iov_inc_ref()) regardless of page_pool membership. - * Counterpart to put_netmem(). + * Counterpart to netmem_dec_ref(). */ -static __always_inline void get_netmem(netmem_ref netmem) +static __always_inline void netmem_inc_ref(netmem_ref netmem) { if (netmem_is_net_iov(netmem)) net_iov_inc_ref(netmem_to_net_iov(netmem)); @@ -429,14 +429,14 @@ static __always_inline void get_netmem(netmem_ref netmem) } /** - * put_netmem - release a non-page_pool reference on a netmem + * netmem_dec_ref - release a non-page_pool reference on a netmem * @netmem: netmem to unreference * * Drops a non-pp backing reference (page._refcount via put_page() or * binding->ref via net_iov_dec_ref()) regardless of page_pool membership. - * Counterpart to get_netmem(). + * Counterpart to netmem_inc_ref(). */ -static __always_inline void put_netmem(netmem_ref netmem) +static __always_inline void netmem_dec_ref(netmem_ref netmem) { if (netmem_is_net_iov(netmem)) net_iov_dec_ref(netmem_to_net_iov(netmem)); |
