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

the bpf_map_update_elem in xdpdump_user.c crashes when key is more than 127 #8

Open
souradeep100 opened this issue Aug 31, 2023 · 0 comments

Comments

@souradeep100
Copy link

souradeep100 commented Aug 31, 2023

The the number of cpus are more than 127, then it hits assert, and upon checking we can see it is hitting following error:
If the key is 128 or more then the bpf syscall is failing.
bpf(BPF_MAP_UPDATE_ELEM, {map_fd=3, key=0x7fffae9f9478, value=0x7fffae9f9474, flags=BPF_ANY}, 72) = -1 E2BIG (Argument list too long)

I have verified the same key value works using linux bpf self test test_maps.

test_hashmap(unsigned int task, void *data)
  38 {
  39         long long key, next_key, first_key, value;
  40         int fd;
  41
  42         fd = bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(key), sizeof(value),
  43                             2, map_flags);
  44         if (fd < 0) {
  45                 printf("Failed to create hashmap '%s'!\n", strerror(errno));
  46                 exit(1);
  47         }
  48
  49         key = 128;
  50         value = 1234;
  51         /* Insert key=1 element. */
  52         printf("insert key 128 and value 1234\n");
  53         assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0);
  54         printf("no assert\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant