Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp30913pxb; Tue, 12 Apr 2022 15:58:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/0xaS+Z7LxWmVEoLtc0eVxfSRb6UdQUmth3T0ntbPV5NHr2kdRdoBZ2HX6GT6NGS60a0d X-Received: by 2002:a17:902:8490:b0:156:9846:240 with SMTP id c16-20020a170902849000b0015698460240mr39155094plo.141.1649804295794; Tue, 12 Apr 2022 15:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649804295; cv=none; d=google.com; s=arc-20160816; b=fnLOBb67y0vbQ/X9oPgcDRLTE82cgNDeEHtzqqKXmDZyL91ItiNUgWi13wGT4+RP26 jJequAqbzHGeVMNto9Ulal2z0HGlLzueOY1pK39pWBjBOm12hiyLHfVt9iuWtUlX+Jg0 be5jyT5gW9wAD4QeVR8YEe+NBQo38IgAuDb/wkkne9JzdRMPrfZ4DDoTnbXvNpmyd//x X4wcKM4nRD1z396eVbfz2fBj8fyAyM0e6wGKwpuw3hd+vvY4Qa60emeCxClflpvn46xg 4ughWkkxknJ1pYksaTGV3ZP9f19z/ZVqS4ZR40p5dhUgrotF9Tuo8jyxJkarVl+a5b+I ng4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AAZY344dHS0yMkAhdubNiyDORyNiYScZJCTuikBT9yU=; b=Kqpa39rlkCTgh3Tok/jN02h7roHu2O3j2iDR8Dr6yeVS+w0gG1UvyTC15oph/G3ZVm nCtMMHxnC3OPxHfOq06Ogy0bpYXhl5HKI0dywQSgaob/4LpAtJZ1rDHrs8VQAfF7O74c GF5SAJIUZPGQ1o4JI5I3PD1CMc0w2LYRDW8zP2I4GV5Dj3v2FGisso6qKU/1XOuwNuxM StFU6Ng+vNTQ+/j6ZQVqBWjawxeCUUPp3Rhfct/JC2jRcRZh0KnAMpJo+rBIPdrRlrd8 D4mRgQqFVBAuRb1V73CHD4ByjSK9BSVLoyqMHM6AmafC4XMrwIM/vFEuYj79adfrQgMW DjGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kVo1HKU8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u32-20020a632360000000b00398604b5c6dsi3928486pgm.828.2022.04.12.15.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 15:58:15 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kVo1HKU8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 901FD29CB7; Tue, 12 Apr 2022 14:40:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230185AbiDLHIb (ORCPT + 99 others); Tue, 12 Apr 2022 03:08:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351889AbiDLGyi (ORCPT ); Tue, 12 Apr 2022 02:54:38 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 850292DD48; Mon, 11 Apr 2022 23:44:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 70324CE1C02; Tue, 12 Apr 2022 06:44:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 877FAC385A1; Tue, 12 Apr 2022 06:44:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649745871; bh=5dOiRRTDl29duI7hNmINN8go62zjFTO46ML7cnGC5lk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kVo1HKU8PoWMD650BsrjgkrEKfzTJA1+/ihGRygamPTKOatp/IZzzXAP+fWQ2J2fT 4C84mPhJ0x3VQmcxuVVwnbJfrPDeNV4NcQDue4skSySlAm4O5rPZ52d3/QYaAlNYx3 fTAPO9X4aUBDQJa9khdQLgmcx49sXovTuVCsndE8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dust Li , "David S. Miller" , Sasha Levin Subject: [PATCH 5.15 078/277] net/smc: correct settings of RMB window update limit Date: Tue, 12 Apr 2022 08:28:01 +0200 Message-Id: <20220412062944.306868258@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412062942.022903016@linuxfoundation.org> References: <20220412062942.022903016@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dust Li [ Upstream commit 6bf536eb5c8ca011d1ff57b5c5f7c57ceac06a37 ] rmbe_update_limit is used to limit announcing receive window updating too frequently. RFC7609 request a minimal increase in the window size of 10% of the receive buffer space. But current implementation used: min_t(int, rmbe_size / 10, SOCK_MIN_SNDBUF / 2) and SOCK_MIN_SNDBUF / 2 == 2304 Bytes, which is almost always less then 10% of the receive buffer space. This causes the receiver always sending CDC message to update its consumer cursor when it consumes more then 2K of data. And as a result, we may encounter something like "TCP silly window syndrome" when sending 2.5~8K message. This patch fixes this using max(rmbe_size / 10, SOCK_MIN_SNDBUF / 2). With this patch and SMC autocorking enabled, qperf 2K/4K/8K tcp_bw test shows 45%/75%/40% increase in throughput respectively. Signed-off-by: Dust Li Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/smc/smc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index dee336eef6d2..7401ec67ebcf 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -1822,7 +1822,7 @@ static struct smc_buf_desc *smc_buf_get_slot(int compressed_bufsize, */ static inline int smc_rmb_wnd_update_limit(int rmbe_size) { - return min_t(int, rmbe_size / 10, SOCK_MIN_SNDBUF / 2); + return max_t(int, rmbe_size / 10, SOCK_MIN_SNDBUF / 2); } /* map an rmb buf to a link */ -- 2.35.1