Date: Thu, 8 Aug 2013 11:32:45 +0100 From: Mindaugas Rasiukevicius <rmind@netbsd.org> To: Alexander Nasonov <alnsn@yandex.ru> Cc: tech-net@netbsd.org, freebsd-net@freebsd.org Subject: Re: BPF_MISC+BPF_COP and BPF_COPX Message-ID: <20130808103304.2542614A2A9@mail.netbsd.org> In-Reply-To: <20130807201712.GA2042@x1000.localdomain> References: <20130804191310.2FFBB14A152@mail.netbsd.org> <20130805203549.GA2241@x1000.localdomain> <20130805214621.C000D14A1C3@mail.netbsd.org> <20130806065903.GA2835@x1000.localdomain> <20130807174701.9E1C214A0F7@mail.netbsd.org> <20130807201712.GA2042@x1000.localdomain>
next in thread | previous in thread | raw e-mail | index | archive | help
Alexander Nasonov <alnsn@yandex.ru> wrote: > Mindaugas Rasiukevicius wrote: > > Why is it a problem? Given that the byte-code and the functions would > > come from the same source, some coupling seems natural to me. It is > > simplistic anyway: some already parsed offsets or values could be > > passed through the memory store. > > You surely have some picture in mind but I can't get it. I'm a bit > worried that two different environments may look unnatural when married > together. OK, but you did not explain why is it a problem i.e. why is it worrying? > Perhaps, you should right a proposal with some use-cases to support your > points. They are simple: consider detecting IP version and calculating the offset to L4 header. There is no reason to duplicate this work in the byte-code and the coprocessor. If one of them does it - let's just save it. > > > Ah, you plan to generalize scratch memory. It's probably fine but > > > don't generalize too many things because people (me at least) want to > > > be able to recognize the original bpf and its orignal design. > > > > Well, you suggested getter/setter. :) > > Yeah, please write a proposal ;-) > int bpf_get_memword(const bpf_ctx_t *c, size_t i, uint32_t *val); int bpf_set_memword(bpf_ctx_t *c, size_t i, uint32_t val); You prefer something like this? -- Mindaugas
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130808103304.2542614A2A9>