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

Add LWIP RIO patch to patch dir. #12623

Merged
merged 5 commits into from
Dec 7, 2021
Merged

Conversation

cecille
Copy link
Contributor

@cecille cecille commented Dec 6, 2021

Problem

We have an lwip patch for RIO that hasn't been approved to mainline yet.

Change overview

Add external lwip patch to tree per SWTT request. Also adding readme.

Testing

File is for information purposes only. Patch was tested on M5 using lwip ping. This patch is not part of the matter SDK proper so doesn't have matter unit tests.

@todo
Copy link

todo bot commented Dec 6, 2021

implement preferred routes.

- /* @todo implement preferred routes.
- struct route_option * route_opt;
- route_opt = (struct route_option *)buffer;*/
-
+ case ND6_OPTION_TYPE_ROUTE_INFO: {
+#if LWIP_ND6_SUPPORT_RIO
+ struct route_option *route_opt;
+ uint32_t route_lifetime;
+ uint8_t prefix_length;
+ uint8_t preference;
+ ip6_addr_t prefix;


This comment was generated by todo based on a todo comment in 4c1c074 in #12623. cc @cecille.

@boring-cyborg boring-cyborg bot added the lwip label Dec 6, 2021
@todo
Copy link

todo bot commented Dec 6, 2021

match preferred routes!! (must implement ND6_OPTION_TYPE_ROUTE_INFO) */

- LWIP_UNUSED_ARG(ip6addr); /* @todo match preferred routes!! (must implement ND6_OPTION_TYPE_ROUTE_INFO) */
+#if LWIP_ND6_SUPPORT_RIO
+ /* Check first if we have a route explicitly set for this address from a
+ RIO. This works because we're only considering 64-bit prefixes in RIO
+ and the prefix option. If we later move to support non-64 prefixes,
+ these will need to generate candidate routers and rank based on prefix
+ length */
+ for (i = 0; i < LWIP_ND6_NUM_ROUTES; ++i) {
+ /* For now, we assume all route prefixes are /64 */
+ if (ip6_addr_isany(&route_list[i].prefix)) {
+ continue;


This comment was generated by todo based on a todo comment in 4c1c074 in #12623. cc @cecille.

@todo
Copy link

todo bot commented Dec 6, 2021

Implement preferences. */

+ /* TODO: Implement preferences. */
+ if (netif != NULL && router_netif != netif) {
+ continue;
+ }
+ /* TODO: If we're up, but not reacheable, then what? */
+ if (default_router_list[router_idx].neighbor_entry->state !=
+ ND6_INCOMPLETE) {
+ return router_idx;
+ }
+ }
+ }


This comment was generated by todo based on a TODO comment in 4c1c074 in #12623. cc @cecille.

@todo
Copy link

todo bot commented Dec 6, 2021

If we're up, but not reacheable, then what? */

+ /* TODO: If we're up, but not reacheable, then what? */
+ if (default_router_list[router_idx].neighbor_entry->state !=
+ ND6_INCOMPLETE) {
+ return router_idx;
+ }
+ }
+ }
+#else
+ LWIP_UNUSED_ARG(ip6addr);
+#endif


This comment was generated by todo based on a TODO comment in 4c1c074 in #12623. cc @cecille.

@todo
Copy link

todo bot commented Dec 6, 2021

implement default router preference */

