-
Notifications
You must be signed in to change notification settings - Fork 713
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
map: check MapReplacements compatibility after applying BPF_F_MMAPABLE
There were 2 problems with the existing implementation: - cl.loadMap would mutate the original MapSpec before loading - map compatibility was checked before cl.loadMap applied the BPF_F_MMAPABLE flag To address this, the following changes were made: - MapSpec.Copy() is called in loadMap, to follow suit with cl.loadProgram - the compatibility check on MapReplacements was deferred to loadMap, after flags are mutated - Added a superficial CollectionSpec mutation test after loading, using the same logic as TestLoadCollectionSpec. testutils.IsDeepCopy() isn't usable here since MapSpec.Copy() doesn't deepcopy .Contents. - Added a regression test on using .data and .rodata in MapReplacements Signed-off-by: Timo Beckers <timo@isovalent.com>
- Loading branch information
Showing
3 changed files
with
96 additions
and
36 deletions.
There are no files selected for viewing
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
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
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