Linux wireless drivers development
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: Stanislaw Gruszka <sgruszka@redhat.com>, linux-wireless@vger.kernel.org
Cc: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Subject: Re: [PATCH] mt76: usb: use EP max packet aligned buffer sizes for rx
Date: Tue, 30 Apr 2019 09:59:32 +0200	[thread overview]
Message-ID: <634fa790-0cb4-ae68-894a-d778eacf78d2@nbd.name> (raw)
In-Reply-To: <20190430074219.8495-1-sgruszka@redhat.com>

On 2019-04-30 09:42, Stanislaw Gruszka wrote:
> If buffer size is not usb_endpoint_maxp (512 or 1024 bytes) multiple,
> usb host driver has to use bounce buffer and copy data. For RX we can
> avoid that since we alreay allocate q->buf_size (2kB) buffers and
> mt76usb hardware will not fill more data as rx packet size is limited
> by network protocol. However add error message if this assumption
> somehow will be not true.
> 
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
>  drivers/net/wireless/mediatek/mt76/usb.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c
> index c299c6591072..025e072cff28 100644
> --- a/drivers/net/wireless/mediatek/mt76/usb.c
> +++ b/drivers/net/wireless/mediatek/mt76/usb.c
> @@ -447,8 +446,10 @@ mt76u_process_rx_entry(struct mt76_dev *dev, struct urb *urb)
>  		return 0;
>  
>  	data_len = min_t(int, len, data_len - MT_DMA_HDR_LEN);
> -	if (MT_DMA_HDR_LEN + data_len > SKB_WITH_OVERHEAD(q->buf_size))
> +	if (MT_DMA_HDR_LEN + data_len > SKB_WITH_OVERHEAD(q->buf_size)) {
> +		dev_err(dev->dev, "rx data too big %d\n", data_len);
Please use WARN_ON_ONCE here, or at least dev_err_ratelimited if you
think it's necessary to print data_len.

- Felix

      reply	other threads:[~2019-04-30  7:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30  7:42 [PATCH] mt76: usb: use EP max packet aligned buffer sizes for rx Stanislaw Gruszka
2019-04-30  7:59 ` Felix Fietkau [this message]

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=634fa790-0cb4-ae68-894a-d778eacf78d2@nbd.name \
    --to=nbd@nbd.name \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=sgruszka@redhat.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