Article View: linux.kernel.netdev
Article #26475Re: [PATCH net-next] net/smc: serialize the server establishment phase per peer, not globally
From: Ermenson Junior
Date: Thu, 03 Dec 2026 15:46
Date: Thu, 03 Dec 2026 15:46
57 lines
14183 bytes
14183 bytes
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
Technical Details
Message-ID:
<20261203154623.1442206-1-ermenson.sec@gmail.com>Path:
mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376727-linux-kernel-netdev=dewy.ruReferences:
<20261202131243.664308-1-ermenson.sec@gmail.com> <d2e182df-d48a-4835-83e7-080d211d634e@linux.ibm.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376727-linux-kernel-netdev=dewy.ru
From: ermenson.sec@gmail.com (Ermenson Junior)
Newsgroups: linux.kernel.netdev
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
Organization: Usenet Network
Message-ID: <20261203154623.1442206-1-ermenson.sec@gmail.com>
References: <20261202131243.664308-1-ermenson.sec@gmail.com> <d2e182df-d48a-4835-83e7-080d211d634e@linux.ibm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2532044"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:HO13hKpEf0EeFvmbMCEkydTRyLA= sha256:A1NTB+dVicAo230G5YDXjZ+b2KguxtIMN7qO7ihLpmA=
sha1:vclM4bsIqy7+476NcClWfR4/hQQ= sha256:R2WtyrcoJLKInq4fSQFFGJZTsN2md8y0n3UOz3N69mM=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id B0C2411795D; Thu, 3 Dec 2026 18:46:51 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.397
X-Spam-Status: No, score=-3.397 tagged_above=-9999 required=6.31
tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
HEADER_FROM_DIFFERENT_DOMAINS=0.001, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id AZaQc_ELxhQG;
Thu, 3 Dec 2026 18:46:49 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376727-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 18FC6117955; Thu, 3 Dec 2026 18:46:39 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id E2F85244F7; Thu, 3 Dec 2026 15:46:36 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1796312794;
b=1EHH8rqaMkkxe/WKaMm4rNOWcmTn6T6hyP2PWqu4e79dafxxbOoG4d+mlsTuKbRjFWZn
cxA9QNzsx1sy+QPWShOqPvq+iGY37FN6yk0UZ8R6dX5jntjjg1NS4uvq14agUikQlYDCh
BqwDvIj8+Y0UBB8mPfmqSEqqcg8/RJCc36Vo8ivpe/rSDByG0+bwJo+mBa7dXStMGJi9e
FBAh3CwOOH8cZojNHe7JBs9pXL1iY1recQrUbJJtTWt+J3JaOWRR3/pZ/og97guuP3M7o
mSaP+bN2irCoW7HwRSyWNl+k6GV1YC17uB7zlxFy70OmcYQASfBAbTx4+J4PQ4d9vVQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796312794;
h=X-Original-To:Received: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:X-Mailing-List:List-Id:
List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
Precedence:MIME-Version:Content-Transfer-Encoding;
bh=BElrqa89v1NfxtgXdv7XLH7vgVKADDyCxm8MT8iiS2c=;
b=W2gbd7aOX9jmxyxY1mNQNSa6hkEfqteMes2tB4xsWUSCWxOkJUGsZErovV6onqS6m0Ee
v5PijoeFUnl7lcndmvpg8Its3zwQXqv63L9/50ZVeF52rd4UCnBmavRvHNSDtOK2eYGHr
yM2ZHnV1x5w1ARZLmsQX2ZSSe9N3p1Gkg7hFS1M6CuYr3QU2KxOVBQaLx5m5uZlkKxQiN
jXw1lcjRt+7whuI8GAybRenQRLBQHhFyaOSJcxFHUS6NAba8bDxH7co8BzIPDBly9sdLg
XUwq/sWpI3JyAJ1izRtqYHffbSOX5Hd/wmlXCo8SrnX+3KNMrda2xKz1sQLbSV/kD9Q==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=BvuqyuE4;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 338F2606A338;
Thu, 3 Dec 2026 15:46:34 +0000 (UTC)
X-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
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.54
X-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==
X-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==
X-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
X-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 <netdev@vger.kernel.org>; Thu, 3 Dec 2026 15:46:32 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0C957606A32C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dl1-f54.google.com with SMTP id a92af1059eb24-1b589050416so8128946c88.0
for <netdev@vger.kernel.org>; Thu, 03 Dec 2026 07:46:32 -0800 (PST)
X-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/b2k1CMGL9bD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6uQD8Qs6nABXkZPJZ8yPIPRXan1gb
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)
X-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)
X-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
X-Mailer: git-send-email 2.43.0
X-In-Reply-To: <d2e182df-d48a-4835-83e7-080d211d634e@linux.ibm.com>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list