linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Ganapathi Bhat <gbhat@marvell.com>
Cc: Joe Perches <joe@perches.com>, Cathy Luo <cluo@marvell.com>,
	Xinming Hu <huxm@marvell.com>, Zhiyuan Yang <yangzy@marvell.com>,
	James Cao <jcao@marvell.com>,
	Mangesh Malusare <mmangesh@marvell.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [EXT] Re: [PATCH 2/2] mwifiex: print URB submit failure error after threshold attemtps
Date: Thu, 14 Sep 2017 14:59:57 -0700	[thread overview]
Message-ID: <20170914215955.GA42289@google.com> (raw)
In-Reply-To: <6dfc9cfaff734c12bc53ffcb063c4491@SC-EXCH02.marvell.com>

Hi Ganapathi,

On Thu, Sep 14, 2017 at 02:14:24PM +0000, Ganapathi Bhat wrote:
> > On Thu, 2017-08-31 at 01:21 +0530, Ganapathi Bhat wrote:
> > > 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")'
> > 
> > []
> > 
> > > diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c
> > > b/drivers/net/wireless/marvell/mwifiex/usb.c
> > []
> > > @@ -300,9 +300,16 @@ static int mwifiex_usb_submit_rx_urb(struct
> > urb_context *ctx, int size)
> > >  	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__);
> > > +			if (++card->rx_urb_failure_count >
> > > +			    MWIFIEX_RX_URB_FAILURE_THRESHOLD) {
> > > +				mwifiex_dbg(adapter, ERROR,
> > > +					    "%s: dev_alloc_skb failed, failure
> > count = %u\n",
> > > +					    __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().

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

  reply	other threads:[~2017-09-14 22:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 19:51 [PATCH 0/2] mwifiex: address URB submission failure Ganapathi Bhat
2017-08-30 19:51 ` [PATCH 1/2] mwifiex: resubmit failed to submit RX URBs in main thread Ganapathi Bhat
2017-09-20 12:13   ` Kalle Valo
2017-08-30 19:51 ` [PATCH 2/2] mwifiex: print URB submit failure error after threshold attemtps Ganapathi Bhat
2017-09-01  4:05   ` Joe Perches
2017-09-14 14:14     ` [EXT] " Ganapathi Bhat
2017-09-14 21:59       ` Brian Norris [this message]
2017-09-15  9:46         ` Ganapathi Bhat
2017-09-20  4:30         ` Kalle Valo
2017-09-20  6:02           ` Brian Norris
2017-09-20 12:09             ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170914215955.GA42289@google.com \
    --to=briannorris@chromium.org \
    --cc=cluo@marvell.com \
    --cc=gbhat@marvell.com \
    --cc=huxm@marvell.com \
    --cc=jcao@marvell.com \
    --cc=joe@perches.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mmangesh@marvell.com \
    --cc=yangzy@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).