Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3610395pxu; Tue, 8 Dec 2020 17:14:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJOf9ZhQcRaKlPPa1OlpoxoNQxRASVENndVgfQYSKb/sIMocwIWOfHOB2ecBBdSMbA3ee/ X-Received: by 2002:aa7:d511:: with SMTP id y17mr597928edq.249.1607476494532; Tue, 08 Dec 2020 17:14:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607476494; cv=none; d=google.com; s=arc-20160816; b=p77TcteDAXiIklUElIfnBQI9uc1EDbLAbTmMkhhd0bZhzJlpQtSxoxYfsdpmHXC0fM bSq7ymbWJM/jaFcV0wM49oh9++IUHvIgnuwCy/er7ynaCopxFRWHx7x9RDCEz0Voe0gz PeIglmD7AiPpHBefwvpK4kRRm/VG6LtZLsku+6t9DtNIjTvrycX1i4g1GXw4qZxtspuK FdqENUOaxuoGnzqcuGAztZribGiYDds+NTWZPQamERF03RcA4Pa6JcO6RgismlHGT1vO wfNwooAUodqplbY2UA2nhOVvwfobJmPlimCbLsr9Xn5++gdCbY8gMWvOFCwNdGdjFegb JpiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=uj1JkLbuZPbc4ETB1CrLsJ+E0E0+BJujBhxuYmf+sWs=; b=yVPs01GRuVQmAT984JFS+pPns4h+cDOI+5joKakKB7vs9PsQJLTvUaCv7c8MbuGt0j gno/zdaozsapwIjaLCd+mE5LPndnwBEsHCEo2mLJB9RUriIxsqUQJAr2zG+Al47LyC0E ku2WTtJau8Hig2F7snaIReyshPxUm99gyxY36X+E1qGKvAeIwn4lgulbkZ8N2bGyzdSX 39WKYYsCBM5RduuQ9iiD2BgTilJOPmu+LzbzbZuLwvFm2jD4er0Qnz0tx+TNoGQRJro6 tuuYfDLjY1AGUp7o6SwA8m4mdAWySxbe9C3HwX06Uu+6Tc1bqWii1oE2dcsAdX35Zgbf oBpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cc21si3454edb.123.2020.12.08.17.14.32; Tue, 08 Dec 2020 17:14:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731500AbgLHWwU (ORCPT + 99 others); Tue, 8 Dec 2020 17:52:20 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:45196 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731438AbgLHWwQ (ORCPT ); Tue, 8 Dec 2020 17:52:16 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kmlpN-00AvrE-AX; Tue, 08 Dec 2020 23:51:25 +0100 Date: Tue, 8 Dec 2020 23:51:25 +0100 From: Andrew Lunn To: Sven Van Asbroeck Cc: Jakub Kicinski , Bryan Whitehead , Microchip Linux Driver Support , David S Miller , netdev , Linux Kernel Mailing List Subject: Re: [PATCH net v1 2/2] lan743x: boost performance: limit PCIe bandwidth requirement Message-ID: <20201208225125.GA2602479@lunn.ch> References: <20201206034408.31492-1-TheSven73@gmail.com> <20201206034408.31492-2-TheSven73@gmail.com> <20201208114314.743ee6ec@kicinski-fedora-pc1c0hjn.DHCP.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > That's a good question. I used perf to create a flame graph of what > the cpu was doing when receiving data at high speed. It showed that > __dma_page_dev_to_cpu took up most of the cpu time. Which is triggered > by dma_unmap_single(9K, DMA_FROM_DEVICE). > > So I assumed that it's a PCIe dma bandwidth issue, but I could be wrong - > I didn't do any PCIe bandwidth measurements. Sometimes it is actually cache operations which take all the time. This needs to invalidate the cache, so that when the memory is then accessed, it get fetched from RAM. On SMP machines, cache invalidation can be expensive, due to all the cross CPU operations. I've actually got better performance by building a UP kernel on some low core count ARM CPUs. There are some tricks which can be played. Do you actually need all 9K? Does the descriptor tell you actually how much is used? You can get a nice speed up if you just unmap 64 bytes for a TCP ACK, rather than the full 9K. Andrew