netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* skb_attempt_defer_free and reference counting
@ 2025-10-31 11:04 Hudson, Nick
  2025-10-31 11:43 ` Eric Dumazet
  0 siblings, 1 reply; 6+ messages in thread
From: Hudson, Nick @ 2025-10-31 11:04 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 662 bytes --]

Hi,

I’ve been looking at using skb_attempt_defer_free and had a question about the skb reference counting.

The existing reference release for any skb handed to skb_attempt_defer_free is done in skb_defer_free_flush (via napi_consume_skb). However, it seems to me that calling skb_attempt_defer_free on the same skb to drop the multiple references is problematic as, if the defer_list isn’t serviced between the calls, the list gets corrupted. That is, the skb can’t appear on the list twice.

Would it be possible to move the reference count drop into skb_attempt_defer_free and only add the skb to the list on last reference drop?

Thanks,
Nick

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 3067 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-11-04 15:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-31 11:04 skb_attempt_defer_free and reference counting Hudson, Nick
2025-10-31 11:43 ` Eric Dumazet
2025-10-31 14:02   ` Hudson, Nick
2025-11-04 12:44     ` Other use cases for skb_attempt_defer_free [was Re: skb_attempt_defer_free and reference counting] Hudson, Nick
2025-11-04 14:43   ` skb_attempt_defer_free and reference counting Sabrina Dubroca
2025-11-04 15:04     ` Eric Dumazet

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).