Skip to content
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

Renesas : Improve LWIP speed #7683

Merged
merged 2 commits into from
Sep 2, 2018
Merged

Conversation

TomoYamanaka
Copy link
Contributor

@TomoYamanaka TomoYamanaka commented Aug 3, 2018

Description

For speeding up of LWIP on RZ/A1, I added four new config processes in mbed_lib.json and lwipopts.h, overriden the values.
Since RZ/A1 incorporates a large-capacity memory, can actualize speeding up by running with the overriden value.

Pull request type

[x] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

For speeding up of LWIP in RZ/A1, I added four new config processes in mbed_lib.json and lwipopts.h, overriden those values.
Since RZ/A1 incorporates a large memory, can actualize speeding up by running with the override value.
Also those new config processes will be helpful for more customize.
@0xc0170 0xc0170 requested a review from a team August 3, 2018 07:48
@SeppoTakalo
Copy link
Contributor

@mikaleppanen Please review

@@ -139,6 +139,26 @@

#define LWIP_RAM_HEAP_POINTER lwip_ram_heap

// Number of simultaneously queued TCP segments.
#ifdef MBED_CONF_LWIP_MEMP_NUM_TCP_SEG
Copy link
Contributor

Choose a reason for hiding this comment

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

Why #ifdef

If we use Mbed compilation, these values always come from mbed_lib.json

Copy link
Contributor Author

@TomoYamanaka TomoYamanaka Aug 3, 2018

Choose a reason for hiding this comment

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

I think that there is no setting process in mbed_lib.json. However I'd like to set the customized value when coming from the mbed_lib.json and set the default value when not coming. Thus, I added #ifdef process to this file as with other elements.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is consistent with other settings - basically not setting it in the JSON lets lwIP do its own default, which sometimes is not a simple constant we could express in the JSON.

Or could we - I guess you could define something as "5 * TCP_MSS". Maybe we could put all lwIP's defaults in as explicit JSON? I think it was only really those derived values that put us off doing that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kjbracey-arm
Thank you for your comments, and may I ask you a bit?
What does "5 * TCP_MSS" indicate? is it related with the value of "tcp-snd-buf" and "tcp-wnd" ?
If so, I defined them as "8 * TCP_MSS"(is customize value for RZ/A1) in json file.

@@ -72,6 +72,22 @@
"help": "Maximum number of open UDPSocket instances allowed, including one used internally for DNS. Each requires 84 bytes of pre-allocated RAM",
"value": 4
},
"memp-num-tcp-seg": {
"help": "Number of simultaneously queued TCP segments. Current default (used if null here) is set to 16 in opt.h, unless overridden by target Ethernet drivers.",
"value": null
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we could use default values here, instead of null to get rid of #ifdef in lwipopts.h

Copy link
Contributor Author

@TomoYamanaka TomoYamanaka Aug 3, 2018

Choose a reason for hiding this comment

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

I'd like to use the customized value(32) not default value(16) against this element for speeding up of RZ/A1. Thus by setting this element as null and overriding the value for RZ/A1 at following process, the other boards excepting RZ/A1 use default value and RZ/A1 use customized value.

@@ -132,6 +148,11 @@
"tcpip-thread-stacksize": 1328,
"default-thread-stacksize": 640,
"ppp-thread-stacksize": 896,
"memp-num-tcp-seg": 32,
"tcp-mss": 1460,

Choose a reason for hiding this comment

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

Should this be at max 1440 to make space for ipv6 header which fixed size is 40 bytes.

@TomoYamanaka
Copy link
Contributor Author

@mikaleppanen Thank you for your suggestion. I updated the override value.

@TomoYamanaka
Copy link
Contributor Author

@mikaleppanen Any additional step required to this PR?

@TomoYamanaka
Copy link
Contributor Author

@SeppoTakalo @kjbracey-arm Any additional required step ? Could you approval if no problem ?

@TomoYamanaka
Copy link
Contributor Author

@SeppoTakalo @mikaleppanen
Thank you for your approval.

@0xc0170
Could you trigger the CI test?

@TomoYamanaka
Copy link
Contributor Author

TomoYamanaka commented Aug 22, 2018

@0xc0170 or Someone of @ARMmbed/mbed-os-ipcore
Anything else to go ahead this PR ? I will appreciate if you can trigger CI test.

@TomoYamanaka
Copy link
Contributor Author

@SeppoTakalo @mikaleppanen @kjbracey-arm
Is there required anything step to go ahead this PR? If nothing, could you remove review label?
This PR wil make GR-PEACH's users more activie.

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 27, 2018

/morph build

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 27, 2018

@TomoYamanaka In CI now. One question while you mentioned more active, there's one bug I've checked today: #6975. Can you please review it

@mbed-ci
Copy link

mbed-ci commented Aug 27, 2018

Build : SUCCESS

Build number : 2925
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7683/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Aug 27, 2018

@TomoYamanaka
Copy link
Contributor Author

TomoYamanaka commented Aug 28, 2018

@0xc0170
Thank you for triggering CI test. I will check issue #6975.

@mbed-ci
Copy link

mbed-ci commented Aug 28, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 28, 2018

/morph test

@mbed-ci
Copy link

mbed-ci commented Aug 28, 2018

@cmonr
Copy link
Contributor

cmonr commented Aug 28, 2018

@AnotherButler Do these config additions also need docs to go with them?

@AnotherButler
Copy link
Contributor

@cmonr Yes, the storage config page needs to be updated with the additions:

https://github.com/ARMmbed/mbed-os-5-docs/blob/development/docs/reference/configuration/Connectivity.md

If general, #ifdefs should be converted to use the config system, but it sounds like there are reasons I don't really understand why we're not doing that here.

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 29, 2018

If general, #ifdefs should be converted to use the config system, but it sounds like there are reasons I don't really understand why we're not doing that here.

As I understand, we use config here but need to translate the values to the lwip macros thus ifdef in this PR.

@SeppoTakalo Please correct me if wrong. Can you send the PR for updating the connectivity page?

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 2, 2018

@ARMmbed/mbed-os-ipcore Can you review please again?

@cmonr cmonr merged commit 0edce1d into ARMmbed:master Sep 2, 2018
@TomoYamanaka TomoYamanaka deleted the Improve_LWIP branch September 3, 2018 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants