From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.54 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796312793; b=T854Ymw9fUcsW67AseLuqCNEDMWwKFfJAfuxdB1YBIY5HbdDf19Gm+lKrHywVShfDs+H onPgv6T4p0FxbK/I889tThREz4dHF05ssCasSPTA+8aDa6w2bO3d0EGsZ7r4wcuwOl96n pyZ7Wjr+fam3iYyQdZnuycqxHOIwqWNdIcaWhp8Ir16U7DpVO+ym0/E4L7ecop4PI+3+h Rqf5xfjGfVvY2ObAES152xJJ7GVFmYXeT8sDrY/a553oJncICGIjVfenIT7JacV6ctLAD X4EP6l0VnYP6U0K3Gxkue7vkiyWt7eEqKoOBbPpAhPnmaAwjUju0Fv+46CDpvwFbv3w== 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=QfWaxMRyP4ONJohalYZA/+os0DBucQefzvSGz8ZoWOknu2LjHJNPd0z1AiuAxNDQJXtb SO3C88XUAJCcaTpKOc6oatZJUXfzsViALIMdm3+U/dMV5Fh3SMNjc8EJkt1I7rsHH2w5T 1GLAuh6YJjRK5g9byBTwZalKJ+iqhdqbrxDBsWNEvbD2n+dbJH2cIy6v5FLyijCMyPrOg aWeCO12CCDg3dN6UGnxI+dfz9LXa3CAHdMlnH4v0X6hcQroVCPjdBrRwuumHjmoDYIXTp T5E9irbhifvO4TOf4hU951bSTn7qFVIaCEnIqOJDQCmaMn/bD3q1aDMzeKhMsKehATQ== 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.54 Received: from mail-dl1-f54.google.com (mail-dl1-f54.google.com [74.125.82.54]) (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 0C957606A32C for ; Thu, 3 Dec 2026 15:46:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0C957606A32C 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-f54.google.com with SMTP id a92af1059eb24-1b589050416so8128946c88.0 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=JUcyj71irx9c8WlMIlye3KzPxUByvj30HIHs8MKXtmoZfZb63H6cITXoa0cx8tuMQi MzBT8Hqxh6HTi3wVQsHURGxL83cJXKM5PVnRsy3Oxnevty8Q7YUQdsctz9zY/b69gPkH m4BOjnb3tbUaeLkjRRP/FHd/b2k1CMGL9bDwJ74Cj8cAfW6bd1XVzRdkyBgaSGXA6/WO 0W2XprIlws+2C3CIsWWDLoEBdPGZHnQItdCXKDGtDMsycF74EFO0nZPg3K/CidDdFBq4 9JGExh9jMprl/JAPxDpe5SfSnLF5w7BODW5hgntT3StewglOEv5r1Jh2/qrRchLdkDP4 ATZw== X-Forwarded-Encrypted: i=1; AL+hErEPluhH7htNSxtTpl00E1L4zJCDHCld6yf7JOukJU95EAJ2E70lC73Fyt/O1hxe5Bix5Oapy64=@vger.kernel.org X-Gm-Message-State: APuU4Z/srpKr8iTM3bVhfMv0qM0+4ged92r5kzqsI+AstSrGrr0t1UTV 6pDt/sGO/0kqNrGwxNGulZUXOYgFLRvFaH2T7W0zQfcVQ4q+MA6QE/fp X-Gm-Gg: AZFdTZfYndfIPzyQfMBi1JJnsWXcdF5hed52WJZz8D3Ca1/v6uK6Vb0WPdCQZKywBKV /Mj4UcLkYwDGs0KNxS7qJaaTBozeyHuwCwYfQVWgiY0Knk4ZuP+HJ34B9CbTGAEi3kA2UYiesbB IYN1cVboRmlGBBDjSDsB1rJC3plUNp1Wb8kh2mxd+xDGYOPM55m6v4TwJ0GA2s17Xc6cVhzZ93O HjIK2gbFkWlg0Yhh+eGsNRNuB9jB0IBar2TXCj3nEdGesykWkhnmyDQzlTdyoWdkOcTwQyTZsjW bZhMTDWwq/PYBC1g2zEgB5YkGe6z+JnQDjoezGIki31hvCLfnMOFRNfDZ7fziZvPF9sEbMy+XO8 pho6bil08mQn3jZ4/efIFv0xdwThIgGjSiG76XUGeC/MmkFw5leLxB0E9w/DYdaFoLqanRs6P4G tajpWHLlWvDO5jm9UrcAW0PyepkPzmWAYtAJwuLzvyp/dZaCI4z/bKdqiyH4wS7IUUxUcpBqt9X 9UGO45w6QXIeHW7k2onRxEChfMTFB4RqI8zRTRGVEJ+UNepZv4CO6CjNb0hl8iz3Lyb6MbgGEW7 LHAuOeiWH/qA2Bm5+49FN/TgwJoDrlKmR4YQJHMZOWdh2R6uQD8Qs6nABXkZPJZ8yPIPRXan1gb 3WcLHHaWnfcD3pM66rg== 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: netdev@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