Re: bpf_map_create usage question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 3/14/22 1:15 PM, Grant Seltzer Richman wrote:
Hi there,

If I call `bpf_map_create()` successfully I'll have a file descriptor
and not a `struct bpf_map`. This stifles me from using a lot of the
`bpf_map__` API functions, for example `bpf_map__pin()`. What's the
reason for this? Is there a way to get a  `struct bpf_map` that I'm
missing?

To use bpf_map__* apis, you need a bpf program which conforms to
libbpf bpf program/map format (see selftests/bpf/) and from there
you can use bpf_map__* or other libbpf api's.

If you use bpf_map_create(), you can use bpf_obj_pin().


Thanks so much,
Grant Seltzer

P.s. been a while since I've worked on adding docs, but I will finally
be getting back to it!



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux