All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] brcmfmac: Decrease 8021x_cnt for dropped packets
@ 2016-04-12 19:17 per.forlin
  0 siblings, 0 replies; 4+ messages in thread
From: per.forlin @ 2016-04-12 19:17 UTC (permalink / raw)
  To: linux-wireless; +Cc: arend, Per Forlin

From: Per Forlin <per.forlin@gmail.com>

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.

Signed-off-by: Per Forlin <per.forlin@gmail.com>
---
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(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
index 67401ca..2c1bc0d 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
@@ -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;
 }
 
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index a14d9d9d..485e2ad 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -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;
-- 
2.1.4


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

* Re: [PATCH v3] brcmfmac: Decrease 8021x_cnt for dropped packets
  2016-04-12 20:48 per.forlin
  2016-04-12 21:14 ` kbuild test robot
@ 2016-04-12 21:28 ` kbuild test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2016-04-12 21:28 UTC (permalink / raw)
  To: per.forlin; +Cc: kbuild-all, linux-wireless, arend, Per Forlin

[-- Attachment #1: Type: text/plain, Size: 2507 bytes --]

Hi Per,

[auto build test ERROR on wireless-drivers-next/master]
[also build test ERROR on v4.6-rc3 next-20160412]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/per-forlin-gmail-com/brcmfmac-Decrease-8021x_cnt-for-dropped-packets/20160413-045216
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: mips-allyesconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=mips 

All errors (new ones prefixed by >>):

   drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c: In function 'brcmf_proto_bcdc_txdata':
>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c:336:41: error: passing argument 3 of 'brcmf_proto_bcdc_hdrpull' from incompatible pointer type [-Werror=incompatible-pointer-types]
      brcmf_proto_bcdc_hdrpull(drvr, false, &ifidx, pktbuf);
                                            ^
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c:277:1: note: expected 'struct sk_buff *' but argument is of type 'int *'
    brcmf_proto_bcdc_hdrpull(struct brcmf_pub *drvr, bool do_fws,
    ^
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c:336:49: error: passing argument 4 of 'brcmf_proto_bcdc_hdrpull' from incompatible pointer type [-Werror=incompatible-pointer-types]
      brcmf_proto_bcdc_hdrpull(drvr, false, &ifidx, pktbuf);
                                                    ^
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c:277:1: note: expected 'struct brcmf_if **' but argument is of type 'struct sk_buff *'
    brcmf_proto_bcdc_hdrpull(struct brcmf_pub *drvr, bool do_fws,
    ^
   cc1: some warnings being treated as errors

vim +/brcmf_proto_bcdc_hdrpull +336 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c

   330				struct sk_buff *pktbuf)
   331	{
   332		int res;
   333		brcmf_proto_bcdc_hdrpush(drvr, ifidx, offset, pktbuf);
   334		res = brcmf_bus_txdata(drvr->bus_if, pktbuf);
   335		if (res < 0)
 > 336			brcmf_proto_bcdc_hdrpull(drvr, false, &ifidx, pktbuf);
   337		return res;
   338	}
   339	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 41422 bytes --]

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

* Re: [PATCH v3] brcmfmac: Decrease 8021x_cnt for dropped packets
  2016-04-12 20:48 per.forlin
@ 2016-04-12 21:14 ` kbuild test robot
  2016-04-12 21:28 ` kbuild test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2016-04-12 21:14 UTC (permalink / raw)
  To: per.forlin; +Cc: kbuild-all, linux-wireless, arend, Per Forlin

[-- Attachment #1: Type: text/plain, Size: 2704 bytes --]

Hi Per,

[auto build test WARNING on wireless-drivers-next/master]
[also build test WARNING on v4.6-rc3 next-20160412]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/per-forlin-gmail-com/brcmfmac-Decrease-8021x_cnt-for-dropped-packets/20160413-045216
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: xtensa-allyesconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All warnings (new ones prefixed by >>):

   drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c: In function 'brcmf_proto_bcdc_txdata':
>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c:336:3: warning: passing argument 3 of 'brcmf_proto_bcdc_hdrpull' from incompatible pointer type
      brcmf_proto_bcdc_hdrpull(drvr, false, &ifidx, pktbuf);
      ^
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c:277:1: note: expected 'struct sk_buff *' but argument is of type 'int *'
    brcmf_proto_bcdc_hdrpull(struct brcmf_pub *drvr, bool do_fws,
    ^
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c:336:3: warning: passing argument 4 of 'brcmf_proto_bcdc_hdrpull' from incompatible pointer type
      brcmf_proto_bcdc_hdrpull(drvr, false, &ifidx, pktbuf);
      ^
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c:277:1: note: expected 'struct brcmf_if **' but argument is of type 'struct sk_buff *'
    brcmf_proto_bcdc_hdrpull(struct brcmf_pub *drvr, bool do_fws,
    ^

vim +/brcmf_proto_bcdc_hdrpull +336 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c

   320	
   321		if (pktbuf->len == 0)
   322			return -ENODATA;
   323	
   324		*ifp = tmp_if;
   325		return 0;
   326	}
   327	
   328	static int
   329	brcmf_proto_bcdc_txdata(struct brcmf_pub *drvr, int ifidx, u8 offset,
   330				struct sk_buff *pktbuf)
   331	{
   332		int res;
   333		brcmf_proto_bcdc_hdrpush(drvr, ifidx, offset, pktbuf);
   334		res = brcmf_bus_txdata(drvr->bus_if, pktbuf);
   335		if (res < 0)
 > 336			brcmf_proto_bcdc_hdrpull(drvr, false, &ifidx, pktbuf);
   337		return res;
   338	}
   339	
   340	static void
   341	brcmf_proto_bcdc_configure_addr_mode(struct brcmf_pub *drvr, int ifidx,
   342					     enum proto_addr_mode addr_mode)
   343	{
   344	}

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 44869 bytes --]

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

* [PATCH v3] brcmfmac: Decrease 8021x_cnt for dropped packets
@ 2016-04-12 20:48 per.forlin
  2016-04-12 21:14 ` kbuild test robot
  2016-04-12 21:28 ` kbuild test robot
  0 siblings, 2 replies; 4+ messages in thread
From: per.forlin @ 2016-04-12 20:48 UTC (permalink / raw)
  To: linux-wireless; +Cc: arend, Per Forlin

From: Per Forlin <per.forlin@gmail.com>

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

Signed-off-by: Per Forlin <per.forlin@gmail.com>
---
Change log:
 v2 - Add variable to know whether the counter is increased or not
 v3 - txfinalize should decrease the counter. Adjust skb header offset

 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 6 +++++-
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
index 6af658e..508b287 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
@@ -329,8 +329,12 @@ static int
 brcmf_proto_bcdc_txdata(struct brcmf_pub *drvr, int ifidx, u8 offset,
 			struct sk_buff *pktbuf)
 {
+	int res;
 	brcmf_proto_bcdc_hdrpush(drvr, ifidx, offset, pktbuf);
-	return brcmf_bus_txdata(drvr->bus_if, pktbuf);
+	res = brcmf_bus_txdata(drvr->bus_if, pktbuf);
+	if (res < 0)
+		brcmf_proto_bcdc_hdrpull(drvr, false, &ifidx, pktbuf);
+	return res;
 }
 
 static void
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index a14d9d9d..485e2ad 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -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;
-- 
2.1.4


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

end of thread, other threads:[~2016-04-13 12:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-12 19:17 [PATCH v3] brcmfmac: Decrease 8021x_cnt for dropped packets per.forlin
2016-04-12 20:48 per.forlin
2016-04-12 21:14 ` kbuild test robot
2016-04-12 21:28 ` kbuild test robot

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.