Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp742027pxp; Fri, 11 Mar 2022 13:56:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8iLeumJcETZF3NxynmpoUVVE1ej7Oq7GuY6/giOiZfzqP23zGNub5T//cNCL1okdwxYx2 X-Received: by 2002:a17:90a:bb0d:b0:1bd:3baf:c8b4 with SMTP id u13-20020a17090abb0d00b001bd3bafc8b4mr13041594pjr.15.1647035793046; Fri, 11 Mar 2022 13:56:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647035793; cv=none; d=google.com; s=arc-20160816; b=dyCA8twaj3SeNmdMrDkgjzbffknkSpK1oN/3k/eeuA4Q+UKz18LOBLoUuvMfbLl355 0PzOOfqQH18fbxeS1prrVXphZsBJW1QvugqUJEpy4LrD4X70BA1yt7MJ20lq2NslaSrA dEEgYq5hS4dwoQE3DfjdIoX6XZbIbou9JYgBALwHHALjLn7GmXZHZC8GvvoXyLszh4EW yDcz8AsfmRCH0iKqmosBqwH49rqNPMaeFOrfS88mhzc7hlNEMjvdOV0ZT5+5Fy5bsoUj qaS5c2TG+MsjTc9XrECe+93W39gAni1AOGfrP7qadFL5590ZfkI06N4P6fxlK2GlJ43e 5Kng== 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:dkim-signature; bh=X8rk1wKGgoot4D0abN1n7B47xEHjhOnmzv7J1avYjn0=; b=qWOJtHwtCCLf8WIwBp/nH8fu4nZicBAVBneo8eiF9au80UC+gX2NKiU/0QK7bnShH/ 93F8lYG90g3vsXLq/COruXwVSf2Dm/BiOWarfIk9/G409rNNiLo2DPXvHNO6juc92iFM EFtpaWLMEe/SvXJL62drvlueIsEajVWDzqaQQeGoxCZrCze7sJNkQsNhdRyQDMwcsYik RMAVIm/d1vcNvuaRe7MvJniodDvS0f3KhGbg+4xwcWOF0OCLaiV3J8LFTARj80eRepA8 UEhK3+fXszRU1JJS7X71YzKSMuUiVa4yGALJo0RzDuJmn3IGKJ25tNCUnyGNTSiBEKR3 GaUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=tcgNy46d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p18-20020a170902e75200b00151f8ee7414si8740106plf.486.2022.03.11.13.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:56:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=tcgNy46d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 607E01FEDA7; Fri, 11 Mar 2022 13:14:44 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344849AbiCJOxz (ORCPT + 99 others); Thu, 10 Mar 2022 09:53:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345277AbiCJOlq (ORCPT ); Thu, 10 Mar 2022 09:41:46 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36D1218E40E; Thu, 10 Mar 2022 06:36:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=X8rk1wKGgoot4D0abN1n7B47xEHjhOnmzv7J1avYjn0=; b=tcgNy46d72iV0QSf94ZwkSbPZc fiCNYP4pWJM8c/hJV6i7JGSHbwAcifxMJ5QS248qdiiElDvdtzg0y/Q1EP3mDErc9XjqNUBk7Jcy3 R594egyRYg1kQrikaVNnld5cbVTlffScORNO6vcm5TKrGaHoFYXiuCjNuGfKq5G9Wk5I=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nSJtv-00A9C3-9m; Thu, 10 Mar 2022 15:36:23 +0100 Date: Thu, 10 Mar 2022 15:36:23 +0100 From: Andrew Lunn To: Horatiu Vultur Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com, davem@davemloft.net, kuba@kernel.org, david.laight@aculab.com Subject: Re: [PATCH net-next v2] net: lan966x: Improve the CPU TX bitrate. Message-ID: References: <20220310084005.262551-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220310084005.262551-1-horatiu.vultur@microchip.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 10, 2022 at 09:40:05AM +0100, Horatiu Vultur wrote: > When doing manual injection of the frame, it is required to check if the > TX FIFO is ready to accept the next word of the frame. For this we are > using 'readx_poll_timeout_atomic', the only problem is that before it > actually checks the status, is determining the time when to finish polling > the status. Which seems to be an expensive operation. > Therefore check the status of the TX FIFO before calling > 'readx_poll_timeout_atomic'. > Doing this will improve the TX bitrate by ~70%. Because 99% the FIFO is > ready by that time. The measurements were done using iperf3. > > Before: > [ ID] Interval Transfer Bitrate Retr > [ 5] 0.00-10.03 sec 55.2 MBytes 46.2 Mbits/sec 0 sender > [ 5] 0.00-10.04 sec 53.8 MBytes 45.0 Mbits/sec receiver > > After: > [ ID] Interval Transfer Bitrate Retr > [ 5] 0.00-10.10 sec 95.0 MBytes 78.9 Mbits/sec 0 sender > [ 5] 0.00-10.11 sec 95.0 MBytes 78.8 Mbits/sec receiver > > Signed-off-by: Horatiu Vultur Reviewed-by: Andrew Lunn Andrew