Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2123807rdb; Sun, 4 Feb 2024 16:44:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IG92B0dpzOqCmx0F494vrIQL0YtXeTvOOPU5AdcNs0DbTlXyeQaKaS91p1BMCD4RxfPyOBv X-Received: by 2002:a2e:9855:0:b0:2d0:a050:606c with SMTP id e21-20020a2e9855000000b002d0a050606cmr2418925ljj.20.1707093884960; Sun, 04 Feb 2024 16:44:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707093884; cv=pass; d=google.com; s=arc-20160816; b=LCqgc7N+M7REDVe0uUipVm0LrjIBBOj+NVGXCBLOdECGjw4cnkP8sABu7hf7p/uE93 lXK4TLu96yvAZWMWqYTT9kv22GzAOSEy/0uPFhb/aR+hHRVamrmcVR3H93doqb94XumM czPV/sTuIopymatkPatGpo+ogV8wQix72YRbhliQzpgqyEE/YH1zWSIGzIj7bJn8K3c9 BaYCa+L4SCIXhOm/oY9GP2KjFC5JsBThOBrultiM7RCeIPZwAU4b9bR7qpnMr8H+ImCQ mFEgInhqGpw87kqWtz4OKtOBwDYYjQ1EAyfdfAm8RqAMxQznCwXN7F3m6dbAwSuIuY7u Of4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8pRLyNXA1Vc52Lsv+SyI/OT6snOptfaP6otyX8bc0Yg=; fh=V99f0S9atPwFjaoDY+dOXaVcrLqlP1H59i+cU1RAI3A=; b=VzZSLcKlKII1m/zlKrb8ajDYjOvfvdmuHWMPlhO9JVXiqUPWGfdI5hhD8wgu1ndf/S duYLfqeIcYyYdFQZbthZ1azzTAAGZNdgrJbDrAAomshsq4vXC56VuAk0VgZSt2X9RnKB BWFT1iX4GNnrm2uZIuQ8u03DxnrJwfjdo5HSUow56dQ8oJe2OnJrKS8OeFcgpXBYDAX6 IXTjfAV0F3+itmUC80e89yoTihf9NwUov4eZ2eYXNlRgzNeNPfx3wt2PYJ+tJbgbfU0X BRX6nrPAg5ABOjXbS5ltsPa5qoFkWGrKb2iSHywFQ3QNlkowb53BQoBifUIpiWzyeMNS FQxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nKH3BHQF; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51967-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCUKr5qeJm2pUZy9A2rWffRFF63gDdbm0SOKYQdX2msM+f2UcxCaVdrY7cq2LoOarsDSlhVgX8caoJPO1MXyz9Be9rl3ASR5P7mapsVJog== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c94-20020a509fe7000000b0055fc08ef164si3434047edf.272.2024.02.04.16.44.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 16:44:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nKH3BHQF; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51967-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 62B391F221A3 for ; Mon, 5 Feb 2024 00:44:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBBFF29AF; Mon, 5 Feb 2024 00:44:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nKH3BHQF" Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 457F3A94A; Mon, 5 Feb 2024 00:44:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707093857; cv=none; b=rnKhseG/dhtqjuHhK7Smvnuz3f1A06HuVNk+RzUyxHOJF94EEfHcFFAjghti+F72vL5c7m38zrJB12L6S5Pglr4IqwopIUOuDejdNpoZBQqRmbxrDDYUTpmYTX00XFVe0YL+fTTACA/kJnX8ytDUPJW0vazeMsKdkpFlMYMbczE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707093857; c=relaxed/simple; bh=2Z5QksJq+eDLpg7FYQtmjE2jPrkh5Zzk4bJ79okWTyE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bcyPYgHr4nSlljrnt4C8wCUO88gDx/sjuCJUPbTek2hnYbn37RTXsNaTyAr2OHVMomtBOGyykg+oZNgaEAQ2+ulozDQfTmrm4OtXu0Vu+y5TXSeAy/Hq6hvcs0vg2MzWCwGUSqe89kEEKXH87VR6tiEk5bR7b+CJsK5bTHlfIHw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nKH3BHQF; arc=none smtp.client-ip=209.85.167.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-5111c7d40deso6369690e87.1; Sun, 04 Feb 2024 16:44:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707093853; x=1707698653; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=8pRLyNXA1Vc52Lsv+SyI/OT6snOptfaP6otyX8bc0Yg=; b=nKH3BHQFsSsHTg6d79ddZLhF99zKnu4VYh4J4baVoBp6W+zggiVuAGxpAvgnQNgjMc UYHBR1C/6cQYadUzeIqp2lmv8SNx2nAy9xsBKpLx1gt76ELr+rrhAsOJK55WArM0aulg 4UNEtnJgBTtnunpU+7VrUHhPTeA10++ZsuugFQtljG6WPUfGisTrGm+Y/Ahv/fCpPEk1 h0jZiGXD3IhUMqntXPfkjyWLd0l4GPeXnUQ4sHAos5kx5WqXIri8+7fkk5oGFqrE+7G2 9fNMooogMpaqMyBey6bDyiS86Y1g/jsRiMsT5NCElZbRgcRUBw+s7W3ekKErXJOaArKx hulg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707093853; x=1707698653; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8pRLyNXA1Vc52Lsv+SyI/OT6snOptfaP6otyX8bc0Yg=; b=fo697HJbt7MwQTBP3SiomPLFD603ixUHNqtEaB8+WyVFdKk/B7+GJb4poafMhU54bA 1vy1iXw0bohJCZhHQiTDCPEUFxM1NYrjKpP/lZOdOoeIzb7LHq+Mw8gBRXWKKYaTPEK5 CwVNB2DHcetEmuJpYClVKM8zMpFrInipK/EBRvdHleckVLy+8+TI2RzrJO7gJg/ow6mc iIlKq525iMoXafz2OF9TmBEmee3bIurGs3FsLTMbdU4gxxv4b7i3wdlBp06/sHBJzPpJ W2vjijPiOuiazFgHndR+DO1+b255Ik4dE/yQ9lJ4VIZ43WxwR4GGcgqAOCGdyG1dbMUs 9b5g== X-Gm-Message-State: AOJu0YxUWgNXY6+S2Y22TMiNb42IpNsYbkCgptvmWcITJ40SeOSTYJG1 qxi0+SANtwXfPJLN+js7wUrYGGxhOKHcYXjbwShpvSkeoA90Fahq X-Received: by 2002:a19:7415:0:b0:50e:cd02:b53d with SMTP id v21-20020a197415000000b0050ecd02b53dmr4698829lfe.15.1707093852945; Sun, 04 Feb 2024 16:44:12 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXtEWkAkHkm+tUMqIYOWc5ZHxjzdMxzIraTcDNQSS1b1z8fIWYxqFaAE2AMCZUw3GIhLPTmypIs4SGmA1JSmC6+cW8KF3II/ISMxwx43/15Z7qShRtowsW1TAMyL1PxvX357kC4gLy+8C9qrrrjHO4BMjrLjxODgxzYgkHLeZWIcOQpbdxPis9HMqWDg43V3JNUlD5G4yEo9XaAgn6WRBIGw3s44gzgzJyHs05W8/gaRxArhumHNdWGbrAOjtEVaOZxyaz3Epo8jcd46vHC2K3dk49L47E1kDJAEe5jSFt2DTQ+yqowkicHPDf8RumNywuaNTfuc1lTbiUuUAZaG5Z159TKaUrfA4siRSE4SEo1EkUTFZVwjEX1K/mKS9h5qwhUQNNaU4SijUXJWfVAlBkzEsLCrfA= Received: from mobilestation ([95.79.203.166]) by smtp.gmail.com with ESMTPSA id g16-20020ac25390000000b0051149482328sm500715lfh.26.2024.02.04.16.44.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 16:44:12 -0800 (PST) Date: Mon, 5 Feb 2024 03:44:10 +0300 From: Serge Semin To: Thierry Reding Cc: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH net-next v2 3/3] net: stmmac: Configure AXI on Tegra234 MGBE Message-ID: References: <20240202-stmmac-axi-config-v2-0-64eab2bab17b@nvidia.com> <20240202-stmmac-axi-config-v2-3-64eab2bab17b@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240202-stmmac-axi-config-v2-3-64eab2bab17b@nvidia.com> On Fri, Feb 02, 2024 at 12:53:35PM +0100, Thierry Reding wrote: > From: Thierry Reding > > Allow the device to use bursts and increase the maximum number of > outstanding requests to improve performance. Measurements show an > increase in throughput of around 5x on a 1 Gbps link. > > Signed-off-by: Thierry Reding > --- > drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c > index bab57d1675df..b6bfa48f279d 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c > @@ -199,6 +199,12 @@ static void mgbe_uphy_lane_bringup_serdes_down(struct net_device *ndev, void *mg > writel(value, mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL); > } > > +static const struct stmmac_axi tegra234_mgbe_axi = { > + .axi_wr_osr_lmt = 63, > + .axi_rd_osr_lmt = 63, > + .axi_blen = { 256, }, > +}; > + > static int tegra_mgbe_probe(struct platform_device *pdev) > { > struct plat_stmmacenet_data *plat; > @@ -284,6 +290,9 @@ static int tegra_mgbe_probe(struct platform_device *pdev) > if (err < 0) > goto disable_clks; > > + /* setup default AXI configuration */ > + res.axi = &tegra234_mgbe_axi; > + > plat = devm_stmmac_probe_config_dt(pdev, &res); > if (IS_ERR(plat)) { > err = PTR_ERR(plat); The entire series can be converted to just a few lines of change: plat = devm_stmmac_probe_config_dt(pdev, res.mac); if (IS_ERR(plat)) { err = PTR_ERR(plat); goto disable_clks; } + + if (IS_ERR_OR_NULL(plat->axi)) { + plat->axi = devm_kzalloc(&pdev->dev, sizeof(*axi), GFP_KERNEL); + if (!plat->axi) { + ret = -ENOMEM; + goto disable_clks; + } + } /* else memset plat->axi with zeros if you wish */ + + plat->axi->axi_wr_osr_lmt = 63; + plat->axi->axi_rd_osr_lmt = 63; + plat->axi->axi_blen[0] = 256; plat->has_xgmac = 1; plat->flags |= STMMAC_FLAG_TSO_EN; plat->pmt = 1; Please don't overcomplicate the already overcomplicated driver with a functionality which can be reached by the default one. In this case the easiest way is to let the generic code work and then override/replace/fix/etc the retrieved values. Thus there won't be need in adding the redundant functionality and keep the generic DT-platform code a bit simpler to read. -Serge(y) > > -- > 2.43.0 > >