Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp854310pxu; Wed, 16 Dec 2020 16:59:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0exkKGdfgOSYC0FRdU+Jp2u+lHlHybNZJvOuZocEje7LrCvxAc751YeHCJj64zScCG6Zx X-Received: by 2002:a05:6402:1155:: with SMTP id g21mr37418116edw.53.1608166741752; Wed, 16 Dec 2020 16:59:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608166741; cv=none; d=google.com; s=arc-20160816; b=DVFNdWbafpkvvgeFhdnhumMHRHNKSaM5Y6oXEpO0LpsQKTEspxNIBIrxMts2g/2CR0 JphBdohZjfWaol1BsN5hOOUcGEX/qOJ7ActwsZu9eZqECW/jbO4JJelZLVjN/6O5mSO2 tv2jq+OCz7+KsBSl5txw3Uo6ZWesqOnEm135jj7TxUAPtZagE2ncEZKcnenskXkJLFZ6 o2xFFk8Q1hceCIcibNBMIgpqCX0xh9eo9Mfoxftr8kNy6vc41RmEO0Ry8JoxmvbO1JVb 24JO4g+G4cttlaALdeboYgG4QsUvC0fvlHaOTm6aoKwk9BXr+kZydCSaon8TfGTIZvnr dFIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=euybVxxM7EXhNr0jh3ZiR93jYB6lZp7ZVLZdtiF+Stc=; b=ZMu9UgMV9NPlF4AZxdZovn0DBc2DzR8SJulEOK/kCnA9mxY6AKy0NomBkK5M4EQkUG ob2yg/lDgv5DFJzQ5rREU0eI9nXAIkhXf7k7CoylYWhww38cex30qwZIYh+D9hhKHzhX 2i78t/BYSObnlzn3MBVaDaV4NZCWSeZb+4fjwyiYTduuiZzky+LB2S1U37JLpoQi3WNS mDZqUkm+pN8RtQTzh4dwi3PRSUmH3gdp0rso629vPLk8aTmtDiVh+Vi6tMSat20VGY9J bUFOnGWUw56WKte52F4SL1aHTwkFkjwmGbeHKTAEGgFjsRd+pBNWyKX84NYpZo61cxIO kbGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dkkHBW1K; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l5si3269535edv.356.2020.12.16.16.58.39; Wed, 16 Dec 2020 16:59:01 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dkkHBW1K; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726784AbgLQA6W (ORCPT + 99 others); Wed, 16 Dec 2020 19:58:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726629AbgLQA6V (ORCPT ); Wed, 16 Dec 2020 19:58:21 -0500 Received: from mail-vs1-xe2f.google.com (mail-vs1-xe2f.google.com [IPv6:2607:f8b0:4864:20::e2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53FC5C06179C; Wed, 16 Dec 2020 16:57:41 -0800 (PST) Received: by mail-vs1-xe2f.google.com with SMTP id x26so14057983vsq.1; Wed, 16 Dec 2020 16:57:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=euybVxxM7EXhNr0jh3ZiR93jYB6lZp7ZVLZdtiF+Stc=; b=dkkHBW1KWRJt7520F0htUV0xuxcwt/oGdQpq2ryed+sFoy7wHDXivE6+LwPdh8Ecza 1Iz2veR/H29I7B+d+HuVugAeeyRNVozvTb7ABDSv12jo9KtAAdsJufRHtoctNiA4LvUR JmPjWRKBtJeFzaKgOvrDHqnqfs1zZl1NTgcf4kmC2gevwJ9q1SHrDolzneclHhCZOhl9 uKrhIVpRA8JBmgoNZSqUMEm9gnR3kKIYDpu/6x/HFpDIOwV0Gp7kiUZtI57SvJi25ikx o/C3nNq/caEEi9wTQprw98iDPD0Cle62PXpx+uq+TMKcV4s6oA+gD8Cidsc6w7iaJl+L 7moA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=euybVxxM7EXhNr0jh3ZiR93jYB6lZp7ZVLZdtiF+Stc=; b=Yb2RkqHgFNZpLys5A4at4auUOPvOvuUgWmkfSNr0uR0jBgAgwNrJHdyqS88Cm4sqqL qGMaWOUDpmwTSUObYuF5qa3tABS1K/4ZjptA4endfRLJjvJLqW+n8Wv3juacEFY/wvbl Eg0RtmyvSVTQO0BlNlTtBNxvt5zp9UTbGqI8qXV5MqzDBrr1fFGkYm42eB4bAUVno4IV NqF6c5gylBJXFfdYfNvMvNq6uiTQ0BN1bFm5KRF3XgpTT5lZ9svBfGB6CH9Esi//YCS+ 4pHrexduM290CTXd4t8FEfUwN/yWaA7KXikT3p0KgMLjNgmGBQw4RPfr6TNyll+6rZ10 5e9g== X-Gm-Message-State: AOAM533YqlEXrPJZ/wMuoeyvVcJL2TrMazvOdYT11CgEmn+tP9mrkhH9 sFb12RJOujYlkS1CWRKPtWzoucA1+tpYgG11hJw= X-Received: by 2002:a67:507:: with SMTP id 7mr27395596vsf.42.1608166660043; Wed, 16 Dec 2020 16:57:40 -0800 (PST) MIME-Version: 1.0 References: <20201206034408.31492-1-TheSven73@gmail.com> <20201206034408.31492-2-TheSven73@gmail.com> <20201208114314.743ee6ec@kicinski-fedora-pc1c0hjn.DHCP.thefacebook.com> <20201208225125.GA2602479@lunn.ch> <3aed88da-8e82-3bd0-6822-d30f1bd5ec9e@gmail.com> <20201209140956.GC2611606@lunn.ch> In-Reply-To: <20201209140956.GC2611606@lunn.ch> From: Sven Van Asbroeck Date: Wed, 16 Dec 2020 19:57:28 -0500 Message-ID: Subject: Re: [PATCH net v1 2/2] lan743x: boost performance: limit PCIe bandwidth requirement To: Andrew Lunn Cc: Florian Fainelli , Jakub Kicinski , Bryan Whitehead , Microchip Linux Driver Support , David S Miller , netdev , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, On Wed, Dec 9, 2020 at 9:10 AM Andrew Lunn wrote: > > 9K is not a nice number, since for each allocation it probably has to > find 4 contiguous pages. See what the performance difference is with > 2K, 4K and 8K. If there is a big difference, you might want to special > case when the MTU is set for jumbo packets, or check if the hardware > can do scatter/gather. > > You also need to be careful with caches and speculation. As you have > seen, bad things can happen. And it can be a lot more subtle. If some > code is accessing the page before the buffer and gets towards the end > of the page, the CPU might speculatively bring in the next page, i.e > the start of the buffer. If that happens before the DMA operation, and > you don't invalidate the cache correctly, you get hard to find > corruption. Thank you for the guidance. When I keep the 9K buffers, and sync only the buffer space that is being used (mtu when mapping, received packet size when unmapping), then there is no more corruption, and performance improves. But setting the buffer size to the mtu size still provides much better performance. I do not understand why (yet). It seems that caching and dma behaviour/performance on arm32 (armv7) is very different compared to x86.