Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9155952rwl; Wed, 11 Jan 2023 02:06:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXtBhypxHrhlSL1mzF7vsVUKfXmkwu8O3SRU+QYM2X6u8NVY0FEASpF6+VzndYCpM4jUmtPW X-Received: by 2002:a17:902:7c08:b0:193:13fc:8840 with SMTP id x8-20020a1709027c0800b0019313fc8840mr17983157pll.21.1673431586373; Wed, 11 Jan 2023 02:06:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673431586; cv=none; d=google.com; s=arc-20160816; b=pLJHMpUCSRC/X1v86zHPDsl/JjK4xAqF6GaFmWm3y/ZmJt/P2L9FsE4811Rx/48HoQ hliTTCe6dlsYrZhrMbtBpfy6EQkYe5xotOXjj3KDnkA4A/KKweOKvOFDMbUGV9sKINv/ rOEAOezx5k5cF71P+cj6BnrBzxqRSUGeR8Lv7zBa4/CeQ2paaBU4/aLf3djMh4pxSeI3 S77GX9C5wL/LP41S3rVBNEuGU4QqHADiw3jGbuJzUNkEB2nvSYpfL0bwlGwAMUI2oSwm U0TNtQfrtcYpc3BOqMlQr7cTSG7f0waYDRRQRC36Eayow6goeabUKZTm1srHcudjbh7I mANw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UE0xeHCU2bfsdgMc1zyv/Lgw7gDb0/ii1vRY0TiYYqA=; b=FEbt0A5fCxiXgDlaO/lqo6IgJvsfLcOy21RQvBiwqqXbDEcSfe2DxDUKg/ichUYJ/X Bxmf5kKvrpjFgCei4yK7/q6AAnomz6L0FG6CmmndXxGe0eCtvvwThr0n3mVL3zkrlBSk VTGAFQL6Vvrdcc3ylMVP7wCxuj45ygCsTXurO64pFHWiO9BvpOrj2BAgWq4aJQAlcAGc DG74YakPA+ZbCO9XAq24eF2CB+TT7ghxHtxdH2cdOaNVqqz/uvQ/DQdX8o2xxl8EtfeB vJxyGnoAhZqYqm8F5ye2cz2FjpKb06YDuaOag0MEedfSgU7d9Wa4HNSKGwP1ekch7LZj s7Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=F0Qzc9pO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b21-20020a170902d89500b001897bfc97fesi3378944plz.54.2023.01.11.02.06.19; Wed, 11 Jan 2023 02:06:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=F0Qzc9pO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239044AbjAKJvW (ORCPT + 53 others); Wed, 11 Jan 2023 04:51:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239358AbjAKJt1 (ORCPT ); Wed, 11 Jan 2023 04:49:27 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3D0911149 for ; Wed, 11 Jan 2023 01:47:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673430441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UE0xeHCU2bfsdgMc1zyv/Lgw7gDb0/ii1vRY0TiYYqA=; b=F0Qzc9pOcBHuo5Dde0ELojDlA4f5urFDt1ws+oXym06rv8eG33z9EgVqY3ASn5cGyA6ktC q6QYvf6FWHasKjS14G1dqiRtZQJxxBRCLqclHzmhwOkLjUeLQ9FqSGibRbLofFu8ywA/Su 8JLKUOldYAVYoQfpgZJcigTnV6uwMqo= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-554-axw3-0z_MzSJyQCJzF7c7Q-1; Wed, 11 Jan 2023 04:47:20 -0500 X-MC-Unique: axw3-0z_MzSJyQCJzF7c7Q-1 Received: by mail-io1-f72.google.com with SMTP id t15-20020a5d81cf000000b006f95aa9ba6eso8761137iol.16 for ; Wed, 11 Jan 2023 01:47:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UE0xeHCU2bfsdgMc1zyv/Lgw7gDb0/ii1vRY0TiYYqA=; b=AtvzAc+EJLl2wdgP1gcK/qAipx9ClxMp4Qewfm6b8TdcHoSPMdFzDEgK2QfKUPDGTq c3WE1+VAiER7I8NLasLZyA0yt1r7YJG8eNkV5r3M3L7oZuACbi+kS+45pe4fnH/nTeJK w0T3yTf/3b1n6Ys4O3ZCKIFuJcboOXQt5wVbEDzY9Qbn0E9GDaoFdvy1Tej8b8Qg07Mk psXPzKtjOg7mYAgcqvFXnziB7c0MZIKYNjNjMZ5LG14R5Byvwipe/w22FBGLCzMu8xnB jYjIbXVmL8Eb/uleuJ01T3SJOEya5ntEzhh4NJ+UH4YKR2tzbGu2NzIJrXzRmi4QLU8o TWGA== X-Gm-Message-State: AFqh2kojKEXB7QTxkCF7oEkzwXQX3ZZWS5xfcqKUhYy5Uy/K50q9KlMZ wE2I/ldMIdzZZ7EGUii/RpbBEYEUfVPLMqaRFBaIqaHU1caRCI8jvlJfhHOlQNLnFoEEt1Dej7n qFkoR3pjdIIKXdHof+vfCroa4fvcCmIIaitTWQ0hw X-Received: by 2002:a05:6602:449:b0:6df:bfeb:f15d with SMTP id e9-20020a056602044900b006dfbfebf15dmr5813363iov.122.1673430439236; Wed, 11 Jan 2023 01:47:19 -0800 (PST) X-Received: by 2002:a05:6602:449:b0:6df:bfeb:f15d with SMTP id e9-20020a056602044900b006dfbfebf15dmr5813358iov.122.1673430439027; Wed, 11 Jan 2023 01:47:19 -0800 (PST) MIME-Version: 1.0 References: <20230106102332.1019632-1-benjamin.tissoires@redhat.com> <20230106102332.1019632-7-benjamin.tissoires@redhat.com> <20230111061054.dqduab66plb6uzg2@macbook-pro-6.dhcp.thefacebook.com> In-Reply-To: <20230111061054.dqduab66plb6uzg2@macbook-pro-6.dhcp.thefacebook.com> From: Benjamin Tissoires Date: Wed, 11 Jan 2023 10:47:07 +0100 Message-ID: Subject: Re: [PATCH HID for-next v1 6/9] HID: bpf: rework how programs are attached and stored in the kernel To: Alexei Starovoitov Cc: Greg KH , Jiri Kosina , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Dmitry Torokhov , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 Wed, Jan 11, 2023 at 7:11 AM Alexei Starovoitov wrote: > > On Fri, Jan 06, 2023 at 11:23:29AM +0100, Benjamin Tissoires wrote: > > > > +static void hid_bpf_link_release(struct bpf_link *link) > > +{ > > + struct hid_bpf_link *hid_link = > > + container_of(link, struct hid_bpf_link, link); > > + > > + __clear_bit(hid_link->index, jmp_table.enabled); > > + schedule_work(&release_work); > > +} > > ... > > > + link->index = prog_idx; > > I was super confused that you use prog_idx as a bit in jmp_table > and had to look into your tree what hid_bpf_jmp_table.c is doing. > Looks like it's not prog_id (which is prog->aux->id) that we know. > It's hid specific prog idx in that jmp table. > Maybe would be good to rename your prog_idx to something with 'hid' suffix or prefix? > or 'table' suffix or prefix ? > prog_table_idx ? prog_table_idx sounds good :) > > Other than that the patch set looking great. great, thanks! > I'm assuming removing call_hid_bpf_prog_put_deferred() and everything related > comes in the next set? > Yep. I'll probably send it tomorrow. I have a bunch of urgent corporate stuff to do today so won't have time for the fun part of the job :( Cheers, Benjamin