Skip to content

Commit

Permalink
net: tcp: Remove redundant debug logs
Browse files Browse the repository at this point in the history
Debug logs in helper functions like tcp_unsent_len() or
tcp_window_full() are not very helpful and generate a heavy, unnecessary
log output. Therefore, tcp_unsent_len() will no longer generate log, and
tcp_window_full() will print out a log only when the window is actually
full, which could be an useful information.

Also, reduce the log load during TX, as currently redundant logs were
printed in tcp_out_ext(), tcp_send_process_no_lock() and finally in
tcp_send().

Signed-off-by: Robert Lubos <[email protected]>
  • Loading branch information
rlubos authored and aescolar committed Mar 15, 2024
1 parent ae4e71f commit cb0a123
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions subsys/net/ip/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,6 @@ static const char *tcp_th(struct net_pkt *pkt)

static void tcp_send(struct net_pkt *pkt)
{
NET_DBG("%s", tcp_th(pkt));

tcp_pkt_ref(pkt);

if (tcp_send_cb) {
Expand Down Expand Up @@ -1463,6 +1461,8 @@ void net_tcp_reply_rst(struct net_pkt *pkt)
goto err;
}

NET_DBG("%s", tcp_th(rst));

tcp_send(rst);

return;
Expand Down Expand Up @@ -1520,8 +1520,6 @@ static int tcp_out_ext(struct tcp *conn, uint8_t flags, struct net_pkt *data,
goto out;
}

NET_DBG("%s", tcp_th(pkt));

if (tcp_send_cb) {
ret = tcp_send_cb(pkt);
goto out;
Expand Down Expand Up @@ -1631,7 +1629,9 @@ static bool tcp_window_full(struct tcp *conn)
window_full = window_full || (conn->send_data_total >= conn->ca.cwnd);
#endif

NET_DBG("conn: %p window_full=%hu", conn, window_full);
if (window_full) {
NET_DBG("conn: %p TX window_full", conn);
}

return window_full;
}
Expand Down Expand Up @@ -1662,8 +1662,6 @@ static int tcp_unsent_len(struct tcp *conn)
#endif
}
out:
NET_DBG("unsent_len=%d", unsent_len);

return unsent_len;
}

Expand Down

0 comments on commit cb0a123

Please sign in to comment.