diff options
author | Kumar Kartikeya Dwivedi | 2022-04-25 03:18:53 +0530 |
---|---|---|
committer | Alexei Starovoitov | 2022-04-25 20:26:44 -0700 |
commit | 4d7d7f69f4b104b2ddeec6a1e7fcfd2d044ed8c4 (patch) | |
tree | 53b131c05e4568a78bb59cd7eb59125acbfd5fd0 /Documentation/target | |
parent | 6efe152d4061a83a2c5db6a0e5b58f9345c9742f (diff) |
bpf: Adapt copy_map_value for multiple offset case
Since now there might be at most 10 offsets that need handling in
copy_map_value, the manual shuffling and special case is no longer going
to work. Hence, let's generalise the copy_map_value function by using
a sorted array of offsets to skip regions that must be avoided while
copying into and out of a map value.
When the map is created, we populate the offset array in struct map,
Then, copy_map_value uses this sorted offset array is used to memcpy
while skipping timer, spin lock, and kptr. The array is allocated as
in most cases none of these special fields would be present in map
value, hence we can save on space for the common case by not embedding
the entire object inside bpf_map struct.
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220424214901.2743946-6-memxor@gmail.com
Diffstat (limited to 'Documentation/target')
0 files changed, 0 insertions, 0 deletions