All of lore.kernel.org
 help / color / mirror / Atom feed
* Frozen Maps
@ 2020-08-27 15:59 Abhishek Vijeev
  2020-08-27 16:24 ` David Ahern
  0 siblings, 1 reply; 5+ messages in thread
From: Abhishek Vijeev @ 2020-08-27 15:59 UTC (permalink / raw)
  To: bpf

Hi,

From a user-space process, given a BPF map file descriptor, is it
possible to determine whether the map is frozen (with BPF_MAP_FREEZE)?

As far as I'm aware, the only way to retrieve information about BPF
maps from file descriptors is to use BPF_OBJ_GET_INFO_BY_FD. However,
I do not see a field which tells me whether a map is frozen (or not)
in struct bpf_map_info
(https://github.com/torvalds/linux/blob/master/include/uapi/linux/bpf.h#L4035).
Kindly correct me if I'm wrong.

Thank you,
Abhishek Vijeev.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Frozen Maps
  2020-08-27 15:59 Frozen Maps Abhishek Vijeev
@ 2020-08-27 16:24 ` David Ahern
       [not found]   ` <CAHhV9ERrtpmNdAmM0-evExLi=iC0wkwTByw5AqBbSQv9CbaNow@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: David Ahern @ 2020-08-27 16:24 UTC (permalink / raw)
  To: Abhishek Vijeev, bpf

On 8/27/20 9:59 AM, Abhishek Vijeev wrote:
> Hi,
> 
> From a user-space process, given a BPF map file descriptor, is it
> possible to determine whether the map is frozen (with BPF_MAP_FREEZE)?
> 
> As far as I'm aware, the only way to retrieve information about BPF
> maps from file descriptors is to use BPF_OBJ_GET_INFO_BY_FD. However,
> I do not see a field which tells me whether a map is frozen (or not)
> in struct bpf_map_info
> (https://github.com/torvalds/linux/blob/master/include/uapi/linux/bpf.h#L4035).
> Kindly correct me if I'm wrong.
> 
> Thank you,
> Abhishek Vijeev.
> 

fdinfo for the file has the frozen status (cat /proc/$pid/fdinfo/$fd)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Frozen Maps
       [not found]   ` <CAHhV9ERrtpmNdAmM0-evExLi=iC0wkwTByw5AqBbSQv9CbaNow@mail.gmail.com>
@ 2020-08-27 16:47     ` Abhishek Vijeev
  2020-08-27 16:49     ` David Ahern
  1 sibling, 0 replies; 5+ messages in thread
From: Abhishek Vijeev @ 2020-08-27 16:47 UTC (permalink / raw)
  Cc: bpf

Thank you.

To confirm, is this the only way?

On Thu, Aug 27, 2020 at 10:13 PM Abhishek Vijeev
<abhishek.vijeev@gmail.com> wrote:
>
> Thank you.
>
> To confirm, is this the only way?
>
> On Thu, Aug 27, 2020, 9:54 PM David Ahern <dsahern@gmail.com> wrote:
>>
>> On 8/27/20 9:59 AM, Abhishek Vijeev wrote:
>> > Hi,
>> >
>> > From a user-space process, given a BPF map file descriptor, is it
>> > possible to determine whether the map is frozen (with BPF_MAP_FREEZE)?
>> >
>> > As far as I'm aware, the only way to retrieve information about BPF
>> > maps from file descriptors is to use BPF_OBJ_GET_INFO_BY_FD. However,
>> > I do not see a field which tells me whether a map is frozen (or not)
>> > in struct bpf_map_info
>> > (https://github.com/torvalds/linux/blob/master/include/uapi/linux/bpf.h#L4035).
>> > Kindly correct me if I'm wrong.
>> >
>> > Thank you,
>> > Abhishek Vijeev.
>> >
>>
>> fdinfo for the file has the frozen status (cat /proc/$pid/fdinfo/$fd)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Frozen Maps
       [not found]   ` <CAHhV9ERrtpmNdAmM0-evExLi=iC0wkwTByw5AqBbSQv9CbaNow@mail.gmail.com>
  2020-08-27 16:47     ` Abhishek Vijeev
@ 2020-08-27 16:49     ` David Ahern
  2020-08-27 17:02       ` Abhishek Vijeev
  1 sibling, 1 reply; 5+ messages in thread
From: David Ahern @ 2020-08-27 16:49 UTC (permalink / raw)
  To: Abhishek Vijeev; +Cc: bpf

On 8/27/20 10:43 AM, Abhishek Vijeev wrote:
> Thank you.
> 
> To confirm, is this the only way?

appears so from a code review. I am surprised it is not in GET_INFO
response.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Frozen Maps
  2020-08-27 16:49     ` David Ahern
@ 2020-08-27 17:02       ` Abhishek Vijeev
  0 siblings, 0 replies; 5+ messages in thread
From: Abhishek Vijeev @ 2020-08-27 17:02 UTC (permalink / raw)
  To: David Ahern; +Cc: bpf

Yes, that's precisely why I reached out.

Thank you.

On Thu, Aug 27, 2020 at 10:19 PM David Ahern <dsahern@gmail.com> wrote:
>
> On 8/27/20 10:43 AM, Abhishek Vijeev wrote:
> > Thank you.
> >
> > To confirm, is this the only way?
>
> appears so from a code review. I am surprised it is not in GET_INFO
> response.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-27 17:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27 15:59 Frozen Maps Abhishek Vijeev
2020-08-27 16:24 ` David Ahern
     [not found]   ` <CAHhV9ERrtpmNdAmM0-evExLi=iC0wkwTByw5AqBbSQv9CbaNow@mail.gmail.com>
2020-08-27 16:47     ` Abhishek Vijeev
2020-08-27 16:49     ` David Ahern
2020-08-27 17:02       ` Abhishek Vijeev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.