public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Aleksander Bajkowski <olek2@wp.pl>
To: Hauke Mehrtens <hauke@hauke-m.de>,
	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
Subject: Re: [PATCH net-next 5/8] net: lantiq: configure the burst length in ethernet drivers
Date: Sun, 19 Sep 2021 20:16:00 +0200	[thread overview]
Message-ID: <98677485-0bdc-d628-6cc7-417c8ed1a334@wp.pl> (raw)
In-Reply-To: <cdfd53e7-ea43-60a4-7150-11ad166ba2d1@hauke-m.de>

Hi Hauke,

On 9/15/21 12:36 AM, Hauke Mehrtens wrote:
> 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 <olek2@wp.pl>
>> ---
>>   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.
OK. I can hard code 8W burst length in the driver for xrx200. Burst length as a configurable parameter is really only needed in the lantiq_etop driver.
> 
>>       /* bring up the dma engine and IP core */
>>       err = xrx200_dma_init(priv);
>>       if (err)
>>
> 
> Hauke
Aleksander

  reply	other threads:[~2021-09-19 18:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14 21:20 [PATCH net-next 1/8] MIPS: lantiq: dma: add small delay after reset Aleksander Jan Bajkowski
2021-09-14 21:20 ` [PATCH net-next 2/8] MIPS: lantiq: dma: reset correct number of channel Aleksander Jan Bajkowski
2021-09-14 21:21 ` [PATCH net-next 3/8] MIPS: lantiq: dma: fix burst length for DEU Aleksander Jan Bajkowski
2021-09-14 21:21 ` [PATCH net-next 4/8] MIPS: lantiq: dma: make the burst length configurable by the drivers Aleksander Jan Bajkowski
2021-09-14 22:40   ` Hauke Mehrtens
2021-09-14 21:21 ` [PATCH net-next 5/8] net: lantiq: configure the burst length in ethernet drivers Aleksander Jan Bajkowski
2021-09-14 22:36   ` Hauke Mehrtens
2021-09-19 18:16     ` Aleksander Bajkowski [this message]
2021-09-14 21:21 ` [PATCH net-next 6/8] dt-bindings: net: lantiq-xrx200-net: convert to the json-schema Aleksander Jan Bajkowski
2021-09-14 21:21 ` [PATCH net-next 7/8] dt-bindings: net: lantiq,etop-xway: Document Lantiq Xway ETOP bindings Aleksander Jan Bajkowski
2021-09-14 21:21 ` [PATCH net-next 8/8] dt-bindings: net: lantiq: Add the burst length properties Aleksander Jan Bajkowski
2021-09-15 10:30 ` [PATCH net-next 1/8] MIPS: lantiq: dma: add small delay after reset patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98677485-0bdc-d628-6cc7-417c8ed1a334@wp.pl \
    --to=olek2@wp.pl \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=dev@kresin.me \
    --cc=devicetree@vger.kernel.org \
    --cc=hauke@hauke-m.de \
    --cc=jgg@ziepe.ca \
    --cc=john@phrozen.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    --cc=ralph.hempel@lantiq.com \
    --cc=robh+dt@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox