Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp223072imu; Thu, 8 Nov 2018 00:31:14 -0800 (PST) X-Google-Smtp-Source: AJdET5dnewFxajn+4en6CE0M29unqyzw2h9efoHrINTkivbkOPApVtIm0bqYRXrqcgcFuvZ6b7Jc X-Received: by 2002:a62:9316:: with SMTP id b22-v6mr3734121pfe.193.1541665874524; Thu, 08 Nov 2018 00:31:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541665874; cv=none; d=google.com; s=arc-20160816; b=JUtoeMpFz2cdg9iJts+YbdWBVcLwM8TUxA9Dmdt/9WtM/hdv8IDcliMsgkEnGW7GVr YII1VSss34RSC56ACAaMZXPOiSVTKxiAp1v3AtYp0m7PUQ1keElRYkhhO9V6JX9s3a2I N/UsXg75jgyFRbSEEYokji0fT54dxjU15RxBTr2JdD/Mb8ChuebhIoxY8eYwrnQFAhWl hiwhGWDdocH587kY10hKfypHKfPgw04b+KW+O3TvJkvgchZ6pw7u/Qs/jUfd5xhvGh4p dzWVn/hQmyfKDoiwB0xmc1hEQi7/If/6c+xMPSsg/DbLo5zcfh74K55rFEoT0sjzPtrW 6r2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=1u8wqLq2jfc+Hu+gHhiZiEjFU+PVKToHOLPSYozGJos=; b=EBnliC+8mds9eVYsNGvEj08CptgTm5r0Mnu7t+Wcv9d08VXe/NQcz7iS3OMxDxhVDg +gtL26WFXBp+5WEBRlHAVdTAKQeW+YIDLiwKlbIA4/o9nzzazpe1Cem61+ssjoKjo+ST 4CQzh6eucgcozmnk93OHqyEoqAe75D3HUgjI8SR4bF7zla83Bl5DsStxa3uKZWgO8/Ad aex3WkZvtHXjOsdB2nyMFAP6seR0Yhi1sPc3SNBoNGuBwGpMoD4BUHFnjtXs4sfa6nUv +rePGTLzIHNKMO3Jc54LJUhBcpZ/dwgW1Jw6Rw79UY2mrd+X2K8KrIRLqtpTtu+K4ZQp Wsww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cjeJ017R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y126-v6si3738119pfy.22.2018.11.08.00.30.58; Thu, 08 Nov 2018 00:31:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cjeJ017R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726554AbeKHSEx (ORCPT + 99 others); Thu, 8 Nov 2018 13:04:53 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:42836 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726133AbeKHSEx (ORCPT ); Thu, 8 Nov 2018 13:04:53 -0500 Received: by mail-pg1-f195.google.com with SMTP id i4-v6so8546833pgq.9; Thu, 08 Nov 2018 00:30:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=1u8wqLq2jfc+Hu+gHhiZiEjFU+PVKToHOLPSYozGJos=; b=cjeJ017R3DYhM53ncHaSzpSpxHyuzKHX0EjliJ5geAkIXNx5I282DD9zf+MWBeuQ9G pfxFulAT4pwWJReC6YwLoYnHkrMx4UeOdCp5a5/Uvj00H99HZ9+6tdBWLe4h48E/HYKZ udllmlIedy2P/4zDtMgAFu4oKnoTUvHbHVcfwbFxrEtvU11s+4nHChd0Vm3Dcm8n4/j0 bhljTCwuTSX5QkTzpTeptZ1qLHertvglCH8fTMs8yA1bjE0oGOE87kzRwCU5dNRRDiD1 c8J7yhpCUFU1ao3Rf28k0lT7Cls1V/fUAeLUI2Wxle+kTyncmVUu9lhZGxYXRsVLWotd 4iPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1u8wqLq2jfc+Hu+gHhiZiEjFU+PVKToHOLPSYozGJos=; b=uoLBtpVXD57myNkPt/PvnDv4CXIR0BmEDTuMWOL2SnSPP3fgRqI0FBAe/3TC7F7I/C sZ26qg4uawdtwif7z1RObQENYz05Vgd60V4sh6uUiXbYXQfE7ZVavf/1p2tcP/sVelBC oXws/2VDRkSTii0+EsE27lA1c92yCEKFCvaVI1xhq8x6U4LEi/NeUgX0b6QD+SY9r9Rb tzHHUo2UEgb8poTvFdodWOPLqTMNNv+G6K0JC6sl3q54z6MBpnVJVKCKYFdlkIM/wvXp 3bdqiWXTSHUEXkRcmxyzIEFAESmmqNkMfMfArSR6rI7tlD50nqW630TEhoVlyiMy7ivb qRCQ== X-Gm-Message-State: AGRZ1gK5ZIoJTxEukN0ORcrBHKOqqshhimZoHzRm/wRzdOjvmiZ4VG3I blI8FtXvZ6/4lwM3eyQL2Ft7zenJ5xk= X-Received: by 2002:a62:250:: with SMTP id 77-v6mr3773883pfc.16.1541665829307; Thu, 08 Nov 2018 00:30:29 -0800 (PST) Received: from localhost.localdomain ([2405:204:54a3:4742:28e4:be46:8b17:69ab]) by smtp.gmail.com with ESMTPSA id m10-v6sm5370388pfg.180.2018.11.08.00.30.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Nov 2018 00:30:28 -0800 (PST) From: Suraj Singh To: davem@davemloft.net, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, edumazet@google.com, Suraj Singh Subject: [PATCH] staging: net: ipv4: tcp_vegas: fixed checks and warnings Date: Thu, 8 Nov 2018 13:59:52 +0530 Message-Id: <1541665792-5888-1-git-send-email-suraj1998@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixed checks and warnings in TCP Vegas Signed-off-by: Suraj Singh --- net/ipv4/tcp_vegas.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c index ee113ff..0f65cbe 100644 --- a/net/ipv4/tcp_vegas.c +++ b/net/ipv4/tcp_vegas.c @@ -139,8 +139,7 @@ void tcp_vegas_state(struct sock *sk, u8 ca_state) } EXPORT_SYMBOL_GPL(tcp_vegas_state); -/* - * If the connection is idle and we are restarting, +/* If the connection is idle and we are restarting, * then we don't want to do any Vegas calculations * until we get fresh RTT samples. So when we * restart, we reset our Vegas state to a clean @@ -223,7 +222,7 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 acked) * and the window we would like to have. This quantity * is the "Diff" from the Arizona Vegas papers. */ - diff = tp->snd_cwnd * (rtt-vegas->baseRTT) / vegas->baseRTT; + diff = tp->snd_cwnd * (rtt - vegas->baseRTT) / vegas->baseRTT; if (diff > gamma && tcp_in_slow_start(tp)) { /* Going too fast. Time to slow down @@ -237,7 +236,7 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 acked) * truncation robs us of full link * utilization. */ - tp->snd_cwnd = min(tp->snd_cwnd, (u32)target_cwnd+1); + tp->snd_cwnd = min(tp->snd_cwnd, (u32)target_cwnd + 1); tp->snd_ssthresh = tcp_vegas_ssthresh(tp); } else if (tcp_in_slow_start(tp)) { @@ -254,8 +253,7 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 acked) * we slow down. */ tp->snd_cwnd--; - tp->snd_ssthresh - = tcp_vegas_ssthresh(tp); + tp->snd_ssthresh = tcp_vegas_ssthresh(tp); } else if (diff < alpha) { /* We don't have enough extra packets * in the network, so speed up. -- 2.7.4