Skip to content

bpf, sockmap complete fixes for avail bytes

John Fastabend bpf netdev 4 versions – Applied

Status from this message: This series was applied to bpf/bpf.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 1 replyApplied 3/3
  2. v2 posting 2/20 of 3 patches 0 repliesSuperseded
  3. v2 posting 1/23 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches4 repliesSuperseded

Patches in v3 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bpf: tcp_read_skb needs to pop skb regardless of seqnet/ipv4/tcp.c+2 -80 repliesApplied
2/3bpf: sockmap, do not inc copied_seq when PEEK flag setnet/ipv4/tcp_bpf.c+3 -10 repliesApplied
3/3bpf: sockmap, add tests for MSG_F_PEEKtools/testing/selftests/bpf/prog_tests/sockmap_basic.c+52 -00 repliesApplied

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJakub Sitnicki
SeriesR-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH bpf v3 0/3] bpf, sockmap complete fixes for avail bytes

With e5c6de5fa0258 ("bpf, sockmap: Incorrectly handling copied_seq") we started fixing the available bytes accounting by moving copied_seq to where the user actually reads the bytes.

However we missed handling MSG_PEEK correctly and we need to ensure that we don't kfree_skb() a skb off the receive_queue when the copied_seq number is not incremented by user reads for some time.

v2: drop seq var in tcp_read_skb its no longer necessary per Jakub's
suggestion
v3: drop tcp_sock as well its also not used anymore. sorry for the extra
noise there.

John Fastabend (3):
bpf: tcp_read_skb needs to pop skb regardless of seq
bpf: sockmap, do not inc copied_seq when PEEK flag set
bpf: sockmap, add tests for MSG_F_PEEK

 net/ipv4/tcp.c                                | 10 +---
 net/ipv4/tcp_bpf.c                            |  4 +-
 .../selftests/bpf/prog_tests/sockmap_basic.c  | 52 +++++++++++++++++++
 3 files changed, 57 insertions(+), 9 deletions(-)
Signature · 1 line
2.33.0