Re: [RFC PATCH bpf-next 0/3] Avoid skipping sockets with socket iterators
From: Jordan Rife <hidden>
Date: 2025-03-31 21:58:25
Also in:
bpf
From: Jordan Rife <hidden>
Date: 2025-03-31 21:58:25
Also in:
bpf
quoted
array scanning could be slow, but since changes to a bucket should be rare, one optimization could be to only compare to the saved socket cookies if the bucket has changed since it was last seen. I think saving and checking the head, tail, and size of the bucket's linked list should be sufficient for this?Not sure if head, tail, and size stay the same is enough to imply the bucket('s linked list) has not changed. I think tcp may be ok since I currently don't see a way to re-bind() a bind()-ed socket without close()-ing it. I don't know about the connected UDP...etc.
Yeah, forget about the head/tail/size thing. I think I was still waking up when I typed this :). A linear scan through the cookie list should be enough as you say.
I think udp should be easier to begin with for PoC.
Ack, sg. I'll start with UDP iterators. -Jordan