Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2273126pxm; Fri, 4 Mar 2022 12:51:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6KLQRL7MGilKVyoZoMjlA4sxLJ/dqD2X4Ipw/IZhVM04htCt39dvU1Dbw9lXf0SpFUkE6 X-Received: by 2002:a65:6210:0:b0:374:ba5:aacc with SMTP id d16-20020a656210000000b003740ba5aaccmr203049pgv.8.1646427064626; Fri, 04 Mar 2022 12:51:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646427064; cv=none; d=google.com; s=arc-20160816; b=LzNNlUzWRQQFVRAWXGS87B7uewpcIdOrvRHhGTzgCie7BiII6I4ETGdrWJ6+Zqo79E 5WByx2L0VNsEoZb5gAMXynqfV2J8YCNkUMV+0ips0jraPEyGrpDE2fdpxrEWBYVcWyQs rWZpEPLP/iBzYOJ19IRPG8H5b3B2uySk07pU518NhOJVfNuL34lt45iHDYyA7J/KQ411 6j2qr5RrCeZV6ozvWfdGN0ghHAJFW8Uamdmt0w/Bv0208oA4bDlyFcctnibs/iNG2poI iEzLB20FojxA3UloMwN1+UrmM5BvcCYuIjmSdfe0KEdZ4kra1QgVM/Z0Szwy9gVEGHHh nNuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Nuc/5hBsCyruOfeboWRpb10GIeOZBn8FSMvc7NlLzp8=; b=gPMV6MeYIFvuIQ9Qvwfy+GuhdBjglkTw3HuWyeRrC3x8oP2w9qwZscT8oi/ZnF6o5m SeH8r03e9kaFZcfi7A6AgodzcR0mv0kCbUDrvLxRm2HtFPp8lB25Pb8JLkiQMclGJXYi qc1Wpy6RQXFIU3Z1lNnIfuEZwJXsTOpeStfPX8g3egwu3Zw3FI0bUCh8RZN5x346XBPT KOi9GVWwupHKozRQIdkAJ0zA+JA4zgL3hIgG+Vc/bLWDfPesFtgRlQgN/8uMwtPKz3yY z9sjQqHc6sR6O/beE0gQuHxAj2vKw8GrUNY2yoSL3lTxCMi8h08/jvNG6PjPtKmpWnGN rxYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jNbL0hn+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c17-20020a056a00009100b004f69c06cd59si3799309pfj.81.2022.03.04.12.51.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 12:51:04 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jNbL0hn+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2EAB6972DC; Fri, 4 Mar 2022 11:45:06 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241665AbiCDS1c (ORCPT + 99 others); Fri, 4 Mar 2022 13:27:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231935AbiCDS1b (ORCPT ); Fri, 4 Mar 2022 13:27:31 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8352E1D3061; Fri, 4 Mar 2022 10:26:43 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1850D61534; Fri, 4 Mar 2022 18:26:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FD82C340E9; Fri, 4 Mar 2022 18:26:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646418402; bh=lZ5n04NgZ1D27gTQ8O/RajGUXL+JNv3iY0Tkd5tklKg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jNbL0hn+u+RsOR9Tq7OrSd3wUlLkerAoPtS5gjHUcpU+6x7JAD2YYvpqrTa3tZ2oq fcVWGqWuTiPZ1zlQrlLv4Xq2MeisIKYE86ivbPEYuyAAdSLxkRcf6gOQk7Azh6TVhE 9tHI8TzD5eciHd+qhVA+MmrO8U/1l5JC4CGqAgjw= Date: Fri, 4 Mar 2022 19:26:23 +0100 From: Greg KH To: Benjamin Tissoires Cc: Jiri Kosina , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Shuah Khan , Dave Marchevsky , Joe Stringer , Tero Kristo , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH bpf-next v2 06/28] samples/bpf: add new hid_mouse example Message-ID: References: <20220304172852.274126-1-benjamin.tissoires@redhat.com> <20220304172852.274126-7-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220304172852.274126-7-benjamin.tissoires@redhat.com> X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, URIBL_RED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 04, 2022 at 06:28:30PM +0100, Benjamin Tissoires wrote: > Everything should be available in the selftest part of the tree, but > providing an example without uhid and hidraw will be more easy to > follow for users. > > Signed-off-by: Benjamin Tissoires > > --- > > changes in v2: > - split the series by bpf/libbpf/hid/selftests and samples > --- > samples/bpf/.gitignore | 1 + > samples/bpf/Makefile | 4 ++ > samples/bpf/hid_mouse_kern.c | 66 ++++++++++++++++++ > samples/bpf/hid_mouse_user.c | 129 +++++++++++++++++++++++++++++++++++ > 4 files changed, 200 insertions(+) > create mode 100644 samples/bpf/hid_mouse_kern.c > create mode 100644 samples/bpf/hid_mouse_user.c > > diff --git a/samples/bpf/.gitignore b/samples/bpf/.gitignore > index 0e7bfdbff80a..65440bd618b2 100644 > --- a/samples/bpf/.gitignore > +++ b/samples/bpf/.gitignore > @@ -2,6 +2,7 @@ > cpustat > fds_example > hbm > +hid_mouse > ibumad > lathist > lwt_len_hist > diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile > index 38638845db9d..84ef458487df 100644 > --- a/samples/bpf/Makefile > +++ b/samples/bpf/Makefile > @@ -60,6 +60,8 @@ tprogs-y += xdp_redirect_map > tprogs-y += xdp_redirect > tprogs-y += xdp_monitor > > +tprogs-y += hid_mouse > + > # Libbpf dependencies > LIBBPF_SRC = $(TOOLS_PATH)/lib/bpf > LIBBPF_OUTPUT = $(abspath $(BPF_SAMPLES_PATH))/libbpf > @@ -124,6 +126,7 @@ xdp_redirect_cpu-objs := xdp_redirect_cpu_user.o $(XDP_SAMPLE) > xdp_redirect_map-objs := xdp_redirect_map_user.o $(XDP_SAMPLE) > xdp_redirect-objs := xdp_redirect_user.o $(XDP_SAMPLE) > xdp_monitor-objs := xdp_monitor_user.o $(XDP_SAMPLE) > +hid_mouse-objs := hid_mouse_user.o > > # Tell kbuild to always build the programs > always-y := $(tprogs-y) > @@ -181,6 +184,7 @@ always-y += ibumad_kern.o > always-y += hbm_out_kern.o > always-y += hbm_edt_kern.o > always-y += xdpsock_kern.o > +always-y += hid_mouse_kern.o > > ifeq ($(ARCH), arm) > # Strip all except -D__LINUX_ARM_ARCH__ option needed to handle linux > diff --git a/samples/bpf/hid_mouse_kern.c b/samples/bpf/hid_mouse_kern.c > new file mode 100644 > index 000000000000..c24a12e06b40 > --- /dev/null > +++ b/samples/bpf/hid_mouse_kern.c > @@ -0,0 +1,66 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* Copyright (c) 2021 Benjamin Tissoires It's 2022 now :( Other than that, looks nice and simple, good work! Reviewed-by: Greg Kroah-Hartman