From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Markus Theil <markus.theil@tu-ilmenau.de>
Cc: nbd@nbd.name, linux-wireless@vger.kernel.org,
lorenzo.bianconi@redhat.com
Subject: Re: [PATCH v5 3/5] mt76: mt76x02: remove a copy call for usb speedup
Date: Tue, 19 Nov 2019 15:44:11 +0100 [thread overview]
Message-ID: <20191119144410.GA23939@redhat.com> (raw)
In-Reply-To: <20191119122410.12588-4-markus.theil@tu-ilmenau.de>
On Tue, Nov 19, 2019 at 01:24:08PM +0100, Markus Theil wrote:
> This patch removes a mt76_wr_copy call from the beacon path to hw.
> The skb which is used in this place gets therefore build with txwi
> inside its data. For mt76 usb drivers, this saves one synchronuous
> copy call over usb, which lets the beacon work complete faster.
>
> Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
> ---
> drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c b/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
> index 09013adae854..a9df8f2d41b8 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
> @@ -26,15 +26,15 @@ static int
> mt76x02_write_beacon(struct mt76x02_dev *dev, int offset, struct sk_buff *skb)
> {
> int beacon_len = dev->beacon_ops->slot_size;
> - struct mt76x02_txwi txwi;
> + struct mt76x02_txwi *txwi;
>
> if (WARN_ON_ONCE(beacon_len < skb->len + sizeof(struct mt76x02_txwi)))
> return -ENOSPC;
>
> - mt76x02_mac_write_txwi(dev, &txwi, skb, NULL, NULL, skb->len);
> -
> - mt76_wr_copy(dev, offset, &txwi, sizeof(txwi));
> - offset += sizeof(txwi);
> + mt76_insert_hdr_pad(skb);
> + txwi = (struct mt76x02_txwi *)(skb->data - sizeof(*txwi));
> + mt76x02_mac_write_txwi(dev, txwi, skb, NULL, NULL, skb->len);
> + skb_push(skb, sizeof(*txwi));
This require enough skb headroom for txwi . Mac80211 reserve headroom
for us according to hw->extra_tx_headroom . Currently we ask for extra
space for txwi only for usb in mt76x02_init_device().
So this code should be put under mt76_is_usb() condition or,
what I think is less preferred, reserve extra space also for mmio.
Stanislaw
next prev parent reply other threads:[~2019-11-19 14:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-19 12:24 [PATCH v5 0/5] mt76: channel switch support for USB devices Markus Theil
2019-11-19 12:24 ` [PATCH v5 1/5] mt76: mt76x02: ommit beacon slot clearing Markus Theil
2019-11-19 12:24 ` [PATCH v5 2/5] mt76: mt76x02: split beaconing Markus Theil
2019-11-19 12:24 ` [PATCH v5 3/5] mt76: mt76x02: remove a copy call for usb speedup Markus Theil
2019-11-19 14:44 ` Stanislaw Gruszka [this message]
2019-11-19 12:24 ` [PATCH v5 4/5] mt76: speed up usb bulk copy Markus Theil
2019-11-19 12:24 ` [PATCH v5 5/5] mt76: mt76x02: add channel switch support for usb interfaces Markus Theil
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=20191119144410.GA23939@redhat.com \
--to=sgruszka@redhat.com \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=markus.theil@tu-ilmenau.de \
--cc=nbd@nbd.name \
/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).