Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4531797pxj; Wed, 12 May 2021 07:37:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF7859wXn4exmUij13C7haJrfL9GG2HDoswmDgMJF6ftdT5cdugk++CICGYZExVH+M+img X-Received: by 2002:ac2:495a:: with SMTP id o26mr24160287lfi.419.1620830279508; Wed, 12 May 2021 07:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620830279; cv=none; d=google.com; s=arc-20160816; b=cKVOF0rIXhZEHA9KyoNuDFJGBGioHeRuz7xRNUpH1BOUOnIBOVElWTxvB5xWOy9kD2 GbEb4RWvx5yaKJBHIu0flIcheHNpHSjyfTM+wanBcp0znVZ5s0asem2XB2loLT/D2LVs 765t4BVBQe4coR/ABt8QC/7Nwe5MCcFrdFImapS8MREuwQLUzJX4blj14qO+TPtPTG5b zFdRf0/1//eSLgGF6Z/9JPt0DNHB1RgsqGGKvtN6KAzkFHYhP36BAQ/hpvPTypA9Oz+N AKYeXK8b0VwTcUudSHLyBTx3HtpuRvE9hxzDx/CscxKN1FWmA2n5swjTdJFbH3hPl0I2 ObvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version; bh=mZnH7SbAeKUJuGDn2cbul+1tgjADpCVYGtPjP2ijmcQ=; b=Edxgyha1LqI1Ei1mmsvIRE3Tx96Wo6BjlxLHrWiBkLK0kBhU5lWWy/ho5aIALnmBTD xKfLWc3AvgiYptc+bI+kQVXt79nwXjG7gHWlDC+mwxkHSnB8AjFGg5FbaqCQLYcL3fh7 v0fN7f0O4zt6NUECZyfToWB3NOt39mHu/VjXJz5eL3fOx4l+Uj7DGUJ1t4CrRZe2kyIw nXDgw7PRQseeGMOsBl3Z+NEQgRHq8uJfxn8rPvuLgGeiJV+H7qDZkKeFxlE7jgsUrlnK mRlVXzX2GC9t96TZEwljhuYwjhj07JYe2mxyPsjDYlnG2lHxofObyxzWFFx1PxyH4/gu iygA== 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 w19si128031lfu.75.2021.05.12.07.37.28; Wed, 12 May 2021 07:37:59 -0700 (PDT) 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 S230396AbhELOg7 (ORCPT + 99 others); Wed, 12 May 2021 10:36:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230247AbhELOg7 (ORCPT ); Wed, 12 May 2021 10:36:59 -0400 Received: from plekste.mt.lv (bute.mt.lv [IPv6:2a02:610:7501:2000::195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A545C061574; Wed, 12 May 2021 07:35:51 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=bute.mt.lv) by plekste.mt.lv with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1lgpxO-0006fy-AC; Wed, 12 May 2021 17:35:26 +0300 MIME-Version: 1.0 Date: Wed, 12 May 2021 17:35:26 +0300 From: Gatis Peisenieks To: Chris Snook Cc: "David S. Miller" , Jakub Kicinski , Heiner Kallweit , jesse.brandeburg@intel.com, dchickles@marvell.com, tully@mikrotik.com, Eric Dumazet , netdev , LKML Subject: Re: [PATCH net-next 2/4] atl1c: improve performance by avoiding unnecessary pcie writes on xmit In-Reply-To: References: <20210511190518.8901-1-gatis@mikrotik.com> <20210511190518.8901-3-gatis@mikrotik.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: gatis@mikrotik.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-05-12 05:39, Chris Snook wrote: > Increases in latency tend to hurt more on single-queue devices. Has > this been tested on the original gigabit atl1c? Thank you Chris, for checking this out! I did test the atl1c driver with and without this change on actual AR8151 hardware. My test system was Intel(R) Core(TM) i7-4790K + RB44Ge. That is a 4 port 1G AR8151 based card. I measured latency with external traffic generator with test system doing L2 forwarding. Receiving traffic on one atl1c interface and transmitting over another atl1c interface. I had default 1000 packet pfifo queue configured on the atl1c interfaces. Max 64 byte packet L2 forward pps rate improved 860K -> 1070K. Any latency difference at 800Kpps was lost in the noise - with the particular traffic generator system (a linux based RouterOS traffic-gen). I measured average 285us for a 30 second run in both cases. Note that this includes any traffic generator "internal" latency. Note that I had to tweak atl1c tx interrupt moderation to get these numbers. With default tx_imt = 1000 no matter what I get only 500 tx interrupts/sec. Since the tx clean is fast and do not get polled repeatedly and ring size is 1024 I am limited to ~500Kpps. tx_imt = 500 dobubles that, I used tx_imt = 200 for this test. As a side note that still relates to latency discussion on AR8151 hardware what I did find out however is that rx interrupt moderation timer value has a big effect on latency. Changing rx_imt from 200 to 10 resulted in considerable improvement from 285us to 41us average latency as measured by traffic generator. I do not have enough knowledge of the quirks of all the hardware supported by the driver to confidently put this in a patch though. Mikrotik 10/25G NIC has its own interrupt moderation mechanism, so this is not relevant to that if anyone is interested. > > - Chris > > On Tue, May 11, 2021 at 12:05 PM Gatis Peisenieks > wrote: >> >> The kernel has xmit_more facility that hints the networking driver >> xmit >> path about whether more packets are coming soon. This information can >> be >> used to avoid unnecessary expensive PCIe transaction per tx packet at >> a >> slight increase in latency. >> >> Max TX pps on Mikrotik 10/25G NIC in a Threadripper 3960X system >> improved from 1150Kpps to 1700Kpps. >>