Skip to contentSkip to conversation

mac80211: fix the skb cloned check in the tx path

PATCH In review Felix Fietkau 2 participants 2 messages Feb 7, 2011 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: fix the skb cloned check in the tx path

Using skb_header_cloned to check if it's safe to write to the skb is not enough - mac80211 also touches the tailroom of the skb. Initially this check was only used to increase a counter, however this commit changed the code to also skip skb data reallocation if no extra head/tailroom was needed:

commit 4cd06a344db752f513437138953af191cbe9a691
mac80211: skip unnecessary pskb_expand_head calls

It added a regression at least with iwl3945, which is fixed by this patch.

---
 net/mac80211/tx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/mac80211/tx.c +1 -1
index 2915168..fc1d728 100644
@@ -1549,7 +1549,7 @@ static int ieee80211_skb_resize(struct ieee80211_local *local,
 		skb_orphan(skb);
 	}
 
-	if (skb_header_cloned(skb))
+	if (skb_cloned(skb))
 		I802_DEBUG_INC(local->tx_expand_skb_head_cloned);
 	else if (head_need || tail_need)
 		I802_DEBUG_INC(local->tx_expand_skb_head);
Signature · 1 line
1.7.3.2
Tested-by on v1 1/1
#1 lore raw
Quoted 6 lines · Felix Fietkau

Using skb_header_cloned to check if it's safe to write to the skb is not enough - mac80211 also touches the tailroom of the skb. Initially this check was only used to increase a counter, however this commit changed the code to also skip skb data reallocation if no extra head/tailroom was needed:

Quoted 6 lines

commit 4cd06a344db752f513437138953af191cbe9a691
mac80211: skip unnecessary pskb_expand_head calls

It added a regression at least with iwl3945, which is fixed by this patch.

Make it

as well since it cures my issue with sshfs getting stuck under load.

Would be nice if the patch made it in .38.

Thanks!

Quoted 21 lines
---
 net/mac80211/tx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/mac80211/tx.c +1 -1
index 2915168..fc1d728 100644
@@ -1549,7 +1549,7 @@ static int ieee80211_skb_resize(struct ieee80211_local *local,
 		skb_orphan(skb);
 	}
 
-	if (skb_header_cloned(skb))
+	if (skb_cloned(skb))
 		I802_DEBUG_INC(local->tx_expand_skb_head_cloned);
 	else if (head_need || tail_need)
 		I802_DEBUG_INC(local->tx_expand_skb_head);
Signature · 1 line
1.7.3.2
Signature · 1 line
Dmitry