tech-kern archive

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

BPF memstore and bpf_validate_ext()



Hello,

Now that the BPF memory store can be external and can be provided by the
caller of the BPF program, we can use to it pass some values or reuse it
as a cache.  However, this has to be supported by bpf_validate() - we have
to tell it which words are going to be initialised by the caller, since it
currently checks and prevents loads of the uninitialised memstore words.

Hence, here is the proposed API function for this:

int bpf_set_initwords(bpf_ctx_t *bc, uint8_t *wordmask, size_t len);

Note that we already have an extended bpf_validate() variation:

int bpf_validate_ext(bpf_ctx_t *bc, const struct bpf_insn *f, int len);

The original filter/validate API stays as is, only the extended routines
support the external memory store and its initialisation.

Thanks.

-- 
Mindaugas


Home | Main Index | Thread Index | Old Index