Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp161011rwb; Fri, 4 Aug 2023 10:35:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEcsdMJpRpzbMpuQzQFm3PHrGzKPaTUtmLef06nT6Udk0aOUtxdNYYxgTFrWG4Db9c7SbN0 X-Received: by 2002:a05:6a20:8e09:b0:132:cb65:b47c with SMTP id y9-20020a056a208e0900b00132cb65b47cmr2988106pzj.43.1691170515600; Fri, 04 Aug 2023 10:35:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691170515; cv=none; d=google.com; s=arc-20160816; b=dD/GGl0ae4pCIQHxjBxCmba/MtQjFv7POdGmGdYsp4OR10M+j06oF0Mbvi+TSGFTiz JpqYh1huVBE/RSd05S/QjXhztdmeV8lE13ERH1j/IGqv+rI7hSspZhKvgMvsBAlOpRvi 95XDH33RZ4Ft+kaIoxiVbR+DKUJTM0x0xPCVIs7LqiO/ImPCf0o8GEjZX0KfYWzyNv1F 6L5/QTZuvdxoLy4m/ytPsThSN00y6mcLWuLReok/CMZS/+H2WlJBqgBIgvm6alTpMwYl PBoKOm5Vwu80DdpG8znVcPLp5bjKi0GSnX08BE43jwYle1+QhS9jaR2PqF7d3kz0O3Ot 2J+w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=xqfMw6XKPKcjh4M4gVckVU1kKfLsqZcU56TDYjL3Pj8=; fh=MiOLYvgEyBy10I/4Y0PTMEkpvqxuzVBS6+dTfeOblB4=; b=R6aKNSjmHR9JEUKWFsVmDarZTgksMduS4IO1xD+YJu2yChbVQqhipLYQYksY3QDBGM OdyQfWrI2uZcDRI+s53iisKj99rURSnOeDGEs/YlDUZBZRldCx3j1YgiwM3Dh6WDgj9i FF1vhxZkB5wkk2gl6+b1AIPYYT+B/PGy2/Az1pDb+CxTQ2cjmGGUv8ibblBy+HaO0hmV UiOsyr9lvmNt6lH8LReXnP3lF8h13xzPxkIywTPA7vJVhjcFT4n+8jSAY4dN3/b1ancr Gvftc2+hfS6YlyF/SDay9J7aidYUQtx6hElK+J9MBnrHWDZUxtG1GMfOJC8QfW/M2pbZ 04Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=PTxWJJlU; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id be5-20020a056a001f0500b006875eb8b080si1977711pfb.244.2023.08.04.10.35.00; Fri, 04 Aug 2023 10:35:15 -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=@ibm.com header.s=pp1 header.b=PTxWJJlU; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230273AbjHDQbL (ORCPT + 99 others); Fri, 4 Aug 2023 12:31:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbjHDQbJ (ORCPT ); Fri, 4 Aug 2023 12:31:09 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 128B449D8; Fri, 4 Aug 2023 09:31:00 -0700 (PDT) Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 374GMFvb005061; Fri, 4 Aug 2023 16:30:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=pp1; bh=xqfMw6XKPKcjh4M4gVckVU1kKfLsqZcU56TDYjL3Pj8=; b=PTxWJJlUjcC9hR6LGdi42h+XZWkxRmhuttWoxHDUiyg4sPDnN2nSHzE/AU7KXsHERCsl lm2HmoJIwrF/SWzhEV6Xjkn9wSuYbDJ9GbviXoaUGZy0gqocuGEbuHU1EExF5YT6PKL0 Br9NY+0Ob/x4Wj5OCTKmD4DTKICOPaboNcV396U/+JVe/IhL1dkXXSK4qqFPd20dUhjg uuiq90qZoFlxirM0ZUUxj6Hhabwujg6ibsV4TNe/aYGHS0KtCdYJ+FK6x5QsGgz5KP9N aWS7T5wdW0e8MVC4hk0J564ef/unbI0pYz0YQfKc8ArBePT6yJOzoB0v8fqLeMLrBS78 ow== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3s94sv867u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Aug 2023 16:30:57 +0000 Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 374GP9gT014089; Fri, 4 Aug 2023 16:30:55 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3s94sv8663-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Aug 2023 16:30:54 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 374Frf5N021566; Fri, 4 Aug 2023 16:30:53 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3s8kmcf9m6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Aug 2023 16:30:53 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 374GUoiC45351432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 4 Aug 2023 16:30:50 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A39662004D; Fri, 4 Aug 2023 16:30:50 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2309220040; Fri, 4 Aug 2023 16:30:50 +0000 (GMT) Received: from dilbert5.boeblingen.de.ibm.com (unknown [9.155.208.153]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 4 Aug 2023 16:30:50 +0000 (GMT) From: Gerd Bayer To: Wenjia Zhang , Jan Karcher , Tony Lu , Paolo Abeni Cc: Karsten Graul , "D . Wythe" , Wen Gu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v3 0/2] net/smc: Fix effective buffer size Date: Fri, 4 Aug 2023 18:30:47 +0200 Message-ID: <20230804163049.937185-1-gbayer@linux.ibm.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: TeCdVX07HARYS5U6MJLWqrv1iwHkmWZ4 X-Proofpoint-ORIG-GUID: rJ-ecXgR349-ET3neUH6Ehrya8yGAFdB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-04_15,2023-08-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 mlxscore=0 suspectscore=0 spamscore=0 bulkscore=0 malwarescore=0 adultscore=0 priorityscore=1501 mlxlogscore=693 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308040144 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS 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 Hi all, commit 0227f058aa29 ("net/smc: Unbind r/w buffer size from clcsock and make them tunable") started to derive the effective buffer size for SMC connections inconsistently in case a TCP fallback was used and memory consumption of SMC with the default settings was doubled when a connection negotiated SMC. That was not what we want. This series consolidates the resulting effective buffer size that is used with SMC sockets, which is based on Jan Karcher's effort (see [1]). For all TCP exchanges (in particular in case of a fall back when no SMC connection was possible) the values from net.ipv4.tcp_[rw]mem are used. If SMC succeeds in establishing a SMC connection, the newly introduced values from net.smc.[rw]mem are used. net.smc.[rw]mem is initialized to 64kB, respectively. Internal test have show this to be a good compromise between throughput/latency and memory consumption. Also net.smc.[rw]mem is now decoupled completely from any tuning through net.ipv4.tcp_[rw]mem. If a user chose to tune a socket's receive or send buffer size with setsockopt, this tuning is now consistently applied to either fall-back TCP or proper SMC connections over the socket. Thanks, Gerd v2 - v3: - Rebase to and resolve conflict of second patch with latest net/master. v1 - v2: - In second patch, use sock_net() helper as suggested by Tony and demanded by kernel test robot. Gerd Bayer (2): net/smc: Fix setsockopt and sysctl to specify same buffer size again net/smc: Use correct buffer sizes when switching between TCP and SMC net/smc/af_smc.c | 77 ++++++++++++++++++++++++++++++-------------- net/smc/smc.h | 2 +- net/smc/smc_clc.c | 4 +-- net/smc/smc_core.c | 25 +++++++------- net/smc/smc_sysctl.c | 10 ++++-- 5 files changed, 76 insertions(+), 42 deletions(-) base-commit: 1733d0be68ab1b89358a3b0471ef425fd61de7c5 -- 2.41.0