summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2022-04-06 02:35:38 +0300
committerJakub Kicinski <kuba@kernel.org>2022-04-06 22:05:41 +0300
commit40570375356c874b1578e05c1dcc3ff7c1322dbe (patch)
tree54c7a52bfdd4e302f877e93dc94adb09cfa3aac4 /include/trace
parent487dc3ca60e3e420d54bcc613cb49e8e85f34569 (diff)
downloadlinux-40570375356c874b1578e05c1dcc3ff7c1322dbe.tar.xz
tcp: add accessors to read/set tp->snd_cwnd
We had various bugs over the years with code breaking the assumption that tp->snd_cwnd is greater than zero. Lately, syzbot reported the WARN_ON_ONCE(!tp->prior_cwnd) added in commit 8b8a321ff72c ("tcp: fix zero cwnd in tcp_cwnd_reduction") can trigger, and without a repro we would have to spend considerable time finding the bug. Instead of complaining too late, we want to catch where and when tp->snd_cwnd is set to an illegal value. Signed-off-by: Eric Dumazet <edumazet@google.com> Suggested-by: Yuchung Cheng <ycheng@google.com> Cc: Neal Cardwell <ncardwell@google.com> Acked-by: Yuchung Cheng <ycheng@google.com> Link: https://lore.kernel.org/r/20220405233538.947344-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/tcp.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h
index 521059d8dc0a..edcd6369de10 100644
--- a/include/trace/events/tcp.h
+++ b/include/trace/events/tcp.h
@@ -279,7 +279,7 @@ TRACE_EVENT(tcp_probe,
__entry->data_len = skb->len - __tcp_hdrlen(th);
__entry->snd_nxt = tp->snd_nxt;
__entry->snd_una = tp->snd_una;
- __entry->snd_cwnd = tp->snd_cwnd;
+ __entry->snd_cwnd = tcp_snd_cwnd(tp);
__entry->snd_wnd = tp->snd_wnd;
__entry->rcv_wnd = tp->rcv_wnd;
__entry->ssthresh = tcp_current_ssthresh(sk);