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

Implement a simple DetermineProviderLocation #15979

Conversation

harsha-rajendran
Copy link
Contributor

@harsha-rajendran harsha-rajendran commented Mar 8, 2022

Problem

Provide a generic implementation for DetermineProviderLocation()

Change overview

It has been decided that a simple "iterate-through-the-list" approach would be the best path forward.
DetermineProviderLocation() iterates through the list of DefaultOTAProviders, finds the last-used-provider and returns the entry after it (cycles back to the start of the list). If no suitable candidate has been found, an error is returned.

Testing

@github-actions
Copy link

github-actions bot commented Mar 8, 2022

PR #15979: Size comparison from a69fde3 to 62714f3

Increases (6 builds for cyw30739, efr32, k32w, linux, nrfconnect)
platform target config section a69fde3 62714f3 change % change
cyw30739 ota-requestor cyw930739m2evb_01 (read/write) 582190 582462 272 0.0
.app_xip_area 478564 478828 264 0.1
.bss 86004 86052 48 0.1
efr32 lighting-app BRD4161A (read only) 921344 921712 368 0.0
(read/write) 128872 128880 8 0.0
.bss 126800 126848 48 0.0
.text 921336 921704 368 0.0
BRD4161A+rpc (read only) 950180 950548 368 0.0
(read/write) 144828 144836 8 0.0
.bss 142576 142624 48 0.0
.text 950172 950540 368 0.0
k32w light k32w061+release (read/write) 695256 695536 280 0.0
.bss 77736 77784 48 0.1
.text 609764 610036 272 0.0
linux ota-requestor-app debug (read only) 1902617 1903321 704 0.0
(read/write) 117448 117480 32 0.0
.bss 51360 51392 32 0.1
.rodata 154220 154508 288 0.2
.text 1598338 1598754 416 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1152335 1152559 224 0.0
bss 146832 146840 8 0.0
rodata 144328 144424 96 0.1
text 785912 786036 124 0.0
Decreases (4 builds for cyw30739, efr32, k32w)
platform target config section a69fde3 62714f3 change % change
cyw30739 ota-requestor cyw930739m2evb_01 .data 584 544 -40 -6.8
efr32 lighting-app BRD4161A .data 2072 2032 -40 -1.9
BRD4161A+rpc .data 2252 2212 -40 -1.8
k32w light k32w061+release .data 1956 1916 -40 -2.0
Full report (26 builds for cyw30739, efr32, esp32, k32w, linux, nrfconnect, p6, telink)
platform target config section a69fde3 62714f3 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 602090 602090 0 0.0
.app_xip_area 506608 506608 0 0.0
.bss 78172 78172 0 0.0
.data 652 652 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 559998 559998 0 0.0
.app_xip_area 466052 466052 0 0.0
.bss 76676 76676 0 0.0
.data 616 616 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 582190 582462 272 0.0
.app_xip_area 478564 478828 264 0.1
.bss 86004 86052 48 0.1
.data 584 544 -40 -6.8
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 921344 921712 368 0.0
(read/write) 128872 128880 8 0.0
.bss 126800 126848 48 0.0
.data 2072 2032 -40 -1.9
.text 921336 921704 368 0.0
BRD4161A+rpc (read only) 950180 950548 368 0.0
(read/write) 144828 144836 8 0.0
.bss 142576 142624 48 0.0
.data 2252 2212 -40 -1.8
.text 950172 950540 368 0.0
window-app BRD4161A (read only) 854380 854380 0 0.0
(read/write) 126852 126852 0 0.0
.bss 124936 124936 0 0.0
.data 1916 1916 0 0.0
.text 854372 854372 0 0.0
esp32 all-clusters-app c3devkit (read only) 957942 957942 0 0.0
(read/write) 1393674 1393674 0 0.0
.dram0.bss 63480 63480 0 0.0
.dram0.data 14220 14220 0 0.0
.flash.rodata 197056 197056 0 0.0
.flash.text 957942 957942 0 0.0
.iram0.text 62016 62016 0 0.0
m5stack (read only) 1012743 1012743 0 0.0
(read/write) 460772 460772 0 0.0
.dram0.bss 69000 69000 0 0.0
.dram0.data 34064 34064 0 0.0
.flash.rodata 225872 225872 0 0.0
.flash.text 1007359 1007359 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 695256 695536 280 0.0
.bss 77736 77784 48 0.1
.data 1956 1916 -40 -2.0
.text 609764 610036 272 0.0
lock k32w061+release (read/write) 696860 696860 0 0.0
.bss 77704 77704 0 0.0
.data 1964 1964 0 0.0
.text 611392 611392 0 0.0
linux all-clusters-app debug (read only) 2428721 2428721 0 0.0
(read/write) 145712 145712 0 0.0
.bss 60192 60192 0 0.0
.data 1360 1360 0 0.0
.data.rel.ro 78424 78424 0 0.0
.dynamic 592 592 0 0.0
.got 4176 4176 0 0.0
.init 27 27 0 0.0
.init_array 936 936 0 0.0
.rodata 205541 205541 0 0.0
.text 2060194 2060194 0 0.0
bridge-app debug+rpc (read only) 1733421 1733421 0 0.0
(read/write) 92656 92656 0 0.0
.bss 47496 47496 0 0.0
.data 2016 2016 0 0.0
.data.rel.ro 38064 38064 0 0.0
.dynamic 592 592 0 0.0
.got 3928 3928 0 0.0
.init 27 27 0 0.0
.init_array 544 544 0 0.0
.rodata 141748 141748 0 0.0
.text 1475701 1475701 0 0.0
chip-tool debug (read only) 9762741 9762741 0 0.0
(read/write) 338616 338616 0 0.0
.bss 25512 25512 0 0.0
.data 1152 1152 0 0.0
.data.rel.ro 305928 305928 0 0.0
.dynamic 608 608 0 0.0
.got 4776 4776 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 510868 510868 0 0.0
.text 8512389 8512389 0 0.0
chip-tool-ipv6only arm64 (read only) 9434788 9434788 0 0.0
(read/write) 454337 454337 0 0.0
.bss 43825 43825 0 0.0
.data 1200 1200 0 0.0
.data.rel.ro 351136 351136 0 0.0
.dynamic 560 560 0 0.0
.got 54376 54376 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 486588 486588 0 0.0
.text 7944148 7944148 0 0.0
door-lock-app debug (read only) 1947745 1947745 0 0.0
(read/write) 119136 119136 0 0.0
.bss 50496 50496 0 0.0
.data 1056 1056 0 0.0
.data.rel.ro 62184 62184 0 0.0
.dynamic 592 592 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 664 664 0 0.0
.rodata 173660 173660 0 0.0
.text 1625442 1625442 0 0.0
lighting-app debug+rpc (read only) 2080025 2080025 0 0.0
(read/write) 124456 124456 0 0.0
.bss 51296 51296 0 0.0
.data 1536 1536 0 0.0
.data.rel.ro 66104 66104 0 0.0
.dynamic 608 608 0 0.0
.got 4144 4144 0 0.0
.init 27 27 0 0.0
.init_array 736 736 0 0.0
.rodata 165820 165820 0 0.0
.text 1758546 1758546 0 0.0
ota-provider-app debug (read only) 1880601 1880601 0 0.0
(read/write) 114736 114736 0 0.0
.bss 50304 50304 0 0.0
.data 1320 1320 0 0.0
.data.rel.ro 57464 57464 0 0.0
.dynamic 608 608 0 0.0
.got 4368 4368 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 158899 158899 0 0.0
.text 1570978 1570978 0 0.0
ota-requestor-app debug (read only) 1902617 1903321 704 0.0
(read/write) 117448 117480 32 0.0
.bss 51360 51392 32 0.1
.data 1480 1480 0 0.0
.data.rel.ro 59176 59176 0 0.0
.dynamic 592 592 0 0.0
.got 4160 4160 0 0.0
.init 27 27 0 0.0
.init_array 640 640 0 0.0
.rodata 154220 154508 288 0.2
.text 1598338 1598754 416 0.0
shell debug (read only) 2394833 2394833 0 0.0
(read/write) 149928 149928 0 0.0
.bss 70312 70312 0 0.0
.data 864 864 0 0.0
.data.rel.ro 73064 73064 0 0.0
.dynamic 592 592 0 0.0
.got 4160 4160 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 205458 205458 0 0.0
.text 2032802 2032802 0 0.0
thermostat-no-ble arm64 (read only) 2176500 2176500 0 0.0
(read/write) 148673 148673 0 0.0
.bss 65281 65281 0 0.0
.data 1048 1048 0 0.0
.data.rel.ro 75136 75136 0 0.0
.dynamic 560 560 0 0.0
.got 4240 4240 0 0.0
.init 24 24 0 0.0
.init_array 352 352 0 0.0
.rodata 133012 133012 0 0.0
.text 1824912 1824912 0 0.0
tv-app debug (read only) 2620537 2620537 0 0.0
(read/write) 250840 250840 0 0.0
.bss 168000 168000 0 0.0
.data 3168 3168 0 0.0
.data.rel.ro 73624 73624 0 0.0
.dynamic 592 592 0 0.0
.got 4544 4544 0 0.0
.init 27 27 0 0.0
.init_array 880 880 0 0.0
.rodata 199453 199453 0 0.0
.text 2246994 2246994 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1152335 1152559 224 0.0
bss 146832 146840 8 0.0
rodata 144328 144424 96 0.1
text 785912 786036 124 0.0
p6 all-clusters-app default (read/write) 2494568 2494568 0 0.0
.bss 119544 119544 0 0.0
.data 2680 2680 0 0.0
.text 1452832 1452832 0 0.0
light-app default (read/write) 2398000 2398000 0 0.0
.bss 113008 113008 0 0.0
.data 2536 2536 0 0.0
.text 1356264 1356264 0 0.0
lock-app default (read/write) 2361432 2361432 0 0.0
.bss 112752 112752 0 0.0
.data 2496 2496 0 0.0
.text 1319696 1319696 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 889534 889534 0 0.0
bss 86968 86968 0 0.0
noinit 37160 37160 0 0.0
text 628840 628840 0 0.0

@harsha-rajendran harsha-rajendran force-pushed the Implement-Determine-OTA-Provider-Location branch from 1c2295a to 643ec6c Compare March 9, 2022 18:08
@harsha-rajendran
Copy link
Contributor Author

Squashed commits and rebased.

@github-actions
Copy link

github-actions bot commented Mar 9, 2022

PR #15979: Size comparison from 4349e22 to 643ec6c

Increases (6 builds for cyw30739, efr32, k32w, linux, nrfconnect)
platform target config section 4349e22 643ec6c change % change
cyw30739 ota-requestor cyw930739m2evb_01 (read/write) 570146 570386 240 0.0
.app_xip_area 466504 466736 232 0.0
.bss 86012 86060 48 0.1
efr32 lighting-app BRD4161A (read only) 922536 922816 280 0.0
(read/write) 128888 128896 8 0.0
.bss 126808 126856 48 0.0
.text 922528 922808 280 0.0
BRD4161A+rpc (read only) 951348 951652 304 0.0
(read/write) 144844 144852 8 0.0
.bss 142584 142632 48 0.0
.text 951340 951644 304 0.0
k32w light k32w061+release (read/write) 696128 696372 244 0.0
.bss 77744 77792 48 0.1
.text 610620 610856 236 0.0
linux ota-requestor-app debug (read only) 1912065 1912593 528 0.0
(read/write) 117832 117864 32 0.0
.bss 51552 51584 32 0.1
.rodata 154860 155020 160 0.1
.text 1606690 1607058 368 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1153239 1153443 204 0.0
bss 146848 146856 8 0.0
rodata 144448 144492 44 0.0
text 786700 786856 156 0.0
Decreases (4 builds for cyw30739, efr32, k32w)
platform target config section 4349e22 643ec6c change % change
cyw30739 ota-requestor cyw930739m2evb_01 .data 592 552 -40 -6.8
efr32 lighting-app BRD4161A .data 2080 2040 -40 -1.9
BRD4161A+rpc .data 2260 2220 -40 -1.8
k32w light k32w061+release .data 1964 1924 -40 -2.0
Full report (27 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 4349e22 643ec6c change % change
cyw30739 light cyw930739m2evb_01 (read/write) 602138 602138 0 0.0
.app_xip_area 506656 506656 0 0.0
.bss 78172 78172 0 0.0
.data 652 652 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 560038 560038 0 0.0
.app_xip_area 466092 466092 0 0.0
.bss 76676 76676 0 0.0
.data 616 616 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 570146 570386 240 0.0
.app_xip_area 466504 466736 232 0.0
.bss 86012 86060 48 0.1
.data 592 552 -40 -6.8
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 922536 922816 280 0.0
(read/write) 128888 128896 8 0.0
.bss 126808 126856 48 0.0
.data 2080 2040 -40 -1.9
.text 922528 922808 280 0.0
BRD4161A+rpc (read only) 951348 951652 304 0.0
(read/write) 144844 144852 8 0.0
.bss 142584 142632 48 0.0
.data 2260 2220 -40 -1.8
.text 951340 951644 304 0.0
window-app BRD4161A (read only) 854524 854524 0 0.0
(read/write) 126852 126852 0 0.0
.bss 124936 124936 0 0.0
.data 1916 1916 0 0.0
.text 854516 854516 0 0.0
esp32 all-clusters-app c3devkit (read only) 958658 958658 0 0.0
(read/write) 1393770 1393770 0 0.0
.dram0.bss 63576 63576 0 0.0
.dram0.data 14220 14220 0 0.0
.flash.rodata 197056 197056 0 0.0
.flash.text 958658 958658 0 0.0
.iram0.text 62016 62016 0 0.0
m5stack (read only) 1013703 1013703 0 0.0
(read/write) 461028 461028 0 0.0
.dram0.bss 69096 69096 0 0.0
.dram0.data 34064 34064 0 0.0
.flash.rodata 226032 226032 0 0.0
.flash.text 1008319 1008319 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 696128 696372 244 0.0
.bss 77744 77792 48 0.1
.data 1964 1924 -40 -2.0
.text 610620 610856 236 0.0
lock k32w061+release (read/write) 696908 696908 0 0.0
.bss 77704 77704 0 0.0
.data 1964 1964 0 0.0
.text 611440 611440 0 0.0
linux all-clusters-app debug (read only) 2432801 2432801 0 0.0
(read/write) 145872 145872 0 0.0
.bss 60352 60352 0 0.0
.data 1360 1360 0 0.0
.data.rel.ro 78424 78424 0 0.0
.dynamic 592 592 0 0.0
.got 4176 4176 0 0.0
.init 27 27 0 0.0
.init_array 936 936 0 0.0
.rodata 205765 205765 0 0.0
.text 2064050 2064050 0 0.0
bridge-app debug+rpc (read only) 1737365 1737365 0 0.0
(read/write) 92784 92784 0 0.0
.bss 47624 47624 0 0.0
.data 2016 2016 0 0.0
.data.rel.ro 38064 38064 0 0.0
.dynamic 592 592 0 0.0
.got 3928 3928 0 0.0
.init 27 27 0 0.0
.init_array 544 544 0 0.0
.rodata 141932 141932 0 0.0
.text 1479461 1479461 0 0.0
chip-tool debug (read only) 9937029 9937029 0 0.0
(read/write) 356152 356152 0 0.0
.bss 25640 25640 0 0.0
.data 1152 1152 0 0.0
.data.rel.ro 323336 323336 0 0.0
.dynamic 608 608 0 0.0
.got 4776 4776 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 514420 514420 0 0.0
.text 8644725 8644725 0 0.0
chip-tool-ipv6only arm64 (read only) 9585564 9585564 0 0.0
(read/write) 472945 472945 0 0.0
.bss 43953 43953 0 0.0
.data 1200 1200 0 0.0
.data.rel.ro 369312 369312 0 0.0
.dynamic 560 560 0 0.0
.got 54680 54680 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 490436 490436 0 0.0
.text 8050996 8050996 0 0.0
door-lock-app debug (read only) 1951665 1951665 0 0.0
(read/write) 119296 119296 0 0.0
.bss 50656 50656 0 0.0
.data 1056 1056 0 0.0
.data.rel.ro 62184 62184 0 0.0
.dynamic 592 592 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 664 664 0 0.0
.rodata 173820 173820 0 0.0
.text 1629202 1629202 0 0.0
lighting-app debug+rpc (read only) 2084009 2084009 0 0.0
(read/write) 124616 124616 0 0.0
.bss 51456 51456 0 0.0
.data 1536 1536 0 0.0
.data.rel.ro 66104 66104 0 0.0
.dynamic 608 608 0 0.0
.got 4144 4144 0 0.0
.init 27 27 0 0.0
.init_array 736 736 0 0.0
.rodata 166044 166044 0 0.0
.text 1762306 1762306 0 0.0
ota-provider-app debug (read only) 1884521 1884521 0 0.0
(read/write) 114896 114896 0 0.0
.bss 50464 50464 0 0.0
.data 1320 1320 0 0.0
.data.rel.ro 57464 57464 0 0.0
.dynamic 608 608 0 0.0
.got 4368 4368 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 159059 159059 0 0.0
.text 1574738 1574738 0 0.0
ota-requestor-app debug (read only) 1912065 1912593 528 0.0
(read/write) 117832 117864 32 0.0
.bss 51552 51584 32 0.1
.data 1480 1480 0 0.0
.data.rel.ro 59368 59368 0 0.0
.dynamic 592 592 0 0.0
.got 4160 4160 0 0.0
.init 27 27 0 0.0
.init_array 640 640 0 0.0
.rodata 154860 155020 160 0.1
.text 1606690 1607058 368 0.0
shell debug (read only) 2398945 2398945 0 0.0
(read/write) 150088 150088 0 0.0
.bss 70472 70472 0 0.0
.data 864 864 0 0.0
.data.rel.ro 73064 73064 0 0.0
.dynamic 592 592 0 0.0
.got 4160 4160 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 205682 205682 0 0.0
.text 2036690 2036690 0 0.0
thermostat-no-ble arm64 (read only) 2180332 2180332 0 0.0
(read/write) 148833 148833 0 0.0
.bss 65409 65409 0 0.0
.data 1048 1048 0 0.0
.data.rel.ro 75160 75160 0 0.0
.dynamic 560 560 0 0.0
.got 4240 4240 0 0.0
.init 24 24 0 0.0
.init_array 352 352 0 0.0
.rodata 133196 133196 0 0.0
.text 1828544 1828544 0 0.0
tv-app debug (read only) 2624761 2624761 0 0.0
(read/write) 251000 251000 0 0.0
.bss 168160 168160 0 0.0
.data 3168 3168 0 0.0
.data.rel.ro 73624 73624 0 0.0
.dynamic 592 592 0 0.0
.got 4544 4544 0 0.0
.init 27 27 0 0.0
.init_array 880 880 0 0.0
.rodata 199645 199645 0 0.0
.text 2251026 2251026 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2351868 2351868 0 0.0
.bss 186212 186212 0 0.0
.data 5792 5792 0 0.0
.text 1314468 1314468 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1153239 1153443 204 0.0
bss 146848 146856 8 0.0
rodata 144448 144492 44 0.0
text 786700 786856 156 0.0
p6 all-clusters-app default (read/write) 2495808 2495808 0 0.0
.bss 119640 119640 0 0.0
.data 2680 2680 0 0.0
.text 1454072 1454072 0 0.0
light-app default (read/write) 2399192 2399192 0 0.0
.bss 113104 113104 0 0.0
.data 2536 2536 0 0.0
.text 1357456 1357456 0 0.0
lock-app default (read/write) 2362624 2362624 0 0.0
.bss 112848 112848 0 0.0
.data 2496 2496 0 0.0
.text 1320888 1320888 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 889718 889718 0 0.0
bss 86968 86968 0 0.0
noinit 37160 37160 0 0.0
text 629024 629024 0 0.0

@andy31415 andy31415 merged commit ccad121 into project-chip:master Mar 9, 2022
@harsha-rajendran harsha-rajendran deleted the Implement-Determine-OTA-Provider-Location branch March 9, 2022 21: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.

OTA Requestor needs to support querying providers from multiple fabrics
7 participants