[PATCH v3 3/4] bpftool: add support for ints larger than 128 bits

2021-01-05 Thread Sean Young
-types Link: https://reviews.llvm.org/D93103 Signed-off-by: Sean Young --- tools/bpf/bpftool/btf_dumper.c | 40 ++ 1 file changed, 40 insertions(+) diff --git a/tools/bpf/bpftool/btf_dumper.c b/tools/bpf/bpftool/btf_dumper.c index 0e9310727281..8b5318ec5c26 100644

[PATCH v3 2/4] libbpf: add support for ints larger than 128 bits

2021-01-05 Thread Sean Young
-types Link: https://reviews.llvm.org/D93103 Signed-off-by: Sean Young --- tools/lib/bpf/btf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c index 3c3f2bc6c652..a676373f052b 100644 --- a/tools/lib/bpf/btf.c +++ b/tools/lib/bpf/btf.c

[PATCH v3 1/4] btf: add support for ints larger than 128 bits

2021-01-05 Thread Sean Young
review. Link: https://clang.llvm.org/docs/LanguageExtensions.html#extended-integer-types Link: https://reviews.llvm.org/D93103 Signed-off-by: Sean Young --- Documentation/bpf/btf.rst | 4 +-- include/uapi/linux/btf.h | 2 +- kernel/bpf/btf.c | 54

[PATCH v3 4/4] bpf: add tests for ints larger than 128 bits

2021-01-05 Thread Sean Young
review. Link: https://clang.llvm.org/docs/LanguageExtensions.html#extended-integer-types Link: https://reviews.llvm.org/D93103 Signed-off-by: Sean Young --- tools/testing/selftests/bpf/Makefile | 3 +- tools/testing/selftests/bpf/prog_tests/btf.c | 3 +- .../selftests/bpf/progs

[PATCH v3 0/4] btf: support ints larger than 128 bits

2021-01-05 Thread Sean Young
review. Link: https://clang.llvm.org/docs/LanguageExtensions.html#extended-integer-types Link: https://reviews.llvm.org/D93103 Signed-off-by: Sean Young changes since v2: - split patches into 4 distinct patches changes since v1: - added tests as suggested by Yonghong Song - added kernel

Re: [PATCH v2] btf: support ints larger than 128 bits

2021-01-05 Thread Sean Young
On Wed, Dec 30, 2020 at 10:21:09AM -0800, Yonghong Song wrote: > On 12/19/20 8:36 AM, Sean Young wrote: > > clang supports arbitrary length ints using the _ExtInt extension. This > > can be useful to hold very large values, e.g. 256 bit or 512 bit types. > > > > Larger

[PATCH v2] btf: support ints larger than 128 bits

2020-12-19 Thread Sean Young
review. Link: https://clang.llvm.org/docs/LanguageExtensions.html#extended-integer-types Link: https://reviews.llvm.org/D93103 Signed-off-by: Sean Young --- changes since v2: - added tests as suggested by Yonghong Song - added kernel pretty-printer Documentation/bpf/btf.rst

Re: [PATCH] btf: support ints larger than 128 bits

2020-12-18 Thread Sean Young
Hi Yonghong, Thank you for the detailed review. On Thu, Dec 17, 2020 at 06:12:11PM -0800, Yonghong Song wrote: > On 12/17/20 7:01 AM, Sean Young wrote: > > clang supports arbitrary length ints using the _ExtInt extension. This > > can be useful to hold very large values, e.g. 256

[PATCH] btf: support ints larger than 128 bits

2020-12-17 Thread Sean Young
, which is under review. Link: https://clang.llvm.org/docs/LanguageExtensions.html#extended-integer-types Link: https://reviews.llvm.org/D93103 Signed-off-by: Sean Young --- Documentation/bpf/btf.rst | 4 ++-- include/uapi/linux/btf.h | 2 +- tools/bpf/bpftool/btf_dumper.c | 39

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-25 Thread Sean Young
On Mon, Nov 23, 2020 at 07:58:06AM -0800, James Bottomley wrote: > On Mon, 2020-11-23 at 15:19 +0100, Miguel Ojeda wrote: > > On Sun, Nov 22, 2020 at 11:36 PM James Bottomley > > wrote: > > > It's not about the risk of the changes it's about the cost of > > > implementing them. Even if you discou

[PATCH bpf-next v3] media: bpf: add bpf function to report mouse movement

2018-12-06 Thread Sean Young
Some IR remotes have a directional pad or other pointer-like thing that can be used as a mouse. Make it possible to decode these types of IR protocols in BPF. Cc: netdev@vger.kernel.org Signed-off-by: Sean Young --- drivers/media/rc/bpf-lirc.c | 24 +++ include/uapi/linux

Re: [PATCH v2] media: bpf: add bpf function to report mouse movement

2018-11-26 Thread Sean Young
Hi Daniel, On Mon, Nov 26, 2018 at 01:55:36AM +0100, Daniel Borkmann wrote: > Hi Sean, > > On 11/23/2018 12:50 PM, Sean Young wrote: > > Some IR remotes have a directional pad or other pointer-like thing that > > can be used as a mouse. Make it possible to decode these type

[PATCH v2] media: bpf: add bpf function to report mouse movement

2018-11-23 Thread Sean Young
Some IR remotes have a directional pad or other pointer-like thing that can be used as a mouse. Make it possible to decode these types of IR protocols in BPF. Cc: netdev@vger.kernel.org Signed-off-by: Sean Young --- drivers/media/rc/bpf-lirc.c | 24 +++ include

[PATCH v5 2/3] media: rc: introduce BPF_PROG_LIRC_MODE2

2018-05-27 Thread Sean Young
device. Acked-by: Yonghong Song Signed-off-by: Sean Young --- drivers/media/rc/Kconfig| 13 ++ drivers/media/rc/Makefile | 1 + drivers/media/rc/bpf-lirc.c | 313 drivers/media/rc/lirc_dev.c | 30 +++ drivers/media/rc/rc-core-priv.h | 21

[PATCH v5 1/3] bpf: bpf_prog_array_copy() should return -ENOENT if exclude_prog not found

2018-05-27 Thread Sean Young
This makes is it possible for bpf prog detach to return -ENOENT. Acked-by: Yonghong Song Signed-off-by: Sean Young --- kernel/bpf/core.c| 11 +-- kernel/trace/bpf_trace.c | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/kernel/bpf/core.c b/kernel/bpf

[PATCH v5 0/3] IR decoding using BPF

2018-05-27 Thread Sean Young
ally every remote without having to write a decoder for each. It might also be possible to support non-button devices such as analog directional pads or air conditioning remote controls and decode the target temperature in bpf, and pass that to an input device. Thanks, Sean Young [1] http:

[PATCH v5 3/3] bpf: add selftest for lirc_mode2 type program

2018-05-27 Thread Sean Young
This is simple test over rc-loopback. Acked-by: Yonghong Song Signed-off-by: Sean Young --- tools/bpf/bpftool/prog.c | 1 + tools/include/uapi/linux/bpf.h| 53 - tools/include/uapi/linux/lirc.h | 217 ++ tools/lib/bpf

Re: [PATCH v4 2/3] media: rc: introduce BPF_PROG_LIRC_MODE2

2018-05-26 Thread Sean Young
On Fri, May 25, 2018 at 01:45:11PM -0700, Alexei Starovoitov wrote: > On Fri, May 18, 2018 at 03:07:29PM +0100, Sean Young wrote: > > Add support for BPF_PROG_LIRC_MODE2. This type of BPF program can call > > rc_keydown() to reported decoded IR scancodes, or rc_repeat() to report &g

Re: [PATCH v4 0/3] IR decoding using BPF

2018-05-23 Thread Sean Young
On Wed, May 23, 2018 at 02:21:27PM +0200, Daniel Borkmann wrote: > On 05/18/2018 04:07 PM, Sean Young wrote: > > The kernel IR decoders (drivers/media/rc/ir-*-decoder.c) support the most > > widely used IR protocols, but there are many protocols which are not > > supported

[PATCH v4 0/3] IR decoding using BPF

2018-05-18 Thread Sean Young
ally every remote without having to write a decoder for each. It might also be possible to support non-button devices such as analog directional pads or air conditioning remote controls and decode the target temperature in bpf, and pass that to an input device. Thanks, Sean Young [1] http:

[PATCH v4 3/3] bpf: add selftest for lirc_mode2 type program

2018-05-18 Thread Sean Young
This is simple test over rc-loopback. Signed-off-by: Sean Young --- tools/bpf/bpftool/prog.c | 1 + tools/include/uapi/linux/bpf.h| 53 - tools/include/uapi/linux/lirc.h | 217 ++ tools/lib/bpf/libbpf.c

[PATCH v4 2/3] media: rc: introduce BPF_PROG_LIRC_MODE2

2018-05-18 Thread Sean Young
device. Signed-off-by: Sean Young --- drivers/media/rc/Kconfig| 13 ++ drivers/media/rc/Makefile | 1 + drivers/media/rc/bpf-lirc.c | 308 drivers/media/rc/lirc_dev.c | 30 drivers/media/rc/rc-core-priv.h | 22 +++ drivers/media/rc/rc

[PATCH v4 1/3] bpf: bpf_prog_array_copy() should return -ENOENT if exclude_prog not found

2018-05-18 Thread Sean Young
This makes is it possible for bpf prog detach to return -ENOENT. Signed-off-by: Sean Young --- kernel/bpf/core.c| 11 +-- kernel/trace/bpf_trace.c | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 2194c6a9df42

Re: [PATCH v3 2/2] bpf: add selftest for rawir_event type program

2018-05-18 Thread Sean Young
On Fri, May 18, 2018 at 11:13:07AM +0100, Quentin Monnet wrote: > 2018-05-17 22:01 UTC+0100 ~ Sean Young > > On Thu, May 17, 2018 at 10:17:59AM -0700, Y Song wrote: > >> On Wed, May 16, 2018 at 2:04 PM, Sean Young wrote: > >>> This is simple test over rc-loopback. &

Re: [PATCH v3 1/2] media: rc: introduce BPF_PROG_RAWIR_EVENT

2018-05-17 Thread Sean Young
Hi, Again thanks for a thoughtful review. This will definitely will improve the code. On Thu, May 17, 2018 at 10:02:52AM -0700, Y Song wrote: > On Wed, May 16, 2018 at 2:04 PM, Sean Young wrote: > > Add support for BPF_PROG_RAWIR_EVENT. This type of BPF program can call > >

Re: [PATCH v3 2/2] bpf: add selftest for rawir_event type program

2018-05-17 Thread Sean Young
On Thu, May 17, 2018 at 10:17:59AM -0700, Y Song wrote: > On Wed, May 16, 2018 at 2:04 PM, Sean Young wrote: > > This is simple test over rc-loopback. > > > > Signed-off-by: Sean Young > > --- > > tools/bpf/bpftool/prog.c | 1 + &g

Re: [PATCH v3 1/2] media: rc: introduce BPF_PROG_RAWIR_EVENT

2018-05-17 Thread Sean Young
Hi Quentin, On Thu, May 17, 2018 at 01:10:56PM +0100, Quentin Monnet wrote: > 2018-05-16 22:04 UTC+0100 ~ Sean Young > > Add support for BPF_PROG_RAWIR_EVENT. This type of BPF program can call > > rc_keydown() to reported decoded IR scancodes, or rc_repeat() to report > &

[PATCH v3 1/2] media: rc: introduce BPF_PROG_RAWIR_EVENT

2018-05-16 Thread Sean Young
device. Signed-off-by: Sean Young --- drivers/media/rc/Kconfig | 13 ++ drivers/media/rc/Makefile | 1 + drivers/media/rc/bpf-rawir-event.c | 363 + drivers/media/rc/lirc_dev.c| 24 ++ drivers/media/rc/rc-core-priv.h| 24 ++ drivers

[PATCH v3 2/2] bpf: add selftest for rawir_event type program

2018-05-16 Thread Sean Young
This is simple test over rc-loopback. Signed-off-by: Sean Young --- tools/bpf/bpftool/prog.c | 1 + tools/include/uapi/linux/bpf.h| 57 +++- tools/lib/bpf/libbpf.c| 1 + tools/testing/selftests/bpf/Makefile | 8

[PATCH v3 0/2] IR decoding using BPF

2018-05-16 Thread Sean Young
ally every remote without having to write a decoder for each. It might also be possible to support non-button devices such as analog directional pads or air conditioning remote controls and decode the target temperature in bpf, and pass that to an input device. Thanks, Sean Young [1] http:

Re: [PATCH v2 1/2] media: rc: introduce BPF_PROG_RAWIR_EVENT

2018-05-16 Thread Sean Young
On Tue, May 15, 2018 at 07:50:19PM +0100, Sean Young wrote: > Add support for BPF_PROG_RAWIR_EVENT. This type of BPF program can call > rc_keydown() to reported decoded IR scancodes, or rc_repeat() to report > that the last key should be repeated. > > The bpf program can be attach

[PATCH v2 0/2] IR decoding using BPF

2018-05-15 Thread Sean Young
nderway to extend ir-keytable to have an extensive library of bpf-based decoders, and a much expanded library of rc keymaps. Another future application would be to compile IRP[3] to a IR BPF program, and so support virtually every remote without having to write a decoder for each. Thanks, Sean

[PATCH v2 2/2] bpf: add selftest for rawir_event type program

2018-05-15 Thread Sean Young
This is simple test over rc-loopback. Signed-off-by: Sean Young --- tools/bpf/bpftool/prog.c | 1 + tools/include/uapi/linux/bpf.h| 55 +++- tools/lib/bpf/libbpf.c| 1 + tools/testing/selftests/bpf/Makefile | 7

[PATCH v2 1/2] media: rc: introduce BPF_PROG_RAWIR_EVENT

2018-05-15 Thread Sean Young
device. Signed-off-by: Sean Young --- drivers/media/rc/Kconfig | 10 + drivers/media/rc/Makefile | 1 + drivers/media/rc/bpf-rawir-event.c | 322 + drivers/media/rc/lirc_dev.c| 28 +++ drivers/media/rc/rc-core-priv.h| 19 ++ drivers

Re: [PATCH v1 1/4] media: rc: introduce BPF_PROG_IR_DECODER

2018-05-15 Thread Sean Young
On Mon, May 14, 2018 at 04:27:19PM -0700, Randy Dunlap wrote: > On 05/14/2018 02:10 PM, Sean Young wrote: > > Add support for BPF_PROG_IR_DECODER. This type of BPF program can call > > Kconfig file below uses IR_BPF_DECODER instead of the symbol name above. > > and then

Re: [PATCH v1 4/4] samples/bpf: an example of a raw IR decoder

2018-05-15 Thread Sean Young
On Mon, May 14, 2018 at 10:34:57PM -0700, Y Song wrote: > On Mon, May 14, 2018 at 2:11 PM, Sean Young wrote: > > This implements the grundig-16 IR protocol. > > > > Signed-off-by: Sean Young > > --- > > samples/bpf/Makefile |

Re: [PATCH v1 1/4] media: rc: introduce BPF_PROG_IR_DECODER

2018-05-15 Thread Sean Young
On Mon, May 14, 2018 at 09:48:05PM -0700, Y Song wrote: > On Mon, May 14, 2018 at 2:10 PM, Sean Young wrote: > > Add support for BPF_PROG_IR_DECODER. This type of BPF program can call > > rc_keydown() to reported decoded IR scancodes, or rc_repeat() to report > > that t

[PATCH v1 1/4] media: rc: introduce BPF_PROG_IR_DECODER

2018-05-14 Thread Sean Young
Add support for BPF_PROG_IR_DECODER. This type of BPF program can call rc_keydown() to reported decoded IR scancodes, or rc_repeat() to report that the last key should be repeated. Signed-off-by: Sean Young --- drivers/media/rc/Kconfig | 8 +++ drivers/media/rc/Makefile | 1

[PATCH v1 0/4] IR decoding using BPF

2018-05-14 Thread Sean Young
nderway to extend ir-keytable to have an extensive library of bpf-based decoders, and a much expanded library of rc keymaps. Another future application would be to compile IRP[3] to a IR BPF program, and so support virtually every remote without having to write a decoder for each. Thanks, Sean

[PATCH v1 3/4] media: rc bpf: move ir_raw_event to uapi

2018-05-14 Thread Sean Young
The context provided to a BPF_PROG_RAWIR_DECODER is a struct ir_raw_event; ensure user space has a a definition. Signed-off-by: Sean Young --- include/media/rc-core.h| 19 +-- include/uapi/linux/bpf_rcdev.h | 24 2 files changed, 25 insertions

[PATCH v1 2/4] media: bpf: allow raw IR decoder bpf programs to be used

2018-05-14 Thread Sean Young
This implements attaching, detaching, querying and execution. The target fd has to be the /dev/lircN device. Signed-off-by: Sean Young --- drivers/media/rc/ir-bpf-decoder.c | 191 ++ drivers/media/rc/lirc_dev.c | 30 + drivers/media/rc/rc-core-priv.h

[PATCH v1 4/4] samples/bpf: an example of a raw IR decoder

2018-05-14 Thread Sean Young
This implements the grundig-16 IR protocol. Signed-off-by: Sean Young --- samples/bpf/Makefile | 4 + samples/bpf/bpf_load.c| 9 +- samples/bpf/grundig_decoder_kern.c| 112 ++ samples/bpf/grundig_decoder_user.c