On Mon, Mar 7, 2022 at 7:12 PM Song Liu <song@xxxxxxxxxx> wrote: > > On Sat, Mar 5, 2022 at 2:23 AM Benjamin Tissoires > <benjamin.tissoires@xxxxxxxxxx> wrote: > > > > > > > > > > The set looks good so far. I will review the rest later. > > > > > > [...] > > > > > > A quick note about how we organize these patches. Maybe we can > > > merge some of these patches like: > > > > Just to be sure we are talking about the same thing: you mean squash > > the patch together? > > Right, squash some patches together. > > > > > > > > > > bpf: introduce hid program type > > > > bpf/hid: add a new attach type to change the report descriptor > > > > bpf/hid: add new BPF type to trigger commands from userspace > > > I guess the three can merge into one. > > > > > > > HID: hook up with bpf > > > > HID: allow to change the report descriptor from an eBPF program > > > > HID: bpf: compute only the required buffer size for the device > > > > HID: bpf: only call hid_bpf_raw_event() if a ctx is available > > > I haven't read through all of them, but I guess they can probably merge > > > as well. > > > > There are certainly patches that we could squash together (3 and 4 > > from this list into the previous ones), but I'd like to keep some sort > > of granularity here to not have a patch bomb that gets harder to come > > back later. > > Totally agreed with the granularity of patches. I am not a big fan of patch > bombs either. :) > > I guess the problem I have with the current version is that I don't have a > big picture of the design while reading through relatively big patches. A > overview with the following information in the cover letter would be really > help here: > 1. How different types of programs are triggered (IRQ, user input, etc.); > 2. What are the operations and/or outcomes of these programs; > 3. How would programs of different types (or attach types) interact > with each other (via bpf maps? chaining?) > 4. What's the new uapi; > 5. New helpers and other logistics > > Sometimes, I find the changes to uapi are the key for me to understand the > patches, and I would like to see one or two patches with all the UAPI > changes (i.e. bpf_hid_attach_type). However, that may or may not apply to > this set due to granularity concerns. > > Does this make sense? > It definitely does. And as I read that, I realized that if I manage to get such a clear depiction of what HID-BPF is, it would certainly be a good idea to paste that in a file into the Documentation directory as well :) I think you have a slightly better picture now with the exchanges we are having on the individual patches, but I'll try to come out with that description in the cover letter for v3. Cheers, Benjamin