Skip to contentSkip to conversation

am335x: cpsw: optimize cpsw_recv to increase network performance

PATCH In review Vladimir Koutny 4 participants 11 messages Nov 28, 2013 – Dec 12, 2013 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 am335x: cpsw: optimize cpsw_recv to increase network performance

In 48ec5291, only TX path was optimized; this does the same also for RX path. This results in huge increase of TFTP throughput on custom am3352 board (from 312KiB/s to 1.8MiB/s) and eliminates occasional transfer timeouts.

Cc Mugunthan V N <[email protected]>
Cc Joe Hershberger <[email protected]>
Cc Tom Rini <[email protected]>
---
 drivers/net/cpsw.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/cpsw.c +1 -1
index 39240d9..50167aa 100644
@@ -914,7 +914,7 @@ static int cpsw_recv(struct eth_device *dev)
 	void *buffer;
 	int len;
 
-	cpsw_update_link(priv);
+	cpsw_check_link(priv);
 
 	while (cpdma_process(priv, &priv->rx_chan, &buffer, &len) >= 0) {
 		invalidate_dcache_range((unsigned long)buffer,

--
1.7.10.4

#1 lore raw

PATCH 1/1 am335x: cpsw: optimize cpsw_recv to increase network performance

Quoted 9 lines · Vladimir Koutny

In 48ec5291, only TX path was optimized; this does the same also for RX path. This results in huge increase of TFTP throughput on custom am3352 board (from 312KiB/s to 1.8MiB/s) and eliminates occasional transfer timeouts.

Cc Mugunthan V N <[email protected]>
Cc Joe Hershberger <[email protected]>
Cc Tom Rini <[email protected]>

Regards
Mugunthan V N

#2 lore raw
In reply to Vladimir Koutny
Quoted 9 lines · Vladimir Koutny

In 48ec5291, only TX path was optimized; this does the same also for RX path. This results in huge increase of TFTP throughput on custom am3352 board (from 312KiB/s to 1.8MiB/s) and eliminates occasional transfer timeouts.

Cc Mugunthan V N <[email protected]>
Cc Joe Hershberger <[email protected]>
Cc Tom Rini <[email protected]>

Applied to u-boot-ti/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131204/42a47b76/attachment.pgp>
#3 lore raw
Quoted 7 lines · Tom Rini
Quoted 5 lines · Vladimir Koutny

In 48ec5291, only TX path was optimized; this does the same also for RX path. This results in huge increase of TFTP throughput on custom am3352 board (from 312KiB/s to 1.8MiB/s) and eliminates occasional transfer timeouts.

Quoted 6 lines
Quoted 4 lines
Cc Mugunthan V N <[email protected]>
Cc Joe Hershberger <[email protected]>
Cc Tom Rini <[email protected]>

Applied to u-boot-ti/master, thanks!

I just tested on dxr2 (AM3352 based board) with latest mainline U-Boot. And the network performance is a bit better. But not as good as yours. Here my numbers:

Without this patch: ~400 KiB/s
With this patch: ~570 KiB/s

Any ideas what might be missing on my platform? Why the speed is not as good?

Thanks,
Stefan

#4 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 15 lines · Stefan Roese
Quoted 7 lines · Tom Rini
Quoted 5 lines · Vladimir Koutny

In 48ec5291, only TX path was optimized; this does the same also for RX path. This results in huge increase of TFTP throughput on custom am3352 board (from 312KiB/s to 1.8MiB/s) and eliminates occasional transfer timeouts.

Quoted 6 lines
Quoted 4 lines

Signed-off-by: Vladimir Koutny <[email protected]> Cc: Mugunthan V N <[email protected]> Cc: Joe Hershberger <[email protected]> Cc: Tom Rini <[email protected]>

Applied to u-boot-ti/master, thanks!

Quoted 8 lines

I just tested on dxr2 (AM3352 based board) with latest mainline U-Boot. And the network performance is a bit better. But not as good as yours. Here my numbers:

Without this patch: ~400 KiB/s With this patch: ~570 KiB/s

Any ideas what might be missing on my platform? Why the speed is not as good?

I only got a small increase as well until I also grabbed the dcache enable patch. I need to find some time today to clean out the TI queue again.

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSqa37AAoJENk4IS6UOR1W0eUP/2XiYEeOzfnBCQQkwnE4UvuL 6+oQFS0BLVYpIxyWSpDbxua+lPdzO7mb7A/ak/cw9SePauhtYDPKHIQXHah4hhjq 86E/kCrB7CYekerKKFowZTdJd+y108BSi9IuvwS7AnFXL9E8B/cUOY8s5vSASSRP zv9b4iJi6ecDIvXDqegFxdwbio2t6ykE1bNEHsPBuSgyVY6wvM80Gh4SUPHTAZTM o7Y9VeAzkvdJvOLPq/Yo4sZo8ofVHDiK9ar35pbpOdA6ZFWIcXyouQtoq273zFix F3Wi+sk1+gaX5mTuyI+nQumDHmHHNDT2ekuUHIZ63gw4OP/Xf/2kiw8gRjBePlB1 kPLYtKSNXFrBf1kDwEPxXLPvw3r3+yIJDZ43zeB5CFxjkjC/drNiUDaZc1w4BLQf e7wfK/oygU3smfg4AHe30mK9VzYoxjOHnP8VLLKtxEN9Gky+PF2I2iKbjI/97Hhr jX4ipiOtIdejv8u6bbotwgb8cUoAx/uhIAYPlBR9qRXOFwy9YCigCJRVlxqKsdyc S7GCdpt64Ib1pdI0SbLlgdLQMcLdCjAT+2/gxOp1gjMiCVj7GYYC6Xn1zL3S6EbL ErWzREBO6hrTwkFYubVYfsKj6oOP6GeuVFMLPynl0OIiWWlulpvCLbUMqz5LeBjg 8suZdwgdgPPs0s4vDw6o
=esmE
-----END PGP SIGNATURE-----

#5 lore raw
Quoted 5 lines · Tom Rini
Quoted 3 lines · Stefan Roese

I just tested on dxr2 (AM3352 based board) with latest mainline U-Boot. And the network performance is a bit better. But not as good as yours. Here my numbers:

Quoted 9 lines
Quoted 4 lines

Without this patch: ~400 KiB/s With this patch: ~570 KiB/s

Any ideas what might be missing on my platform? Why the speed is not as good?

I only got a small increase as well until I also grabbed the dcache enable patch. I need to find some time today to clean out the TI queue again.

Good point - indeed I had I/D caches enabled for other reasons already (md5/sha1 caclulations, ..)

Regards,
Vlado

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131212/d4a743af/attachment.pgp>

#6 lore raw
Quoted 12 lines · Vladimir Koutny
Quoted 10 lines · Tom Rini
Quoted 8 lines · Stefan Roese

I just tested on dxr2 (AM3352 based board) with latest mainline U-Boot. And the network performance is a bit better. But not as good as yours. Here my numbers:

Without this patch: ~400 KiB/s With this patch: ~570 KiB/s

Any ideas what might be missing on my platform? Why the speed is not as good?

Quoted 7 lines
Quoted 4 lines

I only got a small increase as well until I also grabbed the dcache enable patch. I need to find some time today to clean out the TI queue again.

Good point - indeed I had I/D caches enabled for other reasons already (md5/sha1 caclulations, ..)

Hmmm. I expected that caches are enabled already. Since I didn't see any "D-Cache disabled message" in the startup log.

If this is not that case, then such cache support would be greatly appreciated. :)

Thanks,
Stefan

#7 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 18 lines · Stefan Roese
Quoted 17 lines · Vladimir Koutny
Quoted 14 lines · Tom Rini
Quoted 8 lines · Stefan Roese

I just tested on dxr2 (AM3352 based board) with latest mainline U-Boot. And the network performance is a bit better. But not as good as yours. Here my numbers:

Without this patch: ~400 KiB/s With this patch: ~570 KiB/s

Any ideas what might be missing on my platform? Why the speed is not as good?

I only got a small increase as well until I also grabbed the dcache enable patch. I need to find some time today to clean out the TI queue again.

Quoted 8 lines
Quoted 2 lines

Good point - indeed I had I/D caches enabled for other reasons already (md5/sha1 caclulations, ..)

Hmmm. I expected that caches are enabled already. Since I didn't see any "D-Cache disabled message" in the startup log.

If this is not that case, then such cache support would be greatly appreciated. :)

