From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756560AbdE0MIE (ORCPT ); Sat, 27 May 2017 08:08:04 -0400 Received: from mail-io0-f174.google.com ([209.85.223.174]:35945 "EHLO mail-io0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756513AbdE0MID (ORCPT ); Sat, 27 May 2017 08:08:03 -0400 MIME-Version: 1.0 From: =?UTF-8?Q?Lars_Erik_Storbuk=C3=A5s?= Date: Sat, 27 May 2017 14:08:01 +0200 Message-ID: Subject: TCP get SND_CWND change on loss event To: LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v4RC8OX7022072 I want to store the value of snd_cwnd when a congestion event occurs (value before snd_cwnd is reduced), and the new value of snd_cwnd (the value it has been reduced to). In other words: the congestion window before and after a congestion event occurs. I'm uncertain where (and how) it would be logical to implement this. I have found two possible locations in the tcp_input.c where (I think) it could be implemented: static void tcp_cong_control(...) { ... if (tcp_in_cwnd_reduction(sk)) { struct tcp_sock *tp = tcp_sk(sk); prior_congestion_window = tp->snd_cwnd; /* Reduce cwnd if state mandates */ tcp_cwnd_reduction(sk, acked_sacked, flag); reduced_congestion_window = tp->snd_cwnd; } ... } or static void tcp_fastretrans_alert(...) { ... default: ... struct tcp_sock *tp = tcp_sk(sk); prior_congestion_window = tp->snd_cwnd; /* Otherwise enter Recovery state */ tcp_enter_recovery(sk, (flag & FLAG_ECE)); fast_rexmit = 1; reduced_congestion_window = tp->snd_cwnd; ... } Does anyone have advice on where (and how) to implement this? Does any of the proposed solutions above seem logical? / Lars Erik Storbukås