Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4576111ybi; Tue, 30 Jul 2019 04:32:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYPRuRhurLgKsK113LRj/UI2LSZWedLhTGi2ltbQ98sxEwITrmZCW6Aq8g1zT9cx4fFCMO X-Received: by 2002:aa7:8f24:: with SMTP id y4mr40889572pfr.36.1564486345500; Tue, 30 Jul 2019 04:32:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564486345; cv=none; d=google.com; s=arc-20160816; b=LMU5A/fOY6pFmZ0rFEkSFJI3sPIeZcna9L0HeDKGx5q7l3L7x/tTlnb59A7s6i+Uuc IhDq3m4QvmGolRGAK0o1UMc0CUwMUmyJdRDqrS3MDkm6gr8tfkP+xKhgIEvboJ1oPlaX C3im0HvbI29n7Ejg//jh6QrWT1i3GkLelDNNP6yMmSpLfd8W7PfUumwHOWiygBcyjFuC 5NV87EqSqCrWp59kCF5cD0hC1Qej4Yt1CjBEvtUkXIVmKBcOYqItPxBla2Buw3PDkNK4 OTe6LwxpVUORGam/AlVRajr+ORzIy1rGcBT3sxtthybJUA9Hua1vDiCKtRwZ0uHvzR2P r/Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=eFoo3C2x2PiPePTXZKWstlFxN0+WIQHI500KMU/sHdI=; b=Oa86gVdShy1oFNHldlFMKgy3ssfXMHiumQBL/KQXIu8DKZp4pAsvnuLpdz3Zk5aSqP tTG6y2zenL76ZSEfX9gVHWyxjQROWCCX+anJFd7JAV9TebDWpPq/6dzdskLTgKxjIKF1 LKEcqyMgpwcyvUUs7IgJ+VfQK7QgC3+A0Jmh4DAiY7NBULhOQSPTq3bFTPr1uskJP7L4 jTbSdMpb/hFOT/PyEa1FK5wOwxgUioeiq2xG+X6dFCVi2FL8OS4mBQH7IPPvEJuXt4HF WomYXSRD+jCTQ1wIjiNApjVNthYFWuQQXq9sL15L4kXW66xUKh+4Xuz3+MrD1krDJ0KE O4kQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f89si30785142pje.50.2019.07.30.04.32.04; Tue, 30 Jul 2019 04:32:25 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732083AbfG3Jsp convert rfc822-to-8bit (ORCPT + 99 others); Tue, 30 Jul 2019 05:48:45 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:20485 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730243AbfG3Jsp (ORCPT ); Tue, 30 Jul 2019 05:48:45 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-174-SV6Xl8A9OrKA0tVNQBwUCg-1; Tue, 30 Jul 2019 10:48:38 +0100 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b::d117) by AcuMS.aculab.com (fd9f:af1c:a25b::d117) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Tue, 30 Jul 2019 10:48:38 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Tue, 30 Jul 2019 10:48:38 +0100 From: David Laight To: 'Stanislaw Gruszka' , Jian-Hong Pan CC: Yan-Hsuan Chuang , Kalle Valo , "David S . Miller" , "linux-wireless@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux@endlessm.com" , "stable@vger.kernel.org" Subject: RE: [PATCH] rtw88: pci: Use general byte arrays as the elements of RX ring Thread-Topic: [PATCH] rtw88: pci: Use general byte arrays as the elements of RX ring Thread-Index: AQHVRro3Kaj7ufhACkSCuQV9Pmu/hqbi59sQ Date: Tue, 30 Jul 2019 09:48:38 +0000 Message-ID: <962a8a8e735946d6b3944b7d0e228309@AcuMS.aculab.com> References: <20190725080925.6575-1-jian-hong@endlessm.com> <20190730093533.GC3174@redhat.com> In-Reply-To: <20190730093533.GC3174@redhat.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: SV6Xl8A9OrKA0tVNQBwUCg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Stanislaw Gruszka > Sent: 30 July 2019 10:36 ... > > + len = pkt_stat.pkt_len + pkt_offset; > > + skb = dev_alloc_skb(len); > > + if (WARN_ONCE(!skb, "rx routine starvation\n")) > > goto next_rp; > > > > /* put the DMA data including rx_desc from phy to new skb */ > > - skb_put_data(new, skb->data, new_len); > > + skb_put_data(skb, rx_desc, len); > > Coping big packets it quite inefficient. What drivers usually do is > copy only for small packets and for big ones allocate new rx buf > (drop packet alloc if fail) and pas old buf to network stack via > skb_add_rx_frag(). See iwlmvm as example. If you have to do iommu setup/teardown then the breakeven point for (not) copying may be surprisingly large. You do need to do the measurements on a range of hardware. Coping is also likely to affect the L1 cache - unless you can copy quickly without polluting the cache. It is all 'swings and roundabouts'. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)