Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp656868ybi; Fri, 14 Jun 2019 00:55:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzQ77jWVnHmgo8B4ka8CUEJzMmLrArgbmMVvL9m2zTE17HgY+4+//4nGN1oSWFddSj2OdB X-Received: by 2002:a17:902:bb90:: with SMTP id m16mr24355160pls.54.1560498911042; Fri, 14 Jun 2019 00:55:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560498911; cv=none; d=google.com; s=arc-20160816; b=mVxxoljRNZLhD/v/VNZN2VJGsqjyWXD22t35jJ+6IMD0uurAk5x28Y3vDJ6KSeRYV/ MyWN2aCw1Cz49lAKHQVBW0MoeePG9r1AtJtlpls+IIbcwtc/snEPC48xe1690wrOCGM2 XV8aKtffR2khwDTM7LK26v8c+CwLYNM55p2ejQLUiFI2neDRsjVYKwB35mosftzTNxas 4YQyVdxrWgVrSO/OcZZYBZZyVlfXEQoeN59veKEr2uY5Hc2xk8hk7W7O7g0FxAL5hTsM M3FHz29vjwkJKv6IlthQLDfP7cQEFbgWbcAvP/MEVyw4KfSwaiO0eK0zhOOJDgYaS7ub fBnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Vt8Xyck6NjQNxUQcmdpjWi8f01FH00Xh8dbNh3VX2fg=; b=RoWfoZr68nFVcjzVEuUBrw7n3bkPBL6gqlKmlItjGtkr53G8/PvOrJRLmDnjLml8Au jlKgSNgtum1llo4JwtffwORzw2IxnNKmkbUXp6RINQ3bhXAoxa/pCL4AYpiVB+vI0ArK AF/i9G4SVmlzJYksD6Y4mUYondhoBzh52miLq3j+HHkuxBP7Ys4jjCaZ+zfhPblKmhMv TtKOWzsrc+sq2oXFnerpvPh6vCIdkTESNzVcknPail1AtXmehdTEmcdLavAsYn3hz3wk eisq9yUg/EFT7AVKMCudi4wuRoXagCBk1TQVV3bwjQZePWHmVjHKqxgs6JUKpXZ5TP7B yPFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p19si1767067pgk.309.2019.06.14.00.54.43; Fri, 14 Jun 2019 00:55:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726133AbfFNHyk (ORCPT + 99 others); Fri, 14 Jun 2019 03:54:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41452 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726072AbfFNHyj (ORCPT ); Fri, 14 Jun 2019 03:54:39 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D4C73082E23; Fri, 14 Jun 2019 07:54:38 +0000 (UTC) Received: from localhost (unknown [10.43.2.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id B843660657; Fri, 14 Jun 2019 07:54:35 +0000 (UTC) Date: Fri, 14 Jun 2019 09:53:03 +0200 From: Stanislaw Gruszka To: Lorenzo Bianconi Cc: kvalo@codeaurora.org, linux-wireless@vger.kernel.org, nbd@nbd.name, lorenzo.bianconi@redhat.com Subject: Re: [PATCH v3 wireless-drivers 3/3] mt76: usb: do not always copy the first part of received frames Message-ID: <20190614075303.GB3395@redhat.com> References: <1a9566c0a41ad0d940487a9d3f0008993c075ef2.1560461404.git.lorenzo@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1a9566c0a41ad0d940487a9d3f0008993c075ef2.1560461404.git.lorenzo@kernel.org> User-Agent: Mutt/1.5.20 (2009-12-10) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 14 Jun 2019 07:54:39 +0000 (UTC) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Thu, Jun 13, 2019 at 11:43:13PM +0200, Lorenzo Bianconi wrote: > Set usb buffer size taking into account skb_shared_info in order to > not always copy the first part of received frames if A-MSDU is enabled > for SG capable devices. Moreover align usb buffer size to max_ep > boundaries and set buf_size to PAGE_SIZE even for sg case I think this should not be applied to wirless-drivers, only first patch that fix the bug and optimizations should be done in -next. > + int i, data_size; > > + data_size = rounddown(SKB_WITH_OVERHEAD(q->buf_size), > + dev->usb.in_ep[MT_EP_IN_PKT_RX].max_packet); > for (i = 0; i < nsgs; i++) { > struct page *page; > void *data; > @@ -302,7 +304,7 @@ mt76u_fill_rx_sg(struct mt76_dev *dev, struct mt76_queue *q, struct urb *urb, > > page = virt_to_head_page(data); > offset = data - page_address(page); > - sg_set_page(&urb->sg[i], page, q->buf_size, offset); > + sg_set_page(&urb->sg[i], page, data_size, offset); > - q->buf_size = dev->usb.sg_en ? MT_RX_BUF_SIZE : PAGE_SIZE; > q->ndesc = MT_NUM_RX_ENTRIES; > + q->buf_size = PAGE_SIZE; > + This should be associated with decrease of MT_SG_MAX_SIZE to value that is actually needed and currently this is 2 for 4k AMSDU. However I don't think allocating 2 pages to avoid ieee80211 header and SNAP copy is worth to do. For me best approach would be allocate 1 page for 4k AMSDU, 2 for 8k and 3 for 12k (still using sg, but without data_size change to avoid 32B copying). Stanislaw