Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7099383ybi; Thu, 13 Jun 2019 09:32:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3tKkfLzUiqIXP+c92fkZv+RNIACSq9yLX/OO6o8HqdmIiaYky9KMWuP5gH4GynxFgBI30 X-Received: by 2002:aa7:9ad2:: with SMTP id x18mr13484233pfp.192.1560443527077; Thu, 13 Jun 2019 09:32:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560443527; cv=none; d=google.com; s=arc-20160816; b=waYnMj68tuaKhw7yjUPztZ0F2vUX5Sqha0ZcZ0UgVX39I+Q64DwCYBApKQM3DP5ra5 6PO3DqUzLIUIDgcO09NPLxV93ZBWknf2nYZDI8/Kuvy5u3gIuctF2zHzx7CNghXf4mAT nWB1buCKneUjXvRX3wp132LOJXDgW7f3tFHBkXK1xI04C58WWTe+GI0i60BZ2It/9ARK Muf5scd5yCL6NfbQLnkgogwFoFxd1huLONVlFXYRS0PyIslQqu1c0GWHZeE8RAivumr/ EwsymMyzax8zmvP+nuM6RiTt5xK53dRpXCcxgApHCpCLQriuFvwwItZgmsGi7zXBTaa/ xpHg== 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:dkim-signature; bh=yoMAKVpEnLxW1+GilPy2mzvwfo4QHAqEOChY9e+vbvU=; b=lDzJWAb+koaXNfGcvHsjTgr5zlV0c076DaUnMXcoIrAGt8fajPdC1JPqnR6bFFAWvn z+y5rIy8u0Ij07p4hugbXutNUhpdiKb2tk9X4cHenLCpqrIC/+GqDe5+1psTB9T5LqxH lV1bfopuOSzJ7O86eoKtVJ5zn32bxvxciv/26+A+TYi2JF3WfvAO0c9rLKvhh/e43hL1 HCWMpK5aKptZuM7F/WjZ1L/+3FVHeevsiGKv/vgqbfQvt9fd3N0dK75sJXh7Cqv5VQ+b ibZFPi5JTtRUhZ1BaQ7q+0K2Dv33upTUHCSazHZrtDpPWsUlVZci2pDgOUeauKOdVTgQ yjFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f4V+Zg0q; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l8si127364pgk.528.2019.06.13.09.31.43; Thu, 13 Jun 2019 09:32:07 -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; dkim=pass header.i=@kernel.org header.s=default header.b=f4V+Zg0q; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389119AbfFMQbN (ORCPT + 99 others); Thu, 13 Jun 2019 12:31:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:50650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730879AbfFMI0p (ORCPT ); Thu, 13 Jun 2019 04:26:45 -0400 Received: from localhost.localdomain (nat-pool-mxp-t.redhat.com [149.6.153.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 34DF420851; Thu, 13 Jun 2019 08:26:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560414404; bh=TyDVCmgc3SYGGIORpTEAsOPhVDoacFF4Wox3U8f5sAM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f4V+Zg0qL8m43mXTaXndhOJU1uxfbJAjatlz+YLyYjg8ImrA0ClYinyTWhobs6ktM HSSCa3BFgA6DYcCTzsgB1gyzQMAvWm+8SJNic6hwLdAHD6oXwib4ig1wBik9NcOilE 9jj63g602dOPb0aY8149NATi2bHulg+F+o8hxRDQ= Date: Thu, 13 Jun 2019 10:26:38 +0200 From: Lorenzo Bianconi To: Stanislaw Gruszka Cc: Lorenzo Bianconi , nbd@nbd.name, kvalo@codeaurora.org, linux-wireless@vger.kernel.org Subject: Re: [PATCH v2 2/2] mt76: usb: do not always copy the first part of received frames Message-ID: <20190613082637.GA18296@localhost.localdomain> References: <20190612091036.GB2965@redhat.com> <20190612095302.GD8107@localhost.localdomain> <20190612102502.GB4431@redhat.com> <20190612104921.GF8107@localhost.localdomain> <20190612115120.GA3496@redhat.com> <20190612122845.GH8107@localhost.localdomain> <20190612125905.GB2600@redhat.com> <20190612142128.GA20760@redhat.com> <20190612144400.GB7016@localhost.localdomain> <20190613075108.GA24650@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="y0ulUmNC+osPPQO6" Content-Disposition: inline In-Reply-To: <20190613075108.GA24650@redhat.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable [...] > I looked at intel wifi drivers and this is handled by amsdu_size module > parameter, supported values are 4k, 8k and 12k. RX allocation size and > proper values in vht_cap & ht_cap are set accordingly. Assuming (some) > mt76 HW and FW can handle bigger AMSDUs I think we should do similar > thing. >=20 > Otherwise looks for me, we just waste memory and have not needed code > for no true reason.=20 >=20 > > space needed for skb_shared_info is 320B on a x86_64 device >=20 > Uhh, I haven't expected that sk_shared_info() is that big, so indeed buil= d_skb > could not used and 128B copy fallback will be necessary. Hi Stanislaw, reviewing the original patch I think we can't trigger any IOMMU bug since t= he usb buffer length is actually 2048 and not 2048 + skb_shared_info_size: in mt76u_fill_rx_sg() data_size =3D SKB_WITH_OVERHEAD(q->buf_size); q->buf_size =3D MT_BUF_WITH_OVERHEAD(MT_RX_BUF_SIZE); where MT_BUF_WITH_OVERHEAD is ((x) + SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) anyway we can even set q->buf_size =3D PAGE_SIZE data_size =3D rounddown(SKB_WITH_OVERHEAD(q->buf_size), usb_endpoint_maxp()) Regards, Lorenzo >=20 >=20 > Stanislaw --y0ulUmNC+osPPQO6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCXQIIugAKCRA6cBh0uS2t rH2sAP90gOZWOnR6IKKmB20j1seTa79tBMorqgYyxJNJlIR+nwEA1XzC10Pds4Sc eo0IpeZfBLgWAVjZeXmo0VLcE/9/UQk= =oBw3 -----END PGP SIGNATURE----- --y0ulUmNC+osPPQO6--