Skip to contentSkip to conversation

brcmfmac: Decrease 8021x_cnt for dropped packets

PATCH New [email protected] 1 participant 1 message Apr 13, 2016 Broadcom BRCM80211 IEEE802.11 wireless drivers

v3 of 4 New Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 brcmfmac: Decrease 8021x_cnt for dropped packets

From: Per Forlin <[email protected]>

This patch resolves an issue where pend_8021x_cnt was not decreased on txfinalize. This caused brcmf_netdev_wait_pend8021x to timeout because the counter indicated pending packets.

WARNING: at .../brcmfmac/core.c:1289 brcmf_netdev_wait_pend8021x
  (warn_slowpath_common)
  (warn_slowpath_null)
  (brcmf_netdev_wait_pend8021x [brcmfmac])
  (send_key_to_dongle [brcmfmac])
  (brcmf_cfg80211_del_key [brcmfmac])
  (nl80211_del_key [cfg80211])
  (genl_rcv_msg)
  (netlink_rcv_skb)
  (genl_rcv)
  (netlink_unicast)
  (netlink_sendmsg)
  (sock_sendmsg)
  (___sys_sendmsg)
  (__sys_sendmsg)
  (SyS_sendmsg)

The solution is to pull back the header offset in case of an error in txdata(), which may happen in case of packet overload in brcmf_sdio_bus_txdata.

Overloading a WLAN interface is not an unlikely scenario. In case of packet overload the error print "out of bus->txq" is very verbose. To reduce SPAM degrade it to a debug print.

---
Change log:
v2 - Add variable to know whether the counter is increased or not v3 - txfinalize should decrease the counter. Fix skb header offset

drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 5 +++--

 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c +3 -2
index 67401ca..2c1bc0d 100644
@@ -332,8 +332,9 @@ brcmf_proto_bcdc_txdata(struct brcmf_pub *drvr, int ifidx, u8 offset,
 	int res;
 	brcmf_proto_bcdc_hdrpush(drvr, ifidx, offset, pktbuf);
 	res = brcmf_bus_txdata(drvr->bus_if, pktbuf);
-	if (res < 0)
-		brcmf_proto_bcdc_hdrpull(drvr, ifidx, offset, pktbuf);
+	if (res < 0) {
+		brcmf_proto_bcdc_hdrpull(drvr, false, &ifidx, pktbuf);
+	}
 	return res;
 }
 
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +1 -1
index a14d9d9d..485e2ad 100644
@@ -2721,7 +2721,7 @@ static int brcmf_sdio_bus_txdata(struct device *dev, struct sk_buff *pkt)
 	*(u16 *)(pkt->cb) = 0;
 	if (!brcmf_sdio_prec_enq(&bus->txq, pkt, prec)) {
 		skb_pull(pkt, bus->tx_hdrlen);
-		brcmf_err("out of bus->txq !!!\n");
+		brcmf_dbg(INFO, "out of bus->txq !!!\n");
 		ret = -ENOSR;
 	} else {
 		ret = 0;
Signature · 1 line
2.1.4