Check your logs? Unless you've also got a patched tree you should see "WARNING: Caches disabled" or so, because, yeah, oops, am335x got in with caches disabled, and then I forgot about it.

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSqbyjAAoJENk4IS6UOR1WRXUP/A+c9XNtWkdMGRNPRtzxog+r v0R00LtTQGKZuM3EFPUX93rJK7fmRPIN8QSxKptSGIib0ncJ92qkWh5S2bIsWx+Z qKn2E1/xeUDuwpg+el0998yg1geStWoegSQ1LlRqlLvueJhw0etaHAJErrKABUvN wMTx7r4DELcRlgjKNox1wxogeOiIwlnpHOBAzkrabS4HwEkQWTqQQRGvxE4KVSUx PAJHQbo1F2kriJmfSFpyNG7qwfK1mpUQUns9qYiNtrpRpaHgaioWM6VFnaNj7YuC XC2Wa/0vmaoizo3FwLXFQ/i+PWp9HoIEkzm2ZO+oMuDBXjjPv0nMz4fWW1JEjmv8 N6tWNelohOZJ4GU3VGjQbulzhH28L0S/g/RSjhM4iliX5wSsZWEPNI+wZqjI4Bq5 uZ6o810f06fc3fCNbILzDqnIAoCxG06eIL04O/wKK0T2CypCGI4w+hRKtR8yKCvC RUGZNnoIxLCnByqPiOUuZPpIYpzhK7jvmYQwQ7XUMWRVFOkC5ae1Mu7IH0l0h2Bl k6mhYNahLQMasQ4ex7R5Ebf+Uw2UOcuqHuZ5hh4n9HyotC68F3+nzFE3tdDSfYMy 0hAwCjRwCYYdvmvu6t/aG4Hp5FIetwpVjtjzJnSxGyDAft/WSwES/XZGA0SqkQVK XuRoWiP/cFU5qcZUL+2y
=Kekj
-----END PGP SIGNATURE-----

#8 lore raw
Quoted 6 lines · Tom Rini
Quoted 6 lines
Quoted 2 lines

Good point - indeed I had I/D caches enabled for other reasons already (md5/sha1 caclulations, ..)

Hmmm. I expected that caches are enabled already. Since I didn't see any "D-Cache disabled message" in the startup log.

Quoted 6 lines
Quoted 2 lines

If this is not that case, then such cache support would be greatly appreciated. :)

Check your logs? Unless you've also got a patched tree you should see "WARNING: Caches disabled" or so, because, yeah, oops, am335x got in with caches disabled, and then I forgot about it.

This is what I got currently (mainline):

U-Boot 2014.01-rc1-00165-ge03c76c (Dec 12 2013 - 09:26:20)

I2C:   ready
DRAM:  128 MiB
Enable d-cache
DFU USB: VID = 0x 908, PID = 0x 2d2
NAND:  256 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Net:   cpsw

So caches seem to be enabled, right? Or is i-cache still missing?

Thanks,
Stefan

#9 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 26 lines · Stefan Roese
Quoted 6 lines · Tom Rini
Quoted 6 lines
Quoted 2 lines

Good point - indeed I had I/D caches enabled for other reasons already (md5/sha1 caclulations, ..)

Hmmm. I expected that caches are enabled already. Since I didn't see any "D-Cache disabled message" in the startup log.

Quoted 6 lines
Quoted 2 lines

If this is not that case, then such cache support would be greatly appreciated. :)

Check your logs? Unless you've also got a patched tree you should see "WARNING: Caches disabled" or so, because, yeah, oops, am335x got in with caches disabled, and then I forgot about it.

This is what I got currently (mainline):

U-Boot 2014.01-rc1-00165-ge03c76c (Dec 12 2013 - 09:26:20)

I2C:   ready
DRAM:  128 MiB
Enable d-cache
DFU USB: VID = 0x 908, PID = 0x 2d2
NAND:  256 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Net:   cpsw
Quoted 1 line

So caches seem to be enabled, right? Or is i-cache still missing?

Ug, the siemens board code enables dcache on its own. Need to take care of that. That said, it's the same one-liner the rest of the patches do, sans printf. I think you may need to do more investigation.

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSqb7NAAoJENk4IS6UOR1Wa0sQAIDZPzpzMFi43rjUS9aB79m/ +v/sr5ZbZky6h9PRvZ4PRTODLQ5SQkfshgzLQvLORCECdoFqMbrHW7JVwP+m52Oi WVP9tuyAy6L5LyNBtYyjpTCfOoqJS1XciGtQor8kfVIo9xWuJXC2SxPH1z5jy0UE z/YQZKF0IZmCVuK1DZ1faQUCx69FAzI7kWZoribWas9z7qc4jIkx+ksWac1YPr7r aDrcn69r1HSe+AcYbI6Tyfqmp7ve+I3saMPNs/t6b8dAPP4/SkBJI9oM1H4jzah9 DNQoMLO60Ht6o6QFTPp1+GL1Vx/dygsfHPxKEKglmxBumDx5JVDP2YjQxjIS+6Eq /KVYolam1MY3QOVYXxAIO3TVPdlFZkGry/6nWrUnufGWRS5L3jA7onqLhvulQX5v OUQUd4QVGmitDOFk07MALZYJiHqAD4nM0nvQeuQFEskMbZMc6I8Vmoy+PIIfBuAZ gUMy5/DHXxv+29+ca7SyQo0BKhizDhqcQWIgI0IdKbo4FfcviNQTy0LClrLLnEOr FGnUo85h21G9iTkbiH2BU05Q/oaHdsZS9GAFd5rqOUipE7JbDU4U2Vf1iTSAKG/9 HQHUsIcqx62CWkzR9c3arJC8aXlTuIsRxtKSpLQNtvrvovhIvQ7mKg2MmqJ0GnQ8 yL2GqrvbCwThcoNLM3SY
=56fr
-----END PGP SIGNATURE-----

#10 lore raw
Quoted 16 lines · Tom Rini
Quoted 16 lines
Quoted 3 lines

Check your logs? Unless you've also got a patched tree you should see "WARNING: Caches disabled" or so, because, yeah, oops, am335x got in with caches disabled, and then I forgot about it.

This is what I got currently (mainline):

U-Boot 2014.01-rc1-00165-ge03c76c (Dec 12 2013 - 09:26:20)

I2C:   ready
DRAM:  128 MiB
Enable d-cache
DFU USB: VID = 0x 908, PID = 0x 2d2
NAND:  256 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Net:   cpsw
Quoted 5 lines
Quoted 1 line

So caches seem to be enabled, right? Or is i-cache still missing?

Ug, the siemens board code enables dcache on its own. Need to take care of that. That said, it's the same one-liner the rest of the patches do, sans printf. I think you may need to do more investigation.

Yes, will do (once the issue gets more pressing).

Thanks,
Stefan