Better linked-list traversal in BPF
Better linked-list traversal in BPF
Posted Mar 8, 2024 18:14 UTC (Fri) by mb (subscriber, #50428)In reply to: Better linked-list traversal in BPF by epa
Parent article: Better linked-list traversal in BPF
You don't need magic for that:
if (curr->next == curr + 1) ++curr;
else curr = curr->next;
But I don't get why that would help.
You can just say curr = curr->next, because you need to load the next pointer anyway.
I wouldn't be surprised if the compiler would optimize it into that.
