On Sat, Feb 17, 2018 at 16:56 Fulvio Risso via iovisor-dev <
[email protected]> wrote:

>
>
> On 17/02/2018 08:41, Y Song wrote:
> > On Fri, Feb 16, 2018 at 11:19 PM, Fulvio Risso <[email protected]>
> wrote:
> >>
> >>
> >> On 17/02/2018 08:02, Y Song via iovisor-dev wrote:
> >>>
> >>> On Fri, Feb 16, 2018 at 7:59 AM, Francesco Picciariello via
> >>> iovisor-dev <[email protected]> wrote:
> >>>>
> >>>> Hello all,
> >>>> Is there a way to receive asynchronous notification each time an eBPF
> map
> >>>> is
> >>>> modified?
> >>>
> >>>
> >>> When map is modified in kernel, you can send something into a ring
> buffer
> >>> and userspace can poll on this ring buffer to get notification.
>
> Got it.
> We were looking for a mechanism transparent to the eBPF program, though.
> A possible rational is to have an hot-standby copy of the program
> (including the state) in some other location, but I don't want my
> dataplane to be aware of that.
> Thanks,
>
>         fulvio


You could also (use another BPF program or ftrace) to trace the
bpf_map_update_elem Tracepoint. But in that case you get all update calls
and would need to filter for the one you are interested on your own:)

Teng



>
>
> >>
> >>
> >> When you say "you" means "the dataplane program"?
> >
> > Yes.
> >
> >> In other words, the dataplane must be collaborative and send a
> notification
> >> to userspace when the map has been modified?
> >
> > Yes. Not just notification, may be actual data or part of actual data, or
> > aggregated data if modification is too frequent.
> >
> >>
> >> Thanks,
> >>
> >>          fulvio
> >>
> >>>
> >>>>
> >>>> I used bpf_obj_pin() in order to save a specific map on filesystem,
> and I
> >>>> called linux inotify() on the pinned object.
> >>>>
> >>>> The inotify API provides a mechanism for monitoring filesystem events,
> >>>> and
> >>>> the goal is to notice when a pinned eBPF map is modified, but it seems
> >>>> inotify() does not work properly with bpf filesystem. In fact it's
> able
> >>>> to
> >>>> detect the creation and the deletion, but not the modification of the
> >>>> pinned
> >>>> object.
> >>>
> >>>
> >>> The inotify takes vfs_read/write for read/write operations.
> >>> Here bpf map read/write happens inside
> >>> bpf program, or through bpf syscall, and hence inotify mechanism won't
> >>> work.
> >>>
> >>>>
> >>>> Regards.
> >>>>
> >>>> _______________________________________________
> >>>> iovisor-dev mailing list
> >>>> [email protected]
> >>>> https://lists.iovisor.org/mailman/listinfo/iovisor-dev
> >>>>
> >>> _______________________________________________
> >>> iovisor-dev mailing list
> >>> [email protected]
> >>> https://lists.iovisor.org/mailman/listinfo/iovisor-dev
> >>>
> >>
> _______________________________________________
> iovisor-dev mailing list
> [email protected]
> https://lists.iovisor.org/mailman/listinfo/iovisor-dev
>
_______________________________________________
iovisor-dev mailing list
[email protected]
https://lists.iovisor.org/mailman/listinfo/iovisor-dev

Reply via email to