Commit 574f7194 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by David S. Miller
Browse files

net: Add a test to see if a skb is freeable in irq context

Currently netpoll and skb_release_head_state assume that a skb is
freeable in hard irq context except when skb->destructor is set.

The reality is far from this.  So add a function skb_irq_freeable to
compute the full test and in the process be the living documentation
of what the requirements are of actually freeing a skb in hard irq
Signed-off-by: default avatar"Eric W. Biederman" <>
Acked-by: default avatarEric Dumazet <>
Signed-off-by: default avatarDavid S. Miller <>
parent f91ca783
......@@ -2831,6 +2831,19 @@ static inline void skb_init_secmark(struct sk_buff *skb)
{ }
static inline bool skb_irq_freeable(const struct sk_buff *skb)
return !skb->destructor &&
!skb->sp &&
!skb->nfct &&
!skb->_skb_refdst &&
static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping)
skb->queue_mapping = queue_mapping;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment