🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25639

Re: [PATCH net] net/smc: cap ADD LINK v2 rkeys to the receive limit

#25639
From: Mahanta Jambigi
Date: Wed, 02 Dec 2026 06:58
54 lines
15102 bytes

On 02/12/26 7:01 am, Dust Li wrote:
> On 2026-12-01 16:31:55, Andrew Stellman wrote:
>> On Tue, Dec 01, 2026 at 02:45:27PM +0530, Mahanta Jambigi wrote:
>>> Would dropping role == SMC_CLNT be the *better fix*?
>>
>> I tried it. On mainline (fe6ff8d5d675) in arm64 QEMU with KASAN,
>> lockdep and SoftRoCE, I opened 260 SMC-R connections from one client to
>> one server, held them, and then closed them.
>>
>> Without any patch, both runs closed cleanly. With role == SMC_CLNT
>> dropped, the client hung in close() in both runs. The stacks show a
>> link-group termination worker waiting in smc_cdc_wait_pend_tx_wr()
>> while close() waits for the same socket lock in smc_release(). With 64
>> connections, both builds closed cleanly.
>>
>> I haven't found why the CDC completion never comes, and I haven't run a
>> peer that reuses its QPN. Dust, as I said before, the 508 count came
>>from a test-only change inside the writer, not from real connections.
>>
>> Given that, would you rather keep the cap in smc_llc_fill_ext_v2() as
>> sent, or should I keep looking into the hang with the client bound?
> 
> IIUC, that looks like a potential issue that can never be triggered in
> the current Linux code?
> 
> If so, I don't think it's necessary to add the bound here.
Agreed on both counts. The overflow needs more than 507 connections in
one link group, and a conforming peer holds the group at 255: the
sysctl(net.smc.smcr_max_conns_per_lgr) caps the server's group, and the
server moves to a new group, with a new QPN, before the client's limit
is reached. The client group is only bounded indirectly, by following
that QPN.

My client-side suggestion is withdrawn as well - dropping role ==
SMC_CLNT makes close() hang in Andrew's 260-connection run, so it is not
the fix.

What remains is the question that run opened: the client's conns_num and
the server's count can diverge, and if a client group reaches 255 while
the server still reuses it, the region above 255 is reachable even with
a conforming peer. That is a separate investigation, not this patch.

So please drop the bound, Andrew. If the 260-connection hang turns out
to be a real limit or teardown bug, it deserves its own thread, and
enforcing the limit for the client role can be revisited there.

Agreed on your point about invalid CLC messages being the better target;
smc_clc_wait_msg() bounds the copy and the proposal/accept validators
require an exact length from capped counts, so the remaining places to
look at are the truncated path, the SMC-D v2 extension and the client
side reading ACCEPT/CONFIRM.
Technical Details
Message-ID: <1d42a8f1-bab2-47be-9a70-4ae63b9d7f8b@linux.ibm.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!feed-us-ny.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375596-linux-kernel-netdev=dewy.ru
References: <20261128191730.30196-1-bugs@stellman-greene.com> <d4a8844e-9c1c-48c9-969c-f03696ace29a@linux.ibm.com> <20261201213155.65668-1-bugs@stellman-greene.com> <aw903Y4iowWYuz9G@linux.alibaba.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!feed-us-ny.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375596-linux-kernel-netdev=dewy.ru
From: mjambigi@linux.ibm.com (Mahanta Jambigi)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] net/smc: cap ADD LINK v2 rkeys to the receive limit
Date: Wed, 2 Dec 2026 12:28:34 +0530
Organization: Usenet Network
Message-ID: <1d42a8f1-bab2-47be-9a70-4ae63b9d7f8b@linux.ibm.com>
References: <20261128191730.30196-1-bugs@stellman-greene.com>
 <d4a8844e-9c1c-48c9-969c-f03696ace29a@linux.ibm.com>
 <20261201213155.65668-1-bugs@stellman-greene.com>
 <aw903Y4iowWYuz9G@linux.alibaba.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1910026"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:x2/N/c7OZSSuicmdqfm8TZspTNE= sha256:KpnWUXNju9V7kjhuZr2cuzxH32LKHZx9TJJnYXiCbAQ=
	sha1:2T20YG+stYzjSOp6ZGCvOGfptwU= sha256:UgToU9xqR4PzFnxXXoZ2j/h4OBhaAsM+C2aE54V+Xx8=
Content-Language: en-US
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 B39F011757D; Wed,  2 Dec 2026 09:59:12 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.951
X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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=ibm.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 HKWaJyBJO7nI;
	Wed,  2 Dec 2026 09:59:09 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-375596-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=linux.ibm.com
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 457B911755F; Wed,  2 Dec 2026 09:59:00 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id D32EF2324C; Wed,  2 Dec 2026 06:58:54 +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=1796194732;
	b=GcKacTgspMusxq8e6QkfjS99yJ6P+blcJEg7Moq04ZdaDdmwKHC7azG0yhnjKlWcYxYO
	 YZmSWZsJESSaGBsOIsa0SCXwCrlWVIhj1xVBdEAVTPIRBjahS+M0WtB19drxRCzq1n3tK
	 eldQEadlcOZ1BkgjQXwTQY5xY6T2gK8EfH2q6fssMeux4V4OhvPzHZN3atDYXJMNSH5za
	 +R7xSNf0HzJp3aTyk39nEhXSgxmLlfxcNahQ1UfWwDA03LRx2w1CbFA78tjzy0mRIOuQD
	 KxQIBKDPi4p0fvTZcdniwjJAOiIjyQ3Mr4REkDD+x+T3wbLAdT2UIEUUrdNi5CfaqZQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796194732;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:Received:
	 Received:Received:Received:Received:Received:Received:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding:X-TM-AS-GCONF:
	 X-Proofpoint-Reinject:X-Proofpoint-Spam-Info:X-Authority-Analysis:
	 X-Proofpoint-Spam-Details-Enc:X-Proofpoint-GUID:
	 X-Proofpoint-ORIG-GUID:X-Proofpoint-Virus-Version:
	 X-Proofpoint-Spam-Details;
	bh=e2zitr3Mc1NxmjTWfPKUYUMFii1oxJ4dy4yFWtD0JBg=;
	b=AHzDXWdKoRoh0hBeHe+kSKQ2ga1x7oxAxc30dIOSiYn+O+3W4+MkExjDiPo7V0jWQgpP
	 ZMeFOJaHIaZMauWpdAr7xylt6L3tU0pTFRdH8ZlkHVFXqEpvcRrsC5wX1kptUCEC5Nq6S
	 GB2vlxUeizuhFbmn04PgYZHRkIQLKu5O34+IJUn2kkY/x8/Vu1+6B9BjNuqW02KERtv/7
	 sS7ix4MSPFyTb5oi64ic9rWkglMghO3r+7HICf0hNm/d7kyb3kGZm5eYuqGFM717kJroG
	 8iYW0ASvOJ7iMNmx56ZYfJ8IIKHzlygtXTG7NQZMasXbUwFU1EjG3NF80Qpi0vcJIGQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=V317HR7Z;
	dmarc=pass header.from=linux.ibm.com;
	spf=pass smtp.mailfrom=linux.ibm.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 186DF606A32E;
	Wed,  2 Dec 2026 06:58:52 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=V317HR7Z
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=148.163.158.5
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796194731;
	b=GcB8wHTUe/hJau/5HFR/N1NP5Y+Fprhaj/nGIgFEGY9APruBxClb9eBT9BViijF3p/HP
	 xuwVZ+sX7wuZcLZbViNS8SNCRmdDgYsqibWHkex7UkklXkXpwcTDQTKxTXmXboFylAqtM
	 WKa7n3b7LqoYcc82JbGEo5bPsf1/xiVcoS1dT5w+3dTTbICJXVPi98AxE2yh+szGUF5Ev
	 TzV7kCknuWNXN0FAVrzs9LdVed5342EPdPKnKjqhNUpdiPVXnuO9X0iLIwS7D876LH4dX
	 X7q5aFhVZEbwBvWZ7vGNQ4ng755fCjitHEzOfkNkXmTzQCTgFJl1cV11M5Qdo4Rgxwg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796194731;
	h=DMARC-Filter:Received:DKIM-Signature:Received:Received:Received:
	 Received:Received:Received:Received:Message-ID:Date:MIME-Version:
	 User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding:X-TM-AS-GCONF:
	 X-Proofpoint-Reinject:X-Proofpoint-Spam-Info:X-Authority-Analysis:
	 X-Proofpoint-Spam-Details-Enc:X-Proofpoint-GUID:
	 X-Proofpoint-ORIG-GUID:X-Proofpoint-Virus-Version:
	 X-Proofpoint-Spam-Details;
	bh=e2zitr3Mc1NxmjTWfPKUYUMFii1oxJ4dy4yFWtD0JBg=;
	b=yYemtaO7LbGQS0Ji+zGgVS67p4q2MLeagaGHfmEMb/mJZjNhtVjrxYfh3746JYhJ7Vxr
	 /6/WCiTOO1um6b+tDVq1LWnhF6YWTcH9Aoec/ElOXYobhb9jQ7nT3yu3owLtyk6U9Eoy0
	 OPDEEJH2XAE5O+aRTmaelrUyaq4E7q/lkZaxaUNb/YbQ1gyASgyCxHorl9SuWxM+pvO52
	 SS9RYkR3hmh24AYjitolPZT2aY1HJHUyEMgSMNPbOYBWO9l6A4E97QhIeQ6Hv9iMMXUUw
	 PiNqii5jTDQ67xlRjddD526DmlQpmVWnvFfzm0TqbVm5MYCg88Gt3Ird8WJFkUaFufg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.ibm.com;
	spf=pass smtp.mailfrom=linux.ibm.com;
	dkim=pass header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=V317HR7Z;
	arc=none smtp.remote-ip=148.163.158.5
X-Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC76D606A31A;
	Wed,  2 Dec 2026 06:58:50 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BC76D606A31A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com
X-Received: from pps.filterd (m0356516.ppops.net [127.0.0.1])
	by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B234xkM3520156;
	Wed, 2 Dec 2026 06:58:43 GMT
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=pp1; bh=e2zitr
	3Mc1NxmjTWfPKUYUMFii1oxJ4dy4yFWtD0JBg=; b=V317HR7ZoJ8J6KVWFE//PL
	N+GNPB0LIQ+7mffNVq5HBUn8pvzyNEbOwEy99/sBnw/qqbkxaXBI5Gjk2lBJ76G1
	ARAxeyqPhISHOYYbbV/ZmFuRmEPH7ADX0fxoGeYTx2cC07FW/EuN40vW+FlXvdex
	P1VMGQL8bou2k4OAJn8vicJtxggUFVJpG4W1jsas75YRW5M19wc2ZOeLpGKaEGK7
	97+m/h4NLeRM1x6zd3DIriJh2YEs4JPaVwlUNUbrrYF0LP3nPb+aWxkLH/d/IBIo
	7Dbc56jthXx9jq636fTj+fT4ESnEecQF0Ln3/BGM5efRlBKoalRdz3BaCwufFM6g
	==
X-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 4j7mckgp2n-1
	(version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);
	Wed, 02 Dec 2026 06:58:43 +0000 (GMT)
X-Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1])
	by ppma13.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 6B26nI281626953;
	Wed, 2 Dec 2026 06:58:42 GMT
X-Received: from smtprelay04.wdc07v.mail.ibm.com ([172.16.1.71])
	by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4ja0pq2wn8-1
	(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
	Wed, 02 Dec 2026 06:58:42 +0000 (GMT)
X-Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232])
	by smtprelay04.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6B26wfU641419434
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
	Wed, 2 Dec 2026 06:58:41 GMT
X-Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1])
	by IMSVA (Postfix) with ESMTP id BCD8A58059;
	Wed,  2 Dec 2026 06:58:41 +0000 (GMT)
X-Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1])
	by IMSVA (Postfix) with ESMTP id 21A0758043;
	Wed,  2 Dec 2026 06:58:36 +0000 (GMT)
X-Received: from [9.123.8.233] (unknown [9.123.8.233])
	by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP;
	Wed,  2 Dec 2026 06:58:35 +0000 (GMT)
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
X-User-Agent: Mozilla Thunderbird
X-Cc: Tony Lu <tonylu@linux.alibaba.com>, Wen Gu <guwen@linux.alibaba.com>,
        "David S. Miller" <davem@davemloft.net>,
        Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>,
        Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
        Willem de Bruijn <willemb@google.com>, linux-rdma@vger.kernel.org,
        linux-s390@vger.kernel.org, netdev@vger.kernel.org
X-In-Reply-To: <aw903Y4iowWYuz9G@linux.alibaba.com>
X-TM-AS-GCONF: 00
X-Proofpoint-Reinject: loops=2 maxloops=12
X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDAyNiBTYWx0ZWRfXyTZzhddHfsoi
 afjhk2skomdcbU9+tE/uhRNSSxx5uhCSajNh3u+r7cqHZgiHuSRrJPx1WStCFraUcU5a3Ej/rjx
 1q9VOh+O7qwyJtYgmzwNWd6AdXwUYYg=
X-Authority-Analysis: v=2.4 cv=MtfHeGae c=1 sm=1 tr=0 ts=6b0fc1a3 cx=c_pps
 a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17
 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=EYZDA2seh4QiHnbVyOIA:9
 a=QEXdDO2ut3YA:10
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDAyNiBTYWx0ZWRfX98PF37KmORzR
 k6IHCkIfS1K398O55JFxjQEVN8ET0Ir9T/x2sy37ay61hfrQjgsdGIy3mMEksRbad6UkO7WxDWU
 Wa24FdXLXSjo4V6kDPpZ66ArW41xwyG6xT7qBG1zk6N6roDt7URLIY8/XNJ7XkxKhvmv3Lf/KBs
 LXEg8EW6BOFGnDI8WZXIfkFKAdNloNBR05XYhoQVmIYHg2mg28kbo1CrZrooaGRdHu8umXmcPQS
 CmA21wQwukQzPdXM0/FAjIcEcPKYEF5TfDE8/NPQ2oiR6Wm+Lj7J+tgkfzJ57xx5EHL3rjyR01I
 QwpCe2jLn4/SU2vXASgePPZRuap5cbGr5iDa8w4hD08/r1/5Kze8eMlUIwvaEYR6iVxvnIwsu8m
 eRq1SIMhfOn2Wr+YAf5FahfF4KVic1MifkwbYNZP7kEMzzN1j5DZmzbfc9Bx5WAS9FnmLtG5dlJ
 +P82YYmjU1auAc/vYsg==
X-Proofpoint-GUID: nTRIax-56kj2VWQkd21bp7anV2ISLM2t
X-Proofpoint-ORIG-GUID: 1YbubG3So-4PzoKtPlFA9o4aCqmo8ZwR
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49
 definitions=2026-12-02_01,2026-12-01_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 adultscore=0 bulkscore=0 malwarescore=0 spamscore=0 phishscore=0
 clxscore=1015 priorityscore=1501 lowpriorityscore=0 suspectscore=0
 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001
 definitions=main-2612020026