/* @todo: implement default router preference */
@@ -1770,7 +1881,6 @@ nd6_find_route(const ip6_addr_t *ip6addr)
{
struct netif *netif;
s8_t i;
-
/* @todo decide if it makes sense to check the destination cache first */
/* Check if there is a matching on-link prefix. There may be multiple
@@ -1935,6 +2045,57 @@ nd6_new_onlink_prefix(const ip6_addr_t *prefix, struct netif *netif)


This comment was generated by todo based on a todo comment in 4c1c074 in #12623. cc @cecille.

@todo
Copy link

todo bot commented Dec 6, 2021

decide if it makes sense to check the destination cache first */

/* @todo decide if it makes sense to check the destination cache first */
/* Check if there is a matching on-link prefix. There may be multiple
@@ -1935,6 +2045,57 @@ nd6_new_onlink_prefix(const ip6_addr_t *prefix, struct netif *netif)
return -1;
}
+#if LWIP_ND6_SUPPORT_RIO
+/**
+ * Find the cached entry for an RIO configured route.
+ *


This comment was generated by todo based on a todo comment in 4c1c074 in #12623. cc @cecille.

@todo
Copy link

todo bot commented Dec 6, 2021

add support for non- /64 prefixes */

+ /* TODO: add support for non- /64 prefixes */
+ LWIP_UNUSED_ARG(prefix_len);
+ /* Look for prefix in list. */
+ for (i = 0; i < LWIP_ND6_NUM_ROUTES; ++i) {
+ if (ip6_addr_netcmp(&route_list[i].prefix, prefix)) {
+ return i;
+ }
+ }
+
+ /* Entry not available. */
+ return -1;


This comment was generated by todo based on a TODO comment in 4c1c074 in #12623. cc @cecille.

@todo
Copy link

todo bot commented Dec 6, 2021

If we're up, but not reacheable, then what? */

+ /* TODO: If we're up, but not reacheable, then what? */
+ if (default_router_list[router_idx].neighbor_entry->state !=
+ ND6_INCOMPLETE) {
+ return router_idx;
+ }
+ }
+ }
+#else
+ LWIP_UNUSED_ARG(ip6addr);
+#endif


This comment was generated by todo based on a TODO comment in 9d087f7 in #12623. cc @cecille.

@github-actions
Copy link

github-actions bot commented Dec 6, 2021

PR #12623: Size comparison from fd6704f to 9d087f7

Full report (39 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section fd6704f 9d087f7 change % change
efr32 lighting-app BRD4161A (read only) 798568 798568 0 0.0
(read/write) 120648 120648 0 0.0
.bss 118816 118816 0 0.0
.data 1828 1828 0 0.0
.text 798560 798560 0 0.0
BRD4161A+rpc (read only) 826536 826536 0 0.0
(read/write) 138952 138952 0 0.0
.bss 137016 137016 0 0.0
.data 1936 1936 0 0.0
.text 826528 826528 0 0.0
lock-app BRD4161A (read only) 773636 773636 0 0.0
(read/write) 118580 118580 0 0.0
.bss 116792 116792 0 0.0
.data 1788 1788 0 0.0
.text 773628 773628 0 0.0
window-app BRD4161A (read only) 775892 775892 0 0.0
(read/write) 118784 118784 0 0.0
.bss 116992 116992 0 0.0
.data 1792 1792 0 0.0
.text 775884 775884 0 0.0
esp32 all-clusters-app c3devkit (read only) 852314 852314 0 0.0
(read/write) 1290914 1290914 0 0.0
.dram0.bss 56352 56352 0 0.0
.dram0.data 14052 14052 0 0.0
.flash.rodata 169520 169520 0 0.0
.flash.text 852314 852314 0 0.0
.iram0.text 61394 61394 0 0.0
m5stack (read only) 922223 922223 0 0.0
(read/write) 424356 424356 0 0.0
.dram0.bss 61736 61736 0 0.0
.dram0.data 34016 34016 0 0.0
.flash.rodata 197324 197324 0 0.0
.flash.text 916839 916839 0 0.0
.iram0.text 122943 122943 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 731812 731812 0 0.0
.bss 79312 79312 0 0.0
.data 1860 1860 0 0.0
.text 644840 644840 0 0.0
lock-app k32w061+debug (read/write) 621980 621980 0 0.0
.bss 69976 69976 0 0.0
.data 1828 1828 0 0.0
.text 544376 544376 0 0.0
shell k32w061+debug (read/write) 687872 687872 0 0.0
.bss 81624 81624 0 0.0
.data 1800 1800 0 0.0
.text 598648 598648 0 0.0
linux all-clusters-app debug (read only) 1872649 1872649 0 0.0
(read/write) 124336 124336 0 0.0
.bss 50672 50672 0 0.0
.data 1120 1120 0 0.0
.data.rel.ro 67104 67104 0 0.0
.dynamic 592 592 0 0.0
.got 4120 4120 0 0.0
.init 27 27 0 0.0
.init_array 696 696 0 0.0
.rodata 152245 152245 0 0.0
.text 1577298 1577298 0 0.0
bridge-app debug+rpc (read only) 1444117 1444117 0 0.0
(read/write) 74648 74648 0 0.0
.bss 36272 36272 0 0.0
.data 1728 1728 0 0.0
.data.rel.ro 31560 31560 0 0.0
.dynamic 592 592 0 0.0
.got 3992 3992 0 0.0
.init 27 27 0 0.0
.init_array 480 480 0 0.0
.rodata 121628 121628 0 0.0
.text 1217589 1217589 0 0.0
chip-tool debug (read only) 6638421 6638421 0 0.0
(read/write) 199752 199752 0 0.0
.bss 34536 34536 0 0.0
.data 1024 1024 0 0.0
.data.rel.ro 158520 158520 0 0.0
.dynamic 592 592 0 0.0
.got 4496 4496 0 0.0
.init 27 27 0 0.0
.init_array 568 568 0 0.0
.rodata 311544 311544 0 0.0
.text 5922149 5922149 0 0.0
lighting-app debug+rpc (read only) 1729265 1729265 0 0.0
(read/write) 107680 107680 0 0.0
.bss 41968 41968 0 0.0
.data 1280 1280 0 0.0
.data.rel.ro 59056 59056 0 0.0
.dynamic 608 608 0 0.0
.got 4144 4144 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 142289 142289 0 0.0
.text 1444306 1444306 0 0.0
ota-provider-app debug (read only) 1400777 1400777 0 0.0
(read/write) 72848 72848 0 0.0
.bss 38848 38848 0 0.0
.data 928 928 0 0.0
.data.rel.ro 27880 27880 0 0.0
.dynamic 592 592 0 0.0
.got 4056 4056 0 0.0
.init 27 27 0 0.0
.init_array 520 520 0 0.0
.rodata 122984 122984 0 0.0
.text 1173106 1173106 0 0.0
ota-requestor-app debug (read only) 1510033 1510033 0 0.0
(read/write) 77896 77896 0 0.0
.bss 42016 42016 0 0.0
.data 992 992 0 0.0
.data.rel.ro 29656 29656 0 0.0
.dynamic 592 592 0 0.0
.got 4064 4064 0 0.0
.init 27 27 0 0.0
.init_array 544 544 0 0.0
.rodata 135728 135728 0 0.0
.text 1265666 1265666 0 0.0
shell debug (read only) 823449 823449 0 0.0
(read/write) 60616 60616 0 0.0
.bss 16936 16936 0 0.0
.data 256 256 0 0.0
.data.rel.ro 38936 38936 0 0.0
.dynamic 592 592 0 0.0
.got 3520 3520 0 0.0
.init 27 27 0 0.0
.init_array 344 344 0 0.0
.rodata 84658 84658 0 0.0
.text 631954 631954 0 0.0
tv-app debug (read only) 2046297 2046297 0 0.0
(read/write) 320032 320032 0 0.0
.bss 247288 247288 0 0.0
.data 2768 2768 0 0.0
.data.rel.ro 64168 64168 0 0.0
.dynamic 592 592 0 0.0
.got 4456 4456 0 0.0
.init 27 27 0 0.0
.init_array 736 736 0 0.0
.rodata 174480 174480 0 0.0
.text 1717074 1717074 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2313024 2313024 0 0.0
.bss 179404 179404 0 0.0
.data 5184 5184 0 0.0
.heap 851856 851856 0 0.0
.text 1275600 1275600 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2298968 2298968 0 0.0
.bss 173304 173304 0 0.0
.data 5496 5496 0 0.0
.heap 857648 857648 0 0.0
.text 1261568 1261568 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2272960 2272960 0 0.0
.bss 172344 172344 0 0.0
.data 5496 5496 0 0.0
.heap 858608 858608 0 0.0
.text 1235560 1235560 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1140008 1140008 0 0.0
.bss 11756 11756 0 0.0
.data 4376 4376 0 0.0
.heap 1020312 1020312 0 0.0
.text 103392 103392 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2047472 2047472 0 0.0
.bss 156732 156732 0 0.0
.data 4872 4872 0 0.0
.heap 874840 874840 0 0.0
.text 1010072 1010072 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 894783 894783 0 0.0
bss 113756 113756 0 0.0
rodata 99680 99680 0 0.0
text 605796 605796 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 858159 858159 0 0.0
bss 110104 110104 0 0.0
rodata 91040 91040 0 0.0
text 580792 580792 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 820678 820678 0 0.0
bss 115128 115128 0 0.0
rodata 94936 94936 0 0.0
text 536128 536128 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 866803 866803 0 0.0
bss 111016 111016 0 0.0
rodata 95796 95796 0 0.0
text 584604 584604 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 792938 792938 0 0.0
bss 112428 112428 0 0.0
rodata 91084 91084 0 0.0
text 515028 515028 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497463 497463 0 0.0
bss 51820 51820 0 0.0
rodata 45852 45852 0 0.0
text 339492 339492 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 871587 871587 0 0.0
bss 110928 110928 0 0.0
rodata 97148 97148 0 0.0
text 588052 588052 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 864831 864831 0 0.0
bss 110808 110808 0 0.0
rodata 95288 95288 0 0.0
text 583284 583284 0 0.0
shell nrf52840dk_nrf52840 (read/write) 779939 779939 0 0.0
bss 109696 109696 0 0.0
rodata 73792 73792 0 0.0
text 521948 521948 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 694966 694966 0 0.0
bss 110680 110680 0 0.0
rodata 68432 68432 0 0.0
text 442548 442548 0 0.0
p6 all-clusters-app default (read/write) 2349264 2349264 0 0.0
.bss 107596 107596 0 0.0
.data 2464 2464 0 0.0
.heap 923280 923280 0 0.0
.text 1307528 1307528 0 0.0
light-app default (read/write) 2283888 2283888 0 0.0
.bss 98536 98536 0 0.0
.data 2336 2336 0 0.0
.heap 932472 932472 0 0.0
.text 1242152 1242152 0 0.0
lock-app default (read/write) 2260424 2260424 0 0.0
.bss 97416 97416 0 0.0
.data 2296 2296 0 0.0
.heap 933632 933632 0 0.0
.text 1218688 1218688 0 0.0
qpg lighting-app qpg6100+debug (read only) 513612 513612 0 0.0
(read/write) 122332 122332 0 0.0
.bss 80272 80272 0 0.0
.data 964 964 0 0.0
.text 508292 508292 0 0.0
lock-app qpg6100+debug (read only) 487352 487352 0 0.0
(read/write) 122336 122336 0 0.0
.bss 79408 79408 0 0.0
.data 920 920 0 0.0
.text 482032 482032 0 0.0
persistent-storage-app qpg6100+debug (read only) 108224 108224 0 0.0
(read/write) 122332 122332 0 0.0
.bss 36696 36696 0 0.0
.data 292 292 0 0.0
.text 102904 102904 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 798158 798158 0 0.0
bss 80332 80332 0 0.0
noinit 37160 37160 0 0.0
text 557858 557858 0 0.0

@woody-apple
Copy link
Contributor

@cecille Please add these words to the word list :)

@todo
Copy link

todo bot commented Dec 7, 2021

If we're up, but not reacheable, then what? */

+ /* TODO: If we're up, but not reacheable, then what? */
+ if (default_router_list[router_idx].neighbor_entry->state !=
+ ND6_INCOMPLETE) {
+ return router_idx;
+ }
+ }
+ }
+#else
+ LWIP_UNUSED_ARG(ip6addr);
+#endif


This comment was generated by todo based on a TODO comment in 7f7070b in #12623. cc @cecille.

@boring-cyborg boring-cyborg bot added the github label Dec 7, 2021
@todo
Copy link

todo bot commented Dec 7, 2021

If we're up, but not reacheable, then what? */

+ /* TODO: If we're up, but not reacheable, then what? */
+ if (default_router_list[router_idx].neighbor_entry->state !=
+ ND6_INCOMPLETE) {
+ return router_idx;
+ }
+ }
+ }
+#else
+ LWIP_UNUSED_ARG(ip6addr);
+#endif


This comment was generated by todo based on a TODO comment in eb40565 in #12623. cc @cecille.

@todo
Copy link

todo bot commented Dec 7, 2021

If we're up, but not reacheable, then what? */

+ /* TODO: If we're up, but not reacheable, then what? */
+ if (default_router_list[router_idx].neighbor_entry->state !=
+ ND6_INCOMPLETE) {
+ return router_idx;
+ }
+ }
+ }
+#else
+ LWIP_UNUSED_ARG(ip6addr);
+#endif


This comment was generated by todo based on a TODO comment in a3395be in #12623. cc @cecille.

@andy31415 andy31415 merged commit e3fd7ba into project-chip:master Dec 7, 2021
@cecille cecille deleted the lwip_patches branch December 7, 2021 15:33
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.

3 participants