-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix fabric index management in the fabric table. #16587
Merged
bzbarsky-apple
merged 3 commits into
project-chip:master
from
bzbarsky-apple:fabric-index-storage
Mar 24, 2022
Merged
Fix fabric index management in the fabric table. #16587
bzbarsky-apple
merged 3 commits into
project-chip:master
from
bzbarsky-apple:fabric-index-storage
Mar 24, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pullapprove
bot
requested review from
andy31415,
anush-apple,
Byungjoo-Lee,
carol-apple,
cecille,
chrisdecenzo,
chshu,
chulspro,
Damian-Nordic,
dhrishi,
electrocucaracha,
franck-apple,
gjc13,
hawk248,
harsha-rajendran,
isiu-apple,
jelderton,
jepenven-silabs,
jmartinez-silabs,
kpschoedel,
lazarkov,
LuDuda,
lzgrablic02,
mrjerryjohns,
msandstedt,
mspang,
robszewczyk and
sagar-apple
March 23, 2022 20:40
pullapprove
bot
requested review from
tecimovic,
turon,
vijs,
vivien-apple,
wbschiller,
woody-apple,
xylophone21 and
yunhanw-google
March 23, 2022 20:40
tcarmelveilleux
approved these changes
Mar 23, 2022
PR #16587: Size comparison from 395bb1f to 890fff2 Increases above 0.2%:
Increases (25 builds for cyw30739, efr32, k32w, linux, mbed, nrfconnect, p6, telink)
Full report (25 builds for cyw30739, efr32, k32w, linux, mbed, nrfconnect, p6, telink)
|
PR #16587: Size comparison from 395bb1f to 52bfb96 Increases above 0.2%:
Increases (27 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
Decreases (12 builds for linux, nrfconnect)
Full report (27 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
msandstedt
reviewed
Mar 24, 2022
jmartinez-silabs
approved these changes
Mar 24, 2022
Before this change, the fabric index for a fabric table entry had to match its offset in the table. Therefore we only used indices up to CHIP_CONFIG_MAX_FABRICS and then looped back around to index 1. Furthermore, we did not use to persist our mNextAvailableFabricIndex, so after a restart would start assigning fabric indices that corresponded to deleted fabrics, instead of not-yet-used ones, even if we had not yet exceeded CHIP_CONFIG_MAX_FABRICS total commissioning events. This change decouples the fabric index from the table offset. We now store the list of fabric indices used and the fabric index we should use for the next time a fabric is added.
bzbarsky-apple
force-pushed
the
fabric-index-storage
branch
from
March 24, 2022 16:35
52bfb96
to
6e1b915
Compare
PR #16587: Size comparison from 6c3f648 to 6e1b915 Increases above 0.2%:
Increases (27 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
Full report (27 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
msandstedt
approved these changes
Mar 24, 2022
rochaferraz
pushed a commit
to rochaferraz/connectedhomeip
that referenced
this pull request
Mar 31, 2022
* Fix fabric index management in the fabric table. Before this change, the fabric index for a fabric table entry had to match its offset in the table. Therefore we only used indices up to CHIP_CONFIG_MAX_FABRICS and then looped back around to index 1. Furthermore, we did not use to persist our mNextAvailableFabricIndex, so after a restart would start assigning fabric indices that corresponded to deleted fabrics, instead of not-yet-used ones, even if we had not yet exceeded CHIP_CONFIG_MAX_FABRICS total commissioning events. This change decouples the fabric index from the table offset. We now store the list of fabric indices used and the fabric index we should use for the next time a fabric is added. * Fix TestCASESession compilation. * Address review comments.
andrei-menzopol
pushed a commit
to andrei-menzopol/connectedhomeip
that referenced
this pull request
Apr 14, 2022
* Fix fabric index management in the fabric table. Before this change, the fabric index for a fabric table entry had to match its offset in the table. Therefore we only used indices up to CHIP_CONFIG_MAX_FABRICS and then looped back around to index 1. Furthermore, we did not use to persist our mNextAvailableFabricIndex, so after a restart would start assigning fabric indices that corresponded to deleted fabrics, instead of not-yet-used ones, even if we had not yet exceeded CHIP_CONFIG_MAX_FABRICS total commissioning events. This change decouples the fabric index from the table offset. We now store the list of fabric indices used and the fabric index we should use for the next time a fabric is added. * Fix TestCASESession compilation. * Address review comments.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this change, the fabric index for a fabric table entry had to match its offset in the table. Therefore we only used indices up to CHIP_CONFIG_MAX_FABRICS and then looped back around to index 1.
Furthermore, we did not use to persist our mNextAvailableFabricIndex,
so after a restart would start assigning fabric indices that
corresponded to deleted fabrics, instead of not-yet-used ones, even if
we had not yet exceeded CHIP_CONFIG_MAX_FABRICS total commissioning
events.
This change decouples the fabric index from the table offset. We now
store the list of fabric indices used and the fabric index we should
use for the next time a fabric is added.
Problem
See above.
Change overview
See above.
Testing
Manually set
CHIP_CONFIG_MAX_FABRICS
to 2 on the server andkMaxValidFabricIndex
to 5 and verified that we correctly error out when trying to add a third fabric and that repeatedly removing and adding a fabric cycles the fabric index being assigned up to 5, then back to the beginning, instead of cutting off at 2.