Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1063991pxb; Tue, 14 Sep 2021 15:38:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1kckEXHmd1UhToVjinrAz5n32MEv+oS9wTgnF5MTYNo9haLOZJ3Qehcb2lNINnV2rFIsm X-Received: by 2002:a02:5188:: with SMTP id s130mr15290979jaa.50.1631659094645; Tue, 14 Sep 2021 15:38:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631659094; cv=none; d=google.com; s=arc-20160816; b=MsaqMKD/JIZKyY0p3zDMGOMJJb6j55zfqbWeOhZIVq3HJVwUkzUaiLqC1jT7UV7B31 isak4895GHtkURRlSxo+FuFGqclQlt27pFkX8sY56p9wSxxiYvgAlvqc1CeBDXKwG79i HyV9wiKDcwhkF/MUFzagEXdpmtJzipE1X9nLqKiO0bE7KdPsPiz3NntMa9CItvZHv3yF nNBr8pX92Jrsyeo7iGi9APCVhSVZ0eC1qUpRtnbGS2fzkSjFmyBcVS6PipNad6bzGQvn zNNrqThPzGBOUmpIGEVWApRtyyx/miubRsSrh4Gbq92q1A9VT+64+RV99IX834sP5Mrm 5UUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:date:message-id:from:references:to:subject :dkim-signature; bh=8tJHrCkhKx2jagoghoX9CfvN7F39Cy3mU2Fy0DKaySM=; b=BomeVUF2yuPQJy34KjO29ZCTZXHOMW99dpzs+unxZO/iIk1LobrPCs0EAk5QHeHjCe ofquwIQic2ro/yhTPs3WGLnpWkcuFfWU+PnXL7TANWSGsbCwoTiYF06mihzC/ZqQ5/Qv rcRtuc4l9o8PHuMIy2eEblp71/Tv+AC3vawVe0HfDTiJBGvNDHUPSLkv0zVIRztY/jBn Lqu6ddZAgFzSvE++Uk/9w7kzgNY3YCElDbfIHaaTFhDnZQ93HOWrUSUnbZsRR6Y3465u I50YC1chqkjVDY1osCC5PqJx56z63ubEE5QSYbSMGQoCXSc8ixrOGVlbGhbhT1Qs3OKq csgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hauke-m.de header.s=MBO0001 header.b=TTaclUud; 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 s1si12113821jaj.97.2021.09.14.15.38.02; Tue, 14 Sep 2021 15:38:14 -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; dkim=pass header.i=@hauke-m.de header.s=MBO0001 header.b=TTaclUud; 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 S235522AbhINWiI (ORCPT + 99 others); Tue, 14 Sep 2021 18:38:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232371AbhINWiH (ORCPT ); Tue, 14 Sep 2021 18:38:07 -0400 Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [IPv6:2001:67c:2050::465:102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 729F9C061574; Tue, 14 Sep 2021 15:36:49 -0700 (PDT) Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:105:465:1:4:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4H8J9q15TVzQk2Y; Wed, 15 Sep 2021 00:36:47 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hauke-m.de; s=MBO0001; t=1631659005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8tJHrCkhKx2jagoghoX9CfvN7F39Cy3mU2Fy0DKaySM=; b=TTaclUudg2b8m4/TyA2GoWLhOexn1MYLNfEcjaRRtAjO5T5a3jCWhqDSbdNXfKJu4Pik5N SnWU+9g6stE71inKIwDWVP9fhBWKCLcxJsBOrL72mjlNPvvC2UNIkB40t5+gHjglNH9wT3 uwuBZwP9m7gixy3eFx0GJZUCAr5pdEJKCVlEpeIuZ2UZUImWpdLFbuymN6ySdPJOEVbcsN RPcQfbgsitKSj3IEjPcxPUrMUSbl73m6cIg8tHYdpp0YF062F/TNduhs8PZg1YeqA3FC/s ywrmdVu3uyYEKT6Gr1U7oVGIzqKCTKN1fEYZr4F/AxjfEPydNGv1xwXil7VT+w== Subject: Re: [PATCH net-next 5/8] net: lantiq: configure the burst length in ethernet drivers To: Aleksander Jan Bajkowski , john@phrozen.org, tsbogend@alpha.franken.de, maz@kernel.org, ralf@linux-mips.org, ralph.hempel@lantiq.com, davem@davemloft.net, kuba@kernel.org, robh+dt@kernel.org, dev@kresin.me, arnd@arndb.de, jgg@ziepe.ca, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210914212105.76186-1-olek2@wp.pl> <20210914212105.76186-5-olek2@wp.pl> From: Hauke Mehrtens Message-ID: Date: Wed, 15 Sep 2021 00:36:37 +0200 MIME-Version: 1.0 In-Reply-To: <20210914212105.76186-5-olek2@wp.pl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 8B11526D Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/14/21 11:21 PM, Aleksander Jan Bajkowski wrote: > Configure the burst length in Ethernet drivers. This improves > Ethernet performance by 58%. According to the vendor BSP, > 8W burst length is supported by ar9 and newer SoCs. > > The NAT benchmark results on xRX200 (Down/Up): > * 2W: 330 Mb/s > * 4W: 432 Mb/s 372 Mb/s > * 8W: 520 Mb/s 389 Mb/s > > Tested on xRX200 and xRX330. > > Signed-off-by: Aleksander Jan Bajkowski > --- > drivers/net/ethernet/lantiq_etop.c | 21 ++++++++++++++++++--- > drivers/net/ethernet/lantiq_xrx200.c | 21 ++++++++++++++++++--- > 2 files changed, 36 insertions(+), 6 deletions(-) > ..... > diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c > index fb78f17d734f..5d96248ce83b 100644 > --- a/drivers/net/ethernet/lantiq_xrx200.c > +++ b/drivers/net/ethernet/lantiq_xrx200.c > @@ -71,6 +71,9 @@ struct xrx200_priv { > struct net_device *net_dev; > struct device *dev; > > + int tx_burst_len; > + int rx_burst_len; > + > __iomem void *pmac_reg; > }; > > @@ -316,8 +319,8 @@ static netdev_tx_t xrx200_start_xmit(struct sk_buff *skb, > if (unlikely(dma_mapping_error(priv->dev, mapping))) > goto err_drop; > > - /* dma needs to start on a 16 byte aligned address */ > - byte_offset = mapping % 16; > + /* dma needs to start on a burst length value aligned address */ > + byte_offset = mapping % (priv->tx_burst_len * 4); > > desc->addr = mapping - byte_offset; > /* Make sure the address is written before we give it to HW */ > @@ -369,7 +372,7 @@ static int xrx200_dma_init(struct xrx200_priv *priv) > int ret = 0; > int i; > > - ltq_dma_init_port(DMA_PORT_ETOP); > + ltq_dma_init_port(DMA_PORT_ETOP, priv->tx_burst_len, rx_burst_len); > > ch_rx->dma.nr = XRX200_DMA_RX; > ch_rx->dma.dev = priv->dev; > @@ -478,6 +481,18 @@ static int xrx200_probe(struct platform_device *pdev) > if (err) > eth_hw_addr_random(net_dev); > > + err = device_property_read_u32(dev, "lantiq,tx-burst-length", &priv->tx_burst_len); > + if (err < 0) { > + dev_err(dev, "unable to read tx-burst-length property\n"); > + return err; > + } > + > + err = device_property_read_u32(dev, "lantiq,rx-burst-length", &priv->rx_burst_len); > + if (err < 0) { > + dev_err(dev, "unable to read rx-burst-length property\n"); > + return err; > + } > + I would prefer if you would hard code these values to 8 for the xrx200 driver. All SoCs with this IP block should support this. > /* bring up the dma engine and IP core */ > err = xrx200_dma_init(priv); > if (err) > Hauke