From: Jakub Kicinski <kuba@kernel.org>
To: Stanislav Fomichev <sdf@fomichev.me>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, ayush.sawal@chelsio.com,
andrew+netdev@lunn.ch, gregkh@linuxfoundation.org,
horms@kernel.org, dsahern@kernel.org, pablo@netfilter.org,
kadlec@netfilter.org, steffen.klassert@secunet.com, mhal@rbox.co,
abhishektamboli9@gmail.com, linux-kernel@vger.kernel.org,
linux-staging@lists.linux.dev, netfilter-devel@vger.kernel.org,
coreteam@netfilter.org, herbert@gondor.apana.org.au
Subject: Re: [PATCH net-next 1/7] net: Add skb_dst_reset and skb_dst_restore
Date: Wed, 13 Aug 2025 17:57:40 -0700 [thread overview]
Message-ID: <20250813175740.4c24e747@kernel.org> (raw)
In-Reply-To: <20250812155245.507012-2-sdf@fomichev.me>
On Tue, 12 Aug 2025 08:52:39 -0700 Stanislav Fomichev wrote:
> +/**
> + * skb_dst_reset() - return current dst_entry value and clear it
> + * @skb: buffer
> + *
> + * Resets skb dst_entry without adjusting its reference count. Useful in
> + * cases where dst_entry needs to be temporarily reset and restored.
> + * Note that the returned value cannot be used directly because it
> + * might contain SKB_DST_NOREF bit.
> + *
> + * When in doubt, prefer skb_dst_drop() over skb_dst_reset() to correctly
> + * handle dst_entry reference counting.
thoughts on prefixing these two new helpers with __ to hint that
they are low level and best avoided?
> + *
> + * Returns: original skb dst_entry.
> + */
> +static inline unsigned long skb_dst_reset(struct sk_buff *skb)
> +{
> + unsigned long refdst = skb->_skb_refdst;
> +
> + skb->_skb_refdst = 0;
> + return refdst;
> +}
> +
> +/**
> + * skb_dst_restore() - restore skb dst_entry saved via skb_dst_reset
saved -> removed ?
Also I think for better kdoc linking it's good to add () after function
names
> + * @skb: buffer
kdoc missing for refdst
> + */
> +static inline void skb_dst_restore(struct sk_buff *skb, unsigned long refdst)
> +{
> + skb->_skb_refdst = refdst;
next prev parent reply other threads:[~2025-08-14 0:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-12 15:52 [PATCH net-next 0/7] net: Convert to skb_dst_reset and skb_dst_restore Stanislav Fomichev
2025-08-12 15:52 ` [PATCH net-next 1/7] net: Add " Stanislav Fomichev
2025-08-14 0:57 ` Jakub Kicinski [this message]
2025-08-14 1:03 ` Jakub Kicinski
2025-08-14 15:45 ` Stanislav Fomichev
2025-08-12 15:52 ` [PATCH net-next 2/7] xfrm: Switch to skb_dst_reset to clear dst_entry Stanislav Fomichev
2025-08-12 15:52 ` [PATCH net-next 3/7] netfilter: " Stanislav Fomichev
2025-08-13 6:43 ` Florian Westphal
2025-08-12 15:52 ` [PATCH net-next 4/7] net: Switch to skb_dst_reset/skb_dst_restore for ip_route_input callers Stanislav Fomichev
2025-08-12 15:52 ` [PATCH net-next 5/7] staging: octeon: Convert to skb_dst_drop Stanislav Fomichev
2025-08-13 14:20 ` Greg KH
2025-08-12 15:52 ` [PATCH net-next 6/7] chtls: Convert to skb_dst_reset Stanislav Fomichev
2025-08-12 15:52 ` [PATCH net-next 7/7] net: Add skb_dst_check_unset Stanislav Fomichev
2025-08-13 7:57 ` [syzbot ci] Re: net: Convert to skb_dst_reset and skb_dst_restore syzbot ci
2025-08-13 10:01 ` Florian Westphal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250813175740.4c24e747@kernel.org \
--to=kuba@kernel.org \
--cc=abhishektamboli9@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=ayush.sawal@chelsio.com \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=kadlec@netfilter.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mhal@rbox.co \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=sdf@fomichev.me \
--cc=steffen.klassert@secunet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).