linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] brcmfmac: clear skb head state on xmit
@ 2017-02-07 16:50 Paolo Abeni
  2017-02-07 19:23 ` Arend Van Spriel
  0 siblings, 1 reply; 8+ messages in thread
From: Paolo Abeni @ 2017-02-07 16:50 UTC (permalink / raw)
  To: Kalle Valo
  Cc: linux-wireless, brcm80211-dev-list.pdl, Arend van Spriel,
	Franky Lin, hante Meuleman

the skbs can be held by the driver for a long time, so we need
to clear any state on xmit to avoid hanging other subsystems.
The skbs are already orphaned later in cmsg code, so we just
need to clear the nf/dst/secpath.
Do it early, while the relevant entries are hopefully still
hot in the cache.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
index 9e6f60a..5a8d57b 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
@@ -22,6 +22,7 @@
 #include <net/rtnetlink.h>
 #include <net/addrconf.h>
 #include <net/ipv6.h>
+#include <net/xfrm.h>
 #include <brcmu_utils.h>
 #include <brcmu_wifi.h>
 
@@ -243,6 +244,13 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
 	if ((skb->priority == 0) || (skb->priority > 7))
 		skb->priority = cfg80211_classify8021d(skb, NULL);
 
+	/* we can keep the skb for a long time; avoid starving other
+	 * subsystems
+	 */
+	nf_reset(skb);
+	skb_dst_drop(skb);
+	secpath_reset(skb);
+
 	ret = brcmf_proto_tx_queue_data(drvr, ifp->ifidx, skb);
 	if (ret < 0)
 		brcmf_txfinalize(ifp, skb, false);
-- 
2.9.3

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

end of thread, other threads:[~2017-02-08 11:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-07 16:50 [PATCH net] brcmfmac: clear skb head state on xmit Paolo Abeni
2017-02-07 19:23 ` Arend Van Spriel
2017-02-08  8:38   ` Paolo Abeni
2017-02-08  8:52     ` Rafał Miłecki
2017-02-08  9:29       ` Paolo Abeni
2017-02-08 10:43         ` Arend Van Spriel
2017-02-08 10:27     ` Kalle Valo
2017-02-08 10:34       ` Paolo Abeni

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