Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3589668pxb; Tue, 19 Apr 2022 06:08:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrdKIEt9nOZqHz/HtSGEAZrkFYmmQd1qAPo82iFV7r9bY1eQxpQ7i6WA18+cf8c/D4zqOj X-Received: by 2002:a17:906:2646:b0:6d5:d889:c92b with SMTP id i6-20020a170906264600b006d5d889c92bmr13612155ejc.696.1650373714546; Tue, 19 Apr 2022 06:08:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650373714; cv=none; d=google.com; s=arc-20160816; b=yGeBF/q6C1U1s1cjDtBm55gtLN18vpUOyAcOasAG7xN352ZoAxUQHw6PCDbj+6jezC anTGUj2AKiyXu850LB+ox4PeVzn1zciX0rtqyUZCuB/EF1GPAbZ1+WZWj/we0rZCIdcd cL51K1iGwjjCxPrVyIA9i9sDVUVl85GeYMNESS1mdvRPz6oNkelKAg50k4pyQHaf98jV xsDysNfbISatIcZNnRFfcur/4U4vUcuN5HImhEDVLGf/7RZUlOt9qQLvwSWVXLepk55L OZ1524s8xRXC77QE990u5+pKAs79+Pxp0EqL2+21LoYzpwtbZYPsw/jI4ikfDayGn/5n Ic7g== 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=nMPvhSU3q5r4pBpjqXqU8SqlrCk7b+lkqp3m7o9+N+A=; b=FrfwscOL52mcFgwPfeBxEJEJdzN3WcptaWPAVLFpnMcqvmAsVDKru3ymLze2k67jCl I+WJxgFjyMElav+rl2O+/8a7MRGs6lyuX+mRH8EX2jtVqwstTqwJmwYTsP/cESN1b4pm yBCxwa1Nitna10r5K3lUs3W2WvGYlMcvk2MeyUW30rq8vTyT/6nMGvZtZmakljhQiJXa jwPfRwzArqxa0xHjOwwaQH8mKP/9C0GPppWOrd4eR3IqQIoUWrMUFdduCJ6BXGNMseF9 ksRH5BnS9yCmm1LsB5a03dtGwAT3ZRWxQpRJYbnrxWPPGmt1GFUaHLXWrpCjA2vLmuJY zehg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ILysvVZi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d13-20020aa7ce0d000000b0041d2fcc31a6si8309474edv.127.2022.04.19.06.08.08; Tue, 19 Apr 2022 06:08:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ILysvVZi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245551AbiDRODc (ORCPT + 99 others); Mon, 18 Apr 2022 10:03:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244789AbiDRNpk (ORCPT ); Mon, 18 Apr 2022 09:45:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5C3D20BD9; Mon, 18 Apr 2022 06:00:32 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4DFF360B3A; Mon, 18 Apr 2022 13:00:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5844FC385A7; Mon, 18 Apr 2022 13:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286831; bh=OPsG4lIfyPp+EMmOUqJDMmMNX5jHtTLsI/zUMojdeho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ILysvVZiKgKinLdG+S/K/gAw8Sz484cZeYKVl+aI/EidKus/hvOYfOdnn0kvKbC8h PqU1hue7ooH4nr2cCJn1yGj/Jt7g7u8sELEkh+y0JoRPHWdysneDY0EzMgHga+SBFq RQgEc0F8TFBQzh54ijyWTPnV+Y7cpGVK6KKPZmmc= 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 4.14 219/284] net/smc: correct settings of RMB window update limit Date: Mon, 18 Apr 2022 14:13:20 +0200 Message-Id: <20220418121217.940558387@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@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=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 7dc907a45c68..a28e06c70e52 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -499,7 +499,7 @@ struct smc_buf_desc *smc_buf_get_slot(struct smc_link_group *lgr, */ 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); } static struct smc_buf_desc *smc_new_buf_create(struct smc_link_group *lgr, -- 2.35.1