Re: [PATCH HID for-next v1 6/9] HID: bpf: rework how programs are attached and stored in the kernel

From
Benjamin Tissoires <hidden>
Date
2023-01-11 09:51:28
Also in
bpf, linux-input, linux-kselftest, lkml
Reply to
Alexei Starovoitov, 2023-01-11
On Wed, Jan 11, 2023 at 7:11 AM Alexei Starovoitov
[off-list ref] wrote:
On Fri, Jan 06, 2023 at 11:23:29AM +0100, Benjamin Tissoires wrote:
quoted

+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);
+}
...
quoted
+     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
Thread (19 messages) 19 messages, 4 authors, last reply 2023-01-11
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help