From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796312793; b=X2EROAeaB1A/QeriRonT7Lg9VJhmg13m6u37DhDFqip1CJyvsYTPvlmv19Z7iPHvlBrA Nif00jOitbO+MOfL0J3CRvnRboa6/sfS01LaJz08daN7Vl5d5UV3uu464zdB5DTJCKh9Q NYaIvzhBNFJWXZJlXls/pc9O2Qa7zfoXq0bC8MxECBQX61eZO7Nmuy/D5pQ1+0I9i3p3F UsXr2nct35HZszguJ0FHpljH/oYTCXqqcVlak6qhB+MskWrfFx2dgtZ45XpWl1rt8rA6R 9V3bIDmO/UqGByRRLqkc4ysWSD3haJHtuubqtFSX98TqK/LWQmIHs3Mj/B2VoCnRdhQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796312793; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: Content-Type:MIME-Version:Content-Transfer-Encoding; bh=BElrqa89v1NfxtgXdv7XLH7vgVKADDyCxm8MT8iiS2c=; b=euKv8aK2eYQJjKkLSbliDEPY83LioDkL6/RLEy4ZLKZ3RxBqiZBM85xsENQnDqlXVrY5 ZmODR553Y3gmjfqle8JI7jQIOV+zWyLVN61HfGt0iJQipW5w7gPTEcOcJlqinyoYMkBu6 3bcZzldGrfzS4QnGMK4s+UGceOxntbGyeCp8CPJy3LNqXtrp254uFvO4t4n1H9Lw5du27 zyzfPOjb4KOYIbA3ecOj2peax7q7QVEMbv78N8NXsBi5HDAXZYSs9I6arrT+iea65HRMY r6cp/edDgkX4lRHa+99KKT9UQjlLcWn7XX47XCMz/BZIrW/GjxMK+K8YgBQixUSmBHg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=BvuqyuE4; arc=none smtp.remote-ip=74.125.82.44 Received: from mail-dl1-f44.google.com (mail-dl1-f44.google.com [74.125.82.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 070F2606A322 for ; Thu, 3 Dec 2026 15:46:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 070F2606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=BvuqyuE4 Received: by mail-dl1-f44.google.com with SMTP id a92af1059eb24-1b59dfe466bso8352717c88.1 for ; Thu, 03 Dec 2026 07:46:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796312792; x=1796917592; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:content-type:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=BElrqa89v1NfxtgXdv7XLH7vgVKADDyCxm8MT8iiS2c=; b=BvuqyuE4ULQKBw3kZWhe3yTbHb6aknS6n/PiSr4AYCjXIovT3+wh0VinGAZ3nNJ62o UAfQEpNJkOd5TA+ZOTCt+tZI2V2fJNwUvmCr2B3Wt2c3qvqCHO850uNTPPsgztNx9XDd Y6ESHg6pTL9yc12KpFD04pj1CF46YWJVYGHKZqHFg/zK+PN1XG/bmyXuIZYAh+1r5VSS fDgIGFWMW91y0O5Ncx4tnsv3HQW58mo4jYxy/zIi73WCZueNh1gLbD4Z+x+VFQk+jXYq ZxdQeFGH2rhdgTckWQ2LxGfnNrqqgmmKNjiNxMkFsp5g96C12VjHhrgOO1zY4QZ6c7Fw Bf2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796312792; x=1796917592; h=content-transfer-encoding:mime-version:content-type:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=BElrqa89v1NfxtgXdv7XLH7vgVKADDyCxm8MT8iiS2c=; b=I98yMGZ6H+gnRDGaSlbQ5xm984eDGfHgUiXqjZGKWOYL7mbt9x/PEwz+PgJAy+ZaCx jqRIFU4mpbyOfcmAzVocWSNjn2syKLf60yyleg5qhfMlAZRCZL0ensTN2HFvKTmRono1 jJ/SaLAexf6iv5eoZJoiaakgfl5xMHZav3IpPzKdTSMbZAXp0g+jUbcQKaZ6/O0FxCt+ xg6uqJzXbvhlO/9hTqEBdLB0I56lbPR5OIVemsObYjVOlQTh+BxpwonTlEPapgKoIqtt nDtLNYzNj2GE1OFCrs7Wxo/ntUcPMn2QT/zca2/XOnCAPVkPf3nQVyeVfcm7i7oUAiXX QDuA== X-Forwarded-Encrypted: i=1; AL+hErEOR2a4Jy2/BfakV+mDf74A4B4Ajk4WP/KgACCIttHIkil9j8FMzl7QkMLNqFpB2geLYXOt0lq8tBx1@vger.kernel.org X-Gm-Message-State: APuU4Z94U0zMP4SxgqZRogTprDzt6q0V81wrjPgKsN0yXFXw9DY1egF7 OXvO+3wRl3ElRZggJjJk8orK5HS9TJwB59V3Bw9pDCDUrqfhZgj30nXh X-Gm-Gg: AZFdTZeWAbYGtujqK0SMcplYhZRIj+ztdS7SEbJvNXsaQCAk/U92F1X5A65KeTUm30x hH8xfwkQ02Uvvh5ykqQi8zwDMJ7kh5sCsjcO2waEffMZ+X/WvmJwP8vUZKjiitGijG6xwo4BqCs ndWcl5oM7zn5aUNrXJWDGdnQ1ljrgpqWLPhzUMx8UWUvxfhPDb2cJWI1HsbOIjJLUo2l4YW45aD r/AcyizyhSjaorEhilRYCQtMWkPWBLNPCrBr5US8WsQIcBiEbKgZchJGyOkFsw/FR9hUCaYUEMI UueoIIZZVkEZdfk6h3kTlL6Ln9q5MtYjZBy1AL8Lb8kM6g+NAJ/UEQqugJQXH2gSJdakw9GBCwr 8pGXhZC4gyn6pgKux1zf6JNJW+PG/vgYffFoF6dAztjI/u8S9Djc7gYBMdHV+0GMzGQgin7+lyQ YkMhALy1zdiRsJMTU5QZ/JA29JOw7t1WQQRRTND8JtgGewA+203te9wsG99qo4tZg5mlO2Xtr9S S2uC5kKjd1WJAwaBML6/GpFLbsGDOKHM0kVfU50dHKUOn9suoedHS6KWrPc2pSj17AF4sZrL7NN KCdx2AvqWwsZhKsRCf29rTrDmP3oaymXYkB65TGCx1sH0dWWkSQgC7u4wyQAjCmjjVeYid1FhRi g2/HU62jkxJyqGhmH7A== X-Received: by 2002:a05:701b:4555:20b0:1b5:2988:eba7 with SMTP id a92af1059eb24-1b556947286mr44177913c88.41.1796312791969; Thu, 03 Dec 2026 07:46:31 -0800 (PST) Received: from zorinLS.. ([2804:19c:2591:7000:8394:f950:9202:6c9b]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5566c1142sm100649483c88.2.2026.12.03.07.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 07:46:31 -0800 (PST) From: Ermenson Junior To: mjambigi@linux.ibm.com, alibuda@linux.alibaba.com, dust.li@linux.alibaba.com, sidraya@linux.ibm.com Cc: tonylu@linux.alibaba.com, guwen@linux.alibaba.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org Subject: Re: [PATCH net-next] net/smc: serialize the server establishment phase per peer, not globally Date: Thu, 3 Dec 2026 12:46:23 -0300 Message-ID: <20261203154623.1442206-1-ermenson.sec@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20261202131243.664308-1-ermenson.sec@gmail.com> Content-Type: text/plain; charset=UTF-8 X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi Mahanta, A duplicate link group is harmless for correctness and not free in resources, so I took your preferred route. v2 drops the hash. Correctness: the ACCEPT carries ini->first_contact_local, and the client side of smc_conn_create() then takes its "create new link group as well" path, so both ends stay symmetric and no decline is sent. The SMC_CLC_DECL_SYNCERR case below it is the mirror, server reuses and client wanted new. Several groups per peer is already reachable too, since for SMC_SERV the reuse condition refuses a group at max_conns or with a full rtoken bitmap. And smcr_lgr_match() already compares the link's peer_gid, so a peer varying its GID gets a fresh group with or without my patch. Resources: lgr_cnt is a counter and not a cap, and an idle server side group is held SMC_LGR_FREE_DELAY_SERV, 600 seconds, before smc_lgr_free_work reclaims it. A multi-port peer falling back to v1 pays double for ten minutes of idleness. Small, not nothing, and a behaviour change nobody asked for. The Sashiko bot's finding on this thread is also correct, and v2 removes the function it was about. For the archive: smcr_indicated() is true for SMC_TYPE_R, which is 0, so it is true for the reserved zero typev2 of a v1 proposal, and smc_get_clc_msg_smcd() then returns prop + 1 unchecked because its guard only fires for smcd_indicated(typev1). The key mixed in IP prefix bytes. It is a wrong-field read and not out of bounds, since max_offset is computed inside struct smc_clc_msg_proposal_area. v2 makes a link group that is still establishing findable, so a second connection of the same peer defers to it, and the mutex no longer spans the CONFIRM wait. It still covers smc_lgr_create(), which is needed: until the list_add_tail() there the group is not on smc_lgr_list. Deferrals are bounded by a window of two CLC_WAIT_TIME, which is wider than the longest a link stays in SMC_LNK_ACTIVATING, so the create-anyway fallback is not reachable at today's constants. One second of margin. One thing v2 does not fix, since I claimed otherwise in v1: after the retry joins, smcr_lgr_reg_rmbs() runs under the mutex and starts with smc_llc_flow_initiate(), which sleeps while the first peer's ADD_LINK flow is active. Unchanged by this series. It grew to four patches. Taking the whole of smc_listen_rdma_finish() out from under the mutex lets a joining connection of this peer block on rmbs_lock or llc_conf_mutex with no timeout while holding it, waiting on the first contact's add-link flow. The Sashiko bot raised that loop on v1 as pre-existing and it is unbounded, so patches 1 and 2 bound it and come first. Patch 3 fills the peer gid and mac at creation, which patch 4 needs. Unrelated peer's connect during a silent peer's handshake went 4397.8 ms to 1.5 ms. Your v1 control does not work here and the series notes say why. v2: <20261203153514.1440337-1-ermenson.sec@gmail.com> Thanks for the review. Ermenson