All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4.9] brcmfmac: use correct skb freeing helper when deleting flowring
@ 2016-09-27  9:14 Rafał Miłecki
  2016-09-27 10:05 ` Arend Van Spriel
  2016-09-27 12:11   ` Rafał Miłecki
  0 siblings, 2 replies; 21+ messages in thread
From: Rafał Miłecki @ 2016-09-27  9:14 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Arend van Spriel, Franky Lin, Hante Meuleman,
	Pieter-Paul Giesberts, Franky Lin, linux-wireless,
	brcm80211-dev-list.pdl, netdev, linux-kernel,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

Flowrings contain skbs waiting for transmission that were passed to us
by netif. It means we checked every one of them looking for 802.1x
Ethernet type. When deleting flowring we have to use freeing function
that will check for 802.1x type as well.

Freeing skbs without a proper check was leading to counter not being
properly decreased. This was triggering a WARNING every time
brcmf_netdev_wait_pend8021x was called.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
Kalle: this isn't important enough for 4.8 as it's too late for that.

I'd like to get it for 4.9 however, as this fixes bug that could lead
to WARNING on every add_key/del_key call. We was struggling with these
WARNINGs for some time and this fixes one of two problems causing them.
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c
index b16b367..d0b738d 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c
@@ -234,13 +234,20 @@ static void brcmf_flowring_block(struct brcmf_flowring *flow, u16 flowid,
 
 void brcmf_flowring_delete(struct brcmf_flowring *flow, u16 flowid)
 {
+	struct brcmf_bus *bus_if = dev_get_drvdata(flow->dev);
 	struct brcmf_flowring_ring *ring;
+	struct brcmf_if *ifp;
 	u16 hash_idx;
+	u8 ifidx;
 	struct sk_buff *skb;
 
 	ring = flow->rings[flowid];
 	if (!ring)
 		return;
+
+	ifidx = brcmf_flowring_ifidx_get(flow, flowid);
+	ifp = brcmf_get_ifp(bus_if->drvr, ifidx);
+
 	brcmf_flowring_block(flow, flowid, false);
 	hash_idx = ring->hash_id;
 	flow->hash[hash_idx].ifidx = BRCMF_FLOWRING_INVALID_IFIDX;
@@ -249,7 +256,7 @@ void brcmf_flowring_delete(struct brcmf_flowring *flow, u16 flowid)
 
 	skb = skb_dequeue(&ring->skblist);
 	while (skb) {
-		brcmu_pkt_buf_free_skb(skb);
+		brcmf_txfinalize(ifp, skb, false);
 		skb = skb_dequeue(&ring->skblist);
 	}
 
-- 
2.9.3

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

end of thread, other threads:[~2016-09-27 15:48 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-27  9:14 [PATCH 4.9] brcmfmac: use correct skb freeing helper when deleting flowring Rafał Miłecki
2016-09-27 10:05 ` Arend Van Spriel
2016-09-27 11:27   ` Kalle Valo
2016-09-27 11:27     ` Kalle Valo
2016-09-27 11:33     ` Arend Van Spriel
2016-09-27 11:44     ` Rafał Miłecki
2016-09-27 11:44       ` Rafał Miłecki
2016-09-27 11:58       ` Rafał Miłecki
2016-09-27 11:58         ` Rafał Miłecki
2016-09-27 11:58         ` Rafał Miłecki
2016-09-27 12:04         ` Arend Van Spriel
2016-09-27 12:04           ` Arend Van Spriel
2016-09-27 12:07           ` Rafał Miłecki
2016-09-27 12:07             ` Rafał Miłecki
2016-09-27 12:07             ` Rafał Miłecki
2016-09-27 12:08         ` Kalle Valo
2016-09-27 12:08           ` Kalle Valo
2016-09-27 12:08           ` Kalle Valo
2016-09-27 12:11 ` [PATCH V2 " Rafał Miłecki
2016-09-27 12:11   ` Rafał Miłecki
2016-09-27 15:48   ` [V2, " Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.