From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
Alan Stern <stern@rowland.harvard.edu>,
Felix Fietkau <nbd@nbd.name>,
Doug Anderson <dianders@chromium.org>,
Minas Harutyunyan <hminas@synopsys.com>,
USB list <linux-usb@vger.kernel.org>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+
Date: Mon, 18 Feb 2019 15:25:28 +0100 [thread overview]
Message-ID: <20190218142527.GA9283@localhost.localdomain> (raw)
In-Reply-To: <20190218135247.GA9602@redhat.com>
> commit 0d9813319b40399a0d8fd761d2fcfedee5701487
> Author: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
> Date: Fri Sep 7 23:13:12 2018 +0200
[...]
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
> index 062614ad0d51..08425b1d2c30 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
> @@ -550,21 +550,33 @@ void mt76x02_sta_rate_tbl_update(struct ieee80211_hw *hw,
> }
> EXPORT_SYMBOL_GPL(mt76x02_sta_rate_tbl_update);
>
> -int mt76x02_insert_hdr_pad(struct sk_buff *skb)
> +void mt76x02_align_skb(struct sk_buff *skb)
> {
> - int len = ieee80211_get_hdrlen_from_skb(skb);
> + int align = ((unsigned long) skb->data) & 3;
> + int hdrlen, skblen;
>
> - if (len % 4 == 0)
> - return 0;
> + hdrlen = ieee80211_get_hdrlen_from_skb(skb);
> + WARN_ON_ONCE(align == 0 && (hdrlen & 3));
> +
> + if (align == 0)
> + return;
Hi Stanislaw,
is it possible that skb->data is 4 byte aligned but hdrlen is not? (e.g 4addr
data frames, not qos)?
>
> - skb_push(skb, 2);
> - memmove(skb->data, skb->data + 2, len);
> + if (hdrlen & 3) {
> + /* Align frame and add 2 bytes pad after header. */
> + skb_push(skb, 2);
> + memmove(skb->data, skb->data + 2, hdrlen);
>
> - skb->data[len] = 0;
> - skb->data[len + 1] = 0;
> - return 2;
> + skb->data[hdrlen] = 0;
> + skb->data[hdrlen + 1] = 0;
> + } else {
> + /* Only for probe request frames. */
are you sure this is true *only* for probe requests?
this could hit performances and it is used even in pci code
Regards,
Lorenzo
> + skblen = skb->len;
> + skb_push(skb, 2);
> + memmove(skb->data, skb->data + 2, skblen);
> + skb_trim(skb, skblen);
> + }
> }
> -EXPORT_SYMBOL_GPL(mt76x02_insert_hdr_pad);
> +EXPORT_SYMBOL_GPL(mt76x02_align_skb);
>
> void mt76x02_remove_hdr_pad(struct sk_buff *skb, int len)
> {
> --
> 2.7.5
>
next prev parent reply other threads:[~2019-02-18 14:25 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190211173315.GE6292@redhat.com>
[not found] ` <Pine.LNX.4.44L0.1902111246410.1543-100000@iolanthe.rowland.org>
2019-02-12 0:06 ` [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+ Lorenzo Bianconi
2019-02-12 9:30 ` Stanislaw Gruszka
2019-02-12 11:58 ` Lorenzo Bianconi
2019-02-12 13:15 ` Stanislaw Gruszka
2019-02-14 6:49 ` Stefan Wahren
2019-02-14 9:25 ` Stanislaw Gruszka
2019-02-14 9:48 ` Stefan Wahren
2019-02-14 9:54 ` Stanislaw Gruszka
2019-02-15 7:12 ` Stanislaw Gruszka
2019-02-16 11:05 ` Stefan Wahren
2019-02-16 14:07 ` Stanislaw Gruszka
2019-02-16 19:17 ` Stefan Wahren
2019-02-18 13:52 ` Stanislaw Gruszka
2019-02-18 14:25 ` Lorenzo Bianconi [this message]
2019-02-18 14:47 ` Stanislaw Gruszka
2019-02-18 14:43 ` Felix Fietkau
2019-02-18 15:03 ` Stanislaw Gruszka
2019-02-18 18:52 ` Felix Fietkau
2019-02-19 10:42 ` Stanislaw Gruszka
2019-02-19 12:19 ` Felix Fietkau
2019-02-20 13:00 ` Stanislaw Gruszka
2019-02-20 13:22 ` Lorenzo Bianconi
2019-02-20 16:14 ` Stanislaw Gruszka
2019-02-20 16:22 ` Lorenzo Bianconi
2019-02-20 16:32 ` Stanislaw Gruszka
2019-02-20 16:36 ` Lorenzo Bianconi
2019-03-03 21:16 ` Stefan Wahren
2019-02-18 22:19 ` Stefan Wahren
2019-02-19 10:59 ` Stanislaw Gruszka
2019-02-19 12:11 ` Felix Fietkau
2019-02-19 15:40 ` Alan Stern
2019-02-20 10:20 ` Stanislaw Gruszka
2019-02-20 15:25 ` Alan Stern
2019-02-19 17:02 ` Stefan Wahren
2019-02-12 15:27 ` Alan Stern
2019-02-09 12:08 Stefan Wahren
2019-02-09 18:46 ` Lorenzo Bianconi
2019-02-09 20:29 ` Stefan Wahren
2019-02-09 20:33 ` Lorenzo Bianconi
2019-02-09 22:47 ` Stefan Wahren
2019-02-10 9:41 ` Stanislaw Gruszka
2019-02-10 10:22 ` Lorenzo Bianconi
2019-02-11 7:44 ` Stanislaw Gruszka
2019-02-11 10:04 ` Lorenzo Bianconi
2019-02-11 10:33 ` Stefan Wahren
2019-02-11 11:06 ` Lorenzo Bianconi
2019-02-11 14:04 ` Stefan Wahren
2019-02-11 15:10 ` Lorenzo Bianconi
2019-02-11 15:27 ` Stefan Wahren
2019-02-11 15:57 ` Lorenzo Bianconi
2019-02-13 7:05 ` Stefan Wahren
2019-02-11 17:22 ` Stanislaw Gruszka
2019-02-10 9:29 ` Stanislaw Gruszka
2019-02-10 16:38 ` Stefan Wahren
2019-02-10 16:52 ` Lorenzo Bianconi
2019-02-10 17:39 ` Lorenzo Bianconi
2019-02-11 7:50 ` Stanislaw Gruszka
2019-02-11 8:08 ` Stefan Wahren
2019-02-11 9:52 ` Lorenzo Bianconi
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=20190218142527.GA9283@localhost.localdomain \
--to=lorenzo.bianconi@redhat.com \
--cc=dianders@chromium.org \
--cc=hminas@synopsys.com \
--cc=linux-usb@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=sgruszka@redhat.com \
--cc=stefan.wahren@i2se.com \
--cc=stern@rowland.harvard.edu \
/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).