From patchwork Tue Nov 19 12:24:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Theil X-Patchwork-Id: 11251857 X-Patchwork-Delegate: nbd@nbd.name Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D98EA14E5 for ; Tue, 19 Nov 2019 12:24:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9E8E2186D for ; Tue, 19 Nov 2019 12:24:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728118AbfKSMYe (ORCPT ); Tue, 19 Nov 2019 07:24:34 -0500 Received: from smail.rz.tu-ilmenau.de ([141.24.186.67]:42599 "EHLO smail.rz.tu-ilmenau.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728028AbfKSMYU (ORCPT ); Tue, 19 Nov 2019 07:24:20 -0500 Received: from localhost.localdomain (unknown [141.24.207.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id D702158007F; Tue, 19 Nov 2019 13:24:18 +0100 (CET) From: Markus Theil To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com, Stanislaw Gruszka , Markus Theil Subject: [PATCH v5 3/5] mt76: mt76x02: remove a copy call for usb speedup Date: Tue, 19 Nov 2019 13:24:08 +0100 Message-Id: <20191119122410.12588-4-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191119122410.12588-1-markus.theil@tu-ilmenau.de> References: <20191119122410.12588-1-markus.theil@tu-ilmenau.de> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- 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)); mt76_wr_copy(dev, offset, skb->data, skb->len); return 0;