iovisor/bcc

Incorrect calculation of recv throughput in tcptop.py

Open

#5 352 ouverte le 4 juil. 2025

Voir sur GitHub
 (11 commentaires) (6 réactions) (0 assignés)C (4 051 forks)batch import
bughelp wanted

Métriques du dépôt

Stars
 (22 409 stars)
Métriques de merge PR
 (Merge moyen 12j 6h) (12 PRs mergées en 30 j)

Description

tcp_cleanup_rbuf is called several times in a loop inside tcp_recvmsg. At the same time, it is passed the accumulated parameter "copied". Thus, the same data is taken into account several times.

int tcp_recvmsg(...) {
     ...
     int copied = 0;
     ...
     do {
         ...
         tcp_cleanup_rbuf(sk, copied);
         ...
         copied += used;
         ...
     } while (len > 0);
     
     tcp_cleanup_rbuf(sk, copied);
     return copied;
     ...
}

Guide contributeur