Re: [PATCH v4 bpf-next 00/12] bpf: tcp: Exactly-once socket iteration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/07, Jordan Rife wrote:
> TCP socket iterators use iter->offset to track progress through a
> bucket, which is a measure of the number of matching sockets from the
> current bucket that have been seen or processed by the iterator. On
> subsequent iterations, if the current bucket has unprocessed items, we
> skip at least iter->offset matching items in the bucket before adding
> any remaining items to the next batch. However, iter->offset isn't
> always an accurate measure of "things already seen" when the underlying
> bucket changes between reads, which can lead to repeated or skipped
> sockets. Instead, this series remembers the cookies of the sockets we
> haven't seen yet in the current bucket and resumes from the first cookie
> in that list that we can find on the next iteration.
> 
> This is a continuation of the work started in [1]. This series largely
> replicates the patterns applied to UDP socket iterators, applying them
> instead to TCP socket iterators.
> 
> CHANGES
> =======
> v3 -> v4:
> * Drop braces around sk_nulls_for_each_from in patch five ("bpf: tcp:
>   Avoid socket skips and repeats during iteration") (Stanislav).
> * Add a break after the TCP_SEQ_STATE_ESTABLISHED case in patch five
>   (Stanislav).
> * Add an `if (sock_type == SOCK_STREAM)` check before assigning
>   TCP_LISTEN to skel->rodata->ss in patch eight ("selftests/bpf: Allow
>   for iteration over multiple states") to more clearly express the
>   intent that the option is only consumed for SOCK_STREAM tests
>   (Stanislav).
> * Move the `i = 0` assignment into the for loop in patch ten
>   ("selftests/bpf: Create established sockets in socket iterator
>   tests") (Stanislav).

LGTM, thank you!

Acked-by: Stanislav Fomichev <sdf@xxxxxxxxxxx>




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux