Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4522483imm; Fri, 18 May 2018 06:34:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo1IdCtYKeTLzkuJ8Q6id2WOGgr4El0UdUWnA7rL+uMT0vAlyremc4sP+qetU3jtIP0D0SS X-Received: by 2002:a63:8e42:: with SMTP id k63-v6mr7520640pge.278.1526650447058; Fri, 18 May 2018 06:34:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526650447; cv=none; d=google.com; s=arc-20160816; b=xDS5HE8SsbOnFppdmaPDyJ/xNH1C5S458Pw0QN35CR/BRnIn1pSR/kfp289hQSBBuy Ggdcpp+O6egfyyZHHJBOd6qrciDM4Zc1lr4kyQhSxYJ9m18+pjIhvsOcF5VqeuJNDnQg CgmfwU04D3uqT6vFcaSGW2WwL+67vt6UPGO2nTU6Qs6qRgAKXdgGmRkpL0EBn/SPx6Ku N1AMibXkUZuJjh4PebUYKhulZN252/TXS3UdK5SoZMfVu3kS+sATR7VEZdOSsiGtK0YN PcyFtsUqPAY/3fk47K2zwbbXdXVmT1vIkb7BDBlRj+GLlMrgIE4VgH/D2/jYGHrQyqGs hTaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=/HFA4oXd2RhPC8Q+0ij/JrrKl/CgWEMc37z0vg7efFM=; b=YUAqNeyTa6tG8/Op/qxumrbTr/KkBU1JTYAXB0dvxMvCUOJH9hyeX4OQiaYI8CSDOU lWFiWkUDwHZcskUgSp6OeNFl3plpLW25RDRugJbdzBjxDuLdLhn9tZstS47dgxdujGwZ ++zHZUDjDFe8R3Vfp8ugKP45bt6nz61mEKiE9fY6r+eehausYd+6PDxL2ynfJnmmS+ey 0DQ1HYQ/xoRd3EZDwWP0UTuooA6ll/SI35yGE94XAbKgSliUdGNuUcHlgKIzHpFS6UmO KBSmYDJ3srR+XDYU8RCQKGO8G5Fy2sZMJSUYdgkrGd5UPWmtWa5kd2j3a/NFH3KMxQE/ FkSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c3-v6si7372828pld.593.2018.05.18.06.33.50; Fri, 18 May 2018 06:34:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752373AbeERNdi (ORCPT + 99 others); Fri, 18 May 2018 09:33:38 -0400 Received: from gofer.mess.org ([88.97.38.141]:58891 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751560AbeERNdc (ORCPT ); Fri, 18 May 2018 09:33:32 -0400 Received: by gofer.mess.org (Postfix, from userid 1000) id 4374060644; Fri, 18 May 2018 14:33:30 +0100 (BST) Date: Fri, 18 May 2018 14:33:30 +0100 From: Sean Young To: Quentin Monnet Cc: Y Song , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Alexei Starovoitov , Mauro Carvalho Chehab , Daniel Borkmann , netdev , Matthias Reichl , Devin Heitmueller Subject: Re: [PATCH v3 2/2] bpf: add selftest for rawir_event type program Message-ID: <20180518133329.fafkew5nkr2bmzah@gofer.mess.org> References: <78945f2bf82e9f16695f72bed3930d1302d38e29.1526504511.git.sean@mess.org> <20180517210140.ck225yuckq6onheb@gofer.mess.org> <86ffb16c-9b4e-c826-ecd2-82266e7b8c2e@netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86ffb16c-9b4e-c826-ecd2-82266e7b8c2e@netronome.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > >>> > >>> 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 +- > >>> tools/testing/selftests/bpf/bpf_helpers.h | 6 + > >>> tools/testing/selftests/bpf/test_rawir.sh | 37 +++++ > >>> .../selftests/bpf/test_rawir_event_kern.c | 26 ++++ > >>> .../selftests/bpf/test_rawir_event_user.c | 130 ++++++++++++++++++ > >>> 8 files changed, 261 insertions(+), 5 deletions(-) > >>> create mode 100755 tools/testing/selftests/bpf/test_rawir.sh > >>> create mode 100644 tools/testing/selftests/bpf/test_rawir_event_kern.c > >>> create mode 100644 tools/testing/selftests/bpf/test_rawir_event_user.c > > [...] > > >> Most people probably not really familiar with lircN device. It would be > >> good to provide more information about how to enable this, e.g., > >> CONFIG_RC_CORE=y > >> CONFIG_BPF_RAWIR_EVENT=y > >> CONFIG_RC_LOOPBACK=y > >> ...... > > > > Good point. I'll add some words explaining what is and how to make it work. > > > > Thanks > > Sean > > > By the way, shouldn't the two eBPF helpers bpf_rc_keydown() and > bpf_rc_repeat() be compiled out in patch 1 if e.g. > CONFIG_BPF_RAWIR_EVENT is not set? There are some other helpers that are > compiled only if relevant config options are set (bpf_get_xfrm_state() > for example). So if CONFIG_BPF_RAWIR_EVENT is not set, then bpf-rawir-event.c is not compiled. Stubs are created in include/linux/bpf_rcdev.h, so this is already the case if I understand your correctly. > (If you were to change that, please also update helper documentations to > indicate what configuration options are required to be able to use the > helpers.) Ok, I'll add that. Thanks again! Sean