From: Jordan Rife <jordan@xxxxxxxx> Date: Fri, 11 Apr 2025 10:35:43 -0700 > Replace the offset-based approach for tracking progress through a bucket > in the UDP table with one based on socket cookies. Remember the cookies > of unprocessed sockets from the last batch and use this list to > pick up where we left off or, in the case that the next socket > disappears between reads, find the first socket after that point that > still exists in the bucket and resume from there. > > In order to make the control flow a bit easier to follow inside > bpf_iter_udp_batch, introduce the udp_portaddr_for_each_entry_from macro > and use this to split bucket processing into two stages: finding the > starting point and adding items to the next batch. Originally, I > implemented this patch inside a single udp_portaddr_for_each_entry loop, > as it was before, but I found the resulting logic a bit messy. Overall, > this version seems more readable. > > Signed-off-by: Jordan Rife <jordan@xxxxxxxx> Reviewed-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx> Thanks!