Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1977277ybc; Wed, 13 Nov 2019 07:13:36 -0800 (PST) X-Google-Smtp-Source: APXvYqwubR7wKPzMzogAj2BTBvTUGyCIZokdgmUcj2H0nZZHy6/IU1j6inQAzCUXbxhaJe470x/M X-Received: by 2002:a50:f7cb:: with SMTP id i11mr4220872edn.194.1573658015876; Wed, 13 Nov 2019 07:13:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573658015; cv=none; d=google.com; s=arc-20160816; b=FuBiEydYrnNHmfJ3bBfV58gBzAbox6ldJ39RO+9x2c5BkoKdS/eBcN8Wh1QIhT6XAv WdR0iBKGJE2HvF0bdkNPg8fDUL3eLMICCAU6TMOFbggjSpnv1m615bZl/d6mWXBSH8WQ N0nS4hqUCoxUB8VTml9rQvamBpQD2OFatM98mZq5QuNq9/5mU/Se+vscj8PGnS8joNGW UwFYNgOSnyV7UKCMneg0eJgFaQFyRrzoQQwXty/AsdB1idGSLrLHojwz0h7T8W0DKSnN PThwjYZOfmvQvzoUpguQCgaSrqK45FDWbu5HKVS3cVrzmh0mgWmnmdodrQSjKmW/YMpt dqHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=gybUAwdyyDHecNp/gyMo4G6J6eVxa6jkxHMfSUSscfY=; b=SsyCBubFytZdjHKHFTIkRKB+sdHIZrZ1CmrhHoV66AowvOswvU9VbZZW3py4g4vCiR CboSg41g/xmwg1rMtb7lCZRAoGplfvbK72Yl7UV+88mq/IBzeisVSIwkkppxQb2vrqIV 8aZlVUVf1tDakIeFCoDBJu1UTAPjvHbhOJcPDxD1XbY6g1c3r12bGbxjGlbo7yH/n2Po HPUilsKMxseOepNnEUH4VHN1NGdwHj233CqH7/9yWtc2QxFSnYI2OAoGoqIwOS2WaqzT SNU8UOq69gg72dkCrnX1r0Fx9rd/th4q/aqBxVxTESDTKPs0GOyNJfV+rvG1KbFhDKCh Kjdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=aIQwonKp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i14si1602397edr.68.2019.11.13.07.13.11; Wed, 13 Nov 2019 07:13:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=aIQwonKp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728033AbfKMPMZ (ORCPT + 99 others); Wed, 13 Nov 2019 10:12:25 -0500 Received: from us03-smtprelay2.synopsys.com ([149.117.87.133]:39364 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727998AbfKMPMX (ORCPT ); Wed, 13 Nov 2019 10:12:23 -0500 Received: from mailhost.synopsys.com (mdc-mailhost2.synopsys.com [10.225.0.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 1DC55C08F0; Wed, 13 Nov 2019 15:12:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1573657942; bh=rY6zutKLniNqqabMrkfKKBcTZrq785e+OQVzTb7ee0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=aIQwonKpciVXovTS2F+Z0oN9cgfov9V9DC3aBB43muRg4GU1R/cvYzV7BW76EUWVj KtdXhkIEnKHa6i9HvGhOcK0GT/rLhKbLDurRBUvg77z9Bkjd6MIb1NhPV2UjQDfvFK IahvxFyZSQckbZKU82KAjQLwnNmWadK3qy2UtBjkbd2QNHJFnKndh35/SJuaiAFcqL MzSlSVvSM4Gv+wA2iBl28Xo2PFWbvNwNpGNZnca5JgSBkcv+flMDEl2HEMMv+LmY3C 7BTbYrltdK4j0kF/s8q4VmSzaKPoQR/ET0/FhTU7/i/Z2m8gGa5M4aBK+pqO5+GD+J sHJQP8ThsxnXw== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost.synopsys.com (Postfix) with ESMTP id 80CBAA0083; Wed, 13 Nov 2019 15:12:19 +0000 (UTC) From: Jose Abreu To: netdev@vger.kernel.org Cc: Joao Pinto , Jose Abreu , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/7] net: stmmac: Setup a default RX Coalesce value instead of the minimum Date: Wed, 13 Nov 2019 16:12:03 +0100 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For performance reasons, sometimes using the minimum RX Coalesce value is not optimal. Lets setup a default value that is optimal in most of the use cases. Signed-off-by: Jose Abreu --- Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Jose Abreu Cc: "David S. Miller" Cc: Maxime Coquelin Cc: netdev@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethernet/stmicro/stmmac/common.h | 1 + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h index 912bbb6515b2..309ea12ea61f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/common.h +++ b/drivers/net/ethernet/stmicro/stmmac/common.h @@ -248,6 +248,7 @@ struct stmmac_safety_stats { /* Max/Min RI Watchdog Timer count value */ #define MAX_DMA_RIWT 0xff #define MIN_DMA_RIWT 0x10 +#define DEF_DMA_RIWT 0xa0 /* Tx coalesce parameters */ #define STMMAC_COAL_TX_TIMER 1000 #define STMMAC_MAX_COAL_TX_TICK 100000 diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index e3677883ea30..6136ada20c8e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2605,9 +2605,10 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp) priv->tx_lpi_timer = STMMAC_DEFAULT_TWT_LS; if (priv->use_riwt) { - ret = stmmac_rx_watchdog(priv, priv->ioaddr, MIN_DMA_RIWT, rx_cnt); - if (!ret) - priv->rx_riwt = MIN_DMA_RIWT; + if (!priv->rx_riwt) + priv->rx_riwt = DEF_DMA_RIWT; + + ret = stmmac_rx_watchdog(priv, priv->ioaddr, priv->rx_riwt, rx_cnt); } if (priv->hw->pcs) -- 2.7.4