lkml.org 
[lkml]   [2022]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: 答复: 答复: [PATCH bpf-next] samples/bpf: check detach prog exist or not in xdp_fwd
Date
> Could I add helper function to implement this function which can check
> the program name and see if it attach to the device.

You just need to call bpf_prog_get_fd_by_id() followed by
bpf_obj_get_info_by_fd(), and the program name will be in info.name.
Here's an example in libxdp where we pull out the prog name:

https://github.com/xdp-project/xdp-tools/blob/master/lib/libxdp/libxdp.c#L1165

-Toke

\
 
 \ /
  Last update: 2022-05-17 11:48    [W:0.037 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site