if (in_test_mode) { /* test mode is used by selftests to * test functionality of bpf_hash_map iter. * * the above hashmap1 will have correct size * and will be accepted, hashmap2 and hashmap3 * should be rejected due to smaller key/value * size.
*/ if (key == (void *)0 || val == (void *)0) return 0;
/* update the value and then delete the <key, value> pair. * it should not impact the existing 'val' which is still * accessible under rcu.
*/
__builtin_memcpy(&tmp_key, key, sizeof(struct key_t));
ret = bpf_map_update_elem(&hashmap1, &tmp_key, &tmp_val, 0); if (ret) return 0;
ret = bpf_map_delete_elem(&hashmap1, &tmp_key); if (ret) return 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.