Skip to contentSkip to conversation

net: skbuff: don't zero tc members when freeing skb

PATCH In review Florian Westphal 2 participants 2 messages Dec 31, 2014 – Jan 2, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: skbuff: don't zero tc members when freeing skb

Not needed, only four cases:
- kfree_skb (or one of its aliases).
Don't need to zero, memory will be freed.
- kfree_skb_partial and head was stolen: memory will be freed.
- skb_morph: The skb header fields (including tc ones) will be copied over from the 'to-be-morphed' skb right after skb_release_head_state returns.
- skb_segment: Same as before, all the skb header fields are copied over from the original skb right away.

---
 net/core/skbuff.c | 7 -------
 1 file changed, 7 deletions(-)
net/core/skbuff.c +0 -7
index ae13ef6..8e20bfa 100644
@@ -677,13 +677,6 @@ static void skb_release_head_state(struct sk_buff *skb)
 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
 	nf_bridge_put(skb->nf_bridge);
 #endif
-/* XXX: IS this still necessary? - JHS */
-#ifdef CONFIG_NET_SCHED
-	skb->tc_index = 0;
-#ifdef CONFIG_NET_CLS_ACT
-	skb->tc_verd = 0;
-#endif
-#endif
 }
 
 /* Free everything but the sk_buff shell. */
Signature · 1 line
2.0.5
maintainer
#1 lore raw

From: Florian Westphal <[email protected]>
Date: Wed, 31 Dec 2014 13:33:41 +0100

Quoted 11 lines

Not needed, only four cases:
- kfree_skb (or one of its aliases).
Don't need to zero, memory will be freed.
- kfree_skb_partial and head was stolen: memory will be freed.
- skb_morph: The skb header fields (including tc ones) will be copied over from the 'to-be-morphed' skb right after skb_release_head_state returns.
- skb_segment: Same as before, all the skb header fields are copied over from the original skb right away.

Agreed, applied, thanks Florian.