Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1481242lqo; Sun, 12 May 2024 04:43:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU7yinhLquQg7PrQIAfCktiajPL1PmVE2W8ypdFSuS9fZXKXNrR1/wbOG+rYU1sVWZ3r46Z9JL/IJ+T59IIyZi5xCprDxGv+Ep0AiEyWQ== X-Google-Smtp-Source: AGHT+IHEUTAmvFrfvujQK6o/SOfpbl91WxTS2GoLV4rb11e+ZTe9JZ0A98rBRdEUCZEvXw4GjQsq X-Received: by 2002:a17:906:310e:b0:a59:d4f0:cfc3 with SMTP id a640c23a62f3a-a5a2d673076mr497723966b.59.1715514216711; Sun, 12 May 2024 04:43:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715514216; cv=pass; d=google.com; s=arc-20160816; b=gIQkgwoNUO3/fjUZ0n3/REGzLmdAePbm+j9tm8ZYxdsuz2MKkRKhh0GdL30Qh+5TMZ FtawY+0yNtq2SI+PCiXjKV8J7n2+T9zUPSliAfzmj4dMEgYwHIKe/GpN1JLcliOl1anM YzsIHb4IMN/Zrm86ukGrnpzTHE47UL2xomL4ahRu3R3O54Ri2geGuBS+aQAwA6ThbHIF TXcRSVdw38cAAGa8Orbd6lK3LewxABTmPfPp0zebx5KU3iX67+MAZPQjxePXdrUUycd+ Y9Rv+OBKABJARj20t08Vcu1YZhawQjp6XOGieflA/QXRykwDPB+DQCsQ1LkpxRZl8aGB cUgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=zP98sGRL72gU8rZzmqd2nC7wYAJhh+7edu3Bc8oq2fM=; fh=07LpGNRBwoMGpO8j48lddCzJZzHgcQy3PtNaTlLbyFI=; b=zq6S+BpME0M0hUFuBXHLT52MqVWV9qrxna3bDjPDpJD+aL2cAgRqDjUPUIhaHEM4+s sNmqtBe9CBm6/sd0M5enJM1+IugjSPfpCn20GlWMpclQK5J9qxkiETSObW7aB8QkFTma od2F6g367e7HfF82Yxy9oi0JH7D7TRkBDLosRDq+MonjSKEcObq2pRZ8KUbmSAOAtCaO Px/SWUqnsnLas61dvN8FpPAIoT17iOfVZIfsA/8vXelfgFd0Xc0/mmdrB2S6gy+ZDocp nar89KYljxUPBdRMXyqM0dLp+R7tGtSMYssWxSRj5ofFbVfTWnGtsbl7qBabO+9sBa7F qqMQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=jNnTAm1p; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-176860-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176860-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a179461ecsi380604566b.49.2024.05.12.04.43.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 04:43:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176860-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=jNnTAm1p; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-176860-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176860-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3ED481F2129A for ; Sun, 12 May 2024 11:43:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7ABF920B0F; Sun, 12 May 2024 11:43:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="jNnTAm1p" Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E85C51B299; Sun, 12 May 2024 11:43:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.99 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715514204; cv=none; b=BA27kReBWmNEOlUbCRZ+L+YM8nHIE7+08QuE49GnB46FyvkyeEH7D7qZKkfkwR8Ob/Cxq2q0+FfMn7su2sJTM92sLBqLJQYy/3z2YZWsBzHUDs4e5pUpzaf9zsEgT2dBkkkKOZjKPHTDuH1qWBqu3Tkf3do1PcMwePEd4xaBqB8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715514204; c=relaxed/simple; bh=qLj4gJFZ/7RuARyGAnZp84xT1mPl/8zeXxVZwa+jfd0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=RJ1S9suzAPUGC7roTaw8uDiWx48FMsCaafrGK65LlGMzaezagZ2lv9lpKA7Wm9mK5ef27/4XjWLMb4Yr26nEHloVdI1ZWIIzLH/4jrldmEhO+J+KmRZd0P8fue9YspR0YWNxH4XUIMbcGJKppesa2JFLmGEGhfYlse7lRmSh9bs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=jNnTAm1p; arc=none smtp.client-ip=115.124.30.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1715514191; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=zP98sGRL72gU8rZzmqd2nC7wYAJhh+7edu3Bc8oq2fM=; b=jNnTAm1psYsmKrvWnYgLkmyZHjZ9i3MAlqgxmqFejqnz5lrEPhX8y1KTD1ZBY8OxEOTX0hXiXFFvZ40zE7eKEUdU4/aZZEh65aJpUFND/Yq/frz813xx1PB2/G5VQlKFuBPuljjrv59PHdpYoOanMPnJOhBMKBfFRe2DLFahokI= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037067113;MF=guangguan.wang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0W6FbEpK_1715514189; Received: from 30.236.12.8(mailfrom:guangguan.wang@linux.alibaba.com fp:SMTPD_---0W6FbEpK_1715514189) by smtp.aliyun-inc.com; Sun, 12 May 2024 19:43:10 +0800 Message-ID: <8ba154e0-30cb-4bc4-9aa2-d4a02cb27545@linux.alibaba.com> Date: Sun, 12 May 2024 19:43:09 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: some questions about restrictions in SMC-R v2's implementation To: Wenjia Zhang , jaka@linux.ibm.com, kgraul@linux.ibm.com Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <6d6e870a-3fbf-4802-9818-32ff46489448@linux.alibaba.com> Content-Language: en-US From: Guangguan Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 2024/5/10 17:40, Wenjia Zhang wrote: > > > On 07.05.24 07:54, Guangguan Wang wrote: >> Hi, Wenjia and Jan, >> >> When testing SMC-R v2, I found some scenarios where SMC-R v2 should be worked, but due to some restrictions in SMC-R v2's implementation, >> fallback happened. I want to know why these restrictions exist and what would happen if these restrictions were removed. >> >> The first is in the function smc_ib_determine_gid_rcu, where restricts the subnet matching between smcrv2->saddr and the RDMA related netdev. >> codes here: >> static int smc_ib_determine_gid_rcu(...) >> { >>      ... >>          in_dev_for_each_ifa_rcu(ifa, in_dev) { >>              if (!inet_ifa_match(smcrv2->saddr, ifa)) >>                  continue; >>              subnet_match = true; >>              break; >>          } >>          if (!subnet_match) >>              goto out; >>      ... >> out: >>      return -ENODEV; >> } >> In my testing environment, either server or client, exists two netdevs, eth0 in netnamespace1 and eth0 in netnamespace2. For the sake of clarity >> in the following text, we will refer to eth0 in netnamespace1 as eth1, and eth0 in netnamespace2 as eth2. The eth1's ip is 192.168.0.3/32 and the >> eth2's ip is 192.168.0.4/24. The netmask of eth1 must be 32 due to some reasons. The eth1 is a RDMA related netdev, which means the adaptor of eth1 >> has RDMA function. The eth2 has been associated to the eth1's RDMA device using smc_pnet. When testing connection in netnamespace2(using eth2 for >> SMC-R connection), we got fallback connection, rsn is 0x03010000, due to the above subnet matching restriction. But in this scenario, I think >> SMC-R should work. >> In my another testing environment, either server or client, exists two netdevs, eth0 in netnamespace1 and eth1 in netnamespace1. The eth0's ip is >> 192.168.0.3/24 and the eth1's ip is 192.168.1.4/24. The eth0 is a RDMA related netdev, which means the adaptor of eth0 has RDMA function. The eth1 has >> been associated to the eth0's RDMA device using smc_pnet. When testing SMC-R connection through eth1, we got fallback connection, rsn is 0x03010000, >> due to the above subnet matching restriction. In my environment, eth0 and eth1 have the same network connectivity even though they have different >> subnet. I think SMC-R should work in this scenario. >> >> The other is in the function smc_connect_rdma_v2_prepare, where restricts the symmetric configuration of routing between client and server. codes here: >> static int smc_connect_rdma_v2_prepare(...) >> { >>      ... >>      if (fce->v2_direct) { >>          memcpy(ini->smcrv2.nexthop_mac, &aclc->r0.lcl.mac, ETH_ALEN); >>          ini->smcrv2.uses_gateway = false; >>      } else { >>          if (smc_ib_find_route(net, smc->clcsock->sk->sk_rcv_saddr, >>                smc_ib_gid_to_ipv4(aclc->r0.lcl.gid), >>                ini->smcrv2.nexthop_mac, >>                &ini->smcrv2.uses_gateway)) >>              return SMC_CLC_DECL_NOROUTE; >>          if (!ini->smcrv2.uses_gateway) { >>              /* mismatch: peer claims indirect, but its direct */ >>              return SMC_CLC_DECL_NOINDIRECT; >>          } >>      } >>      ... >> } >> In my testing environment, server's ip is 192.168.0.3/24, client's ip 192.168.0.4/24, regarding how many netdev in server or client. Server has special >> route setting due to some other reasons, which results in indirect route from 192.168.0.3/24 to 192.168.0.4/24. Thus, when CLC handshake, client will >> get fce->v2_direct==false, but client has no special routing setting and will find direct route from 192.168.0.4/24 to 192.168.0.3/24. Due to the above >> symmetric configuration of routing restriction, we got fallback connection, rsn is 0x030f0000. But I think SMC-R should work in this scenario. >> And more, why check the symmetric configuration of routing only when server is indirect route? >> >> Waiting for your reply. >> >> Thanks, >> Guangguan Wang >> > Hi Guangguan, > > Thank you for the questions. We also asked ourselves the same questions a while ago, and also did some research on it. Unfortunately, it was not yet done and I had to delay it because of my vacation last month. Now it's time to pick it up again ;) I'll come back to you as soon as I can give a very certain answer. > > Thanks, > Wenjia Hi, Wen Jia, So glad to hear that these questions have also caught your attention, and I'm really looking forward to your answers. Thanks, Guangguan Wang