Skip to content

Ethernet driver and LWIP wrapper fixes #151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Oct 19, 2023

Conversation

andreagilardoni
Copy link
Contributor

@andreagilardoni andreagilardoni commented Sep 26, 2023

This PR aims to fix the issues that made ethernet drivers unrealiable and unable to process complex data transfers, like file downloads. This should improve stability on all drivers using lwip wrapper.

Further improvements can be made in order to have better performances and stability, but they require a deeper knowledge of renesas fsp mechanism for RX zero copy

@CLAassistant
Copy link

CLAassistant commented Sep 26, 2023

CLA assistant check
All committers have signed the CLA.

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Sep 26, 2023
@andreagilardoni andreagilardoni marked this pull request as draft October 2, 2023 12:16
@andreagilardoni
Copy link
Contributor Author

This fix breaks Wifi on C33.

This fix works well with ethernet, that can leverage lwip buffer, but breaks wifi, because it uses its own queue inside of the driver.

The wifi driver should be changed and made similar to the ethernet driver and mimic its behaviour.

@andreagilardoni andreagilardoni marked this pull request as ready for review October 4, 2023 09:45
@andreagilardoni
Copy link
Contributor Author

After some testing i discovered the following:

Drivers still need improvements, and further fine tuning of lwip library are required in order to work properly with bigger files.

Performance needs improvement, since at the application layer we use only the <10% of the bandwidth used at the driver level. This is probably related to:

  • application layer needs to be improved
  • lwip needs a better tuning in order to fit the device constraints
  • lwip wrapper has some issues that are not addressed by this PR

The following is an example of output from an http File download of arbitrary size.

Application layer: 2146882/85088572 speed: 171.19 KB/s
RX bytes:    2553168, calls:       4452, failed:         98, failed alloc:         98, failed inputs:          0
TX bytes:     233394, calls:       4323, failed:          2
RX time:      62.47us speed:    2059.31KB/s
TX time:       4.26us speed:     187.03KB/s

Using the following ping command we can test the board with a sketch that initializes Ethernet.

sudo ping <BOARD_IP> -i 0.00001 -s 1450

Here we can see that the Driver is able to handle that packets and reach a throughput of 8592.56KB/s (67Mbit/s), and the the driver with lwip is able to handle the packets.

RX bytes:   67907361, calls:      45672, failed:          0, failed alloc:          0, failed inputs:          0
TX bytes:   67865334, calls:      45502, failed:         11
RX time:     124.04us speed:    8592.56KB/s
TX time:      22.60us speed:    8589.44KB/s

@andreagilardoni andreagilardoni requested a review from pennam October 5, 2023 12:19
@andreagilardoni andreagilardoni changed the title Ethernet driver and LWIP wrapper fixes [WIRE-98] Ethernet driver and LWIP wrapper fixes Oct 11, 2023
@facchinm facchinm merged commit 4034e09 into arduino:main Oct 19, 2023
Copy link
Contributor

@pennam pennam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Tested with Cloud Sketches both WiFi and Ethernet works.
👍 Fixed file download with ethernet (no TLS)

@andreagilardoni andreagilardoni deleted the ethernet-fixes branch October 23, 2023 08:59
@per1234 per1234 changed the title [WIRE-98] Ethernet driver and LWIP wrapper fixes Ethernet driver and LWIP wrapper fixes Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants