Skip to content

Commit

Permalink
fix reference to libbpf_num_possible_cpus
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Yves Aillet <pyaillet@gmail.com>
  • Loading branch information
pyaillet authored and tohojo committed Feb 12, 2024
1 parent 0f4e7cc commit 15c6df3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion basic03-map-counter/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ the switch-case statement in function =map_collect()=:
void map_get_value_percpu_array(int fd, __u32 key, struct datarec *value)
{
/* For percpu maps, user space gets a value per possible CPU */
unsigned int nr_cpus = bpf_num_possible_cpus();
unsigned int nr_cpus = libbpf_num_possible_cpus();
struct datarec values[nr_cpus];
__u64 sum_bytes = 0;
__u64 sum_pkts = 0;
Expand Down
2 changes: 1 addition & 1 deletion basic03-map-counter/xdp_load_and_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void map_get_value_array(int fd, __u32 key, struct datarec *value)
void map_get_value_percpu_array(int fd, __u32 key, struct datarec *value)
{
/* For percpu maps, userspace gets a value per possible CPU */
// unsigned int nr_cpus = bpf_num_possible_cpus();
// unsigned int nr_cpus = libbpf_num_possible_cpus();
// struct datarec values[nr_cpus];

fprintf(stderr, "ERR: %s() not impl. see assignment#3", __func__);
Expand Down

0 comments on commit 15c6df3

Please sign in to comment.