Thread (11 messages) flat view 11 messages, 4 authors, 2017-09-20

RE: [EXT] Re: [PATCH 2/2] mwifiex: print URB submit failure error after threshold attemtps

From: Ganapathi Bhat <hidden>
Date: 2017-09-15 09:46:39

Hi Brian,
Hi Ganapathi,

On Thu, Sep 14, 2017 at 02:14:24PM +0000, Ganapathi Bhat wrote:
quoted
quoted
On Thu, 2017-08-31 at 01:21 +0530, Ganapathi Bhat wrote:
quoted
Current driver prints dev_alloc_skb failures everytime while
submitting RX URBs. This failure might be frequent in some low
resource platforms. So, wait for a threshold failure count before
start priting the error. This change is a follow up for the
'commit
7b368e3d15c3
("mwifiex: resubmit failed to submit RX URBs in main thread")'
[]
quoted
diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c
b/drivers/net/wireless/marvell/mwifiex/usb.c
[]
quoted
@@ -300,9 +300,16 @@ static int mwifiex_usb_submit_rx_urb(struct
urb_context *ctx, int size)
quoted
 	if (card->rx_cmd_ep != ctx->ep) {
 		ctx->skb = dev_alloc_skb(size);
 		if (!ctx->skb) {
-			mwifiex_dbg(adapter, ERROR,
-				    "%s: dev_alloc_skb failed\n",
__func__);
quoted
quoted
quoted
+			if (++card->rx_urb_failure_count >
+			    MWIFIEX_RX_URB_FAILURE_THRESHOLD) {
+				mwifiex_dbg(adapter, ERROR,
+					    "%s: dev_alloc_skb failed,
failure
quoted
quoted
count = %u\n",
quoted
+					    __func__,
+					    card->rx_urb_failure_count);
+			}
 			return -ENOMEM;
Why not use a ratelimit?
Since this is for receive, the packets are from AP side and we cannot
lower the rate from AP. On some low performance systems this change
will be helpful.
I think Joe was referring to things like printk_ratelimited() or
dev_err_ratelimited(). Those automatically ratelimit prints for you,
using a static counter. You'd just need to make a small warpper for
mwifiex_dbg() using __ratelimit().
Got it. Yet it looks he meant the same. Thank you.
Those sort of rate limits are significantly different than yours
though.
You were looking to avoid printing errors when there are only a few
failures in a row, whereas the existing rate-limiting infrastructure
looks to avoid printing errors if too many happen in a row. Those are
different goals.

Brian
Ok.

Hi Joe,

Let us know your comments on the above.

Thanks,
Ganapathi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help