Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp316406lqh; Mon, 6 May 2024 22:55:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWX/Sp/N5IGazCyge1IBh5Iz0NQb9YhcZMlwv/73NOCb8Bgk2eI1duXAy7iYkcsLzBhjOf43FnxL7sBj151259Wl/l4Pjjgh2gUAwmuoA== X-Google-Smtp-Source: AGHT+IEN1Dpok2sd/2tkhimaRe2gfVtV5mdBA2HFjc3fI3FewtVKFmZvgGn3Fes6EQwEdLul7MMo X-Received: by 2002:a17:902:d48f:b0:1ed:3c6d:7392 with SMTP id d9443c01a7336-1ee62f755damr29282225ad.8.1715061317226; Mon, 06 May 2024 22:55:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715061317; cv=pass; d=google.com; s=arc-20160816; b=Tl7kf7G9qcsxWvHkSkwOWeHBFcI1qS8guXN4sd2VfdLpPTBsICBqJkXRiNkfxNdzBg weaM2G+zqcyGpoOF2yrDgEDhBD5DEqznmYfyhhL++sTh8mT76U9sOPBGR3L4TwXNI3Vy AouI5gd+rpdi0ass3GRlQihnuCgHnEsTO3fhCDI3hk41p8esF8BeFeUvzN/fU1Uyu4fD 529lw9ZmJYFsUk2yBsK+BPL2pqueEMsY6hLTOao92lU9R31B5LAkHE73IiGxcNIlbn0H R2tISupnvXGztco6ynNseGtv3m8oEZ6ZjCKL/CYn8axzVHlNwaThiseUfaV4mPwZiLBQ jfCQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:subject:from:to:content-language :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=ZEG518/BRX8gY2yhcbQUnSzkHiL/oK8UZA07FWoGJIw=; fh=//BBCkh6iPY0eRp29n3UDxNxjfhuukI+ypZT/Dw7uKI=; b=KLPCZB2hfhTm2U49KiCRHNVSjhLAoaxt4DtfL+Zjz6rHHjSS6vkTGkOp46Y80CLRy7 5aJ3tvCOpFDYoI4YfutKNIRS5pyiL3HdM2ERV14aRmgxmFgQlOyjmX14z/i7ynwsJosF /XtXZ/XCgj2nnoHFRqj+ISIvMZpfkKkkB2+ZW7g8ZSVY7KQIUgtD4LRWAMOE+BwZke+M Usd1GueoyPn+3U60IaizawtPmG0NPcbueG8ZtgmSxhmjO+jLYEg6VhFoe9ETCuz7e1TM EPM1zWQytp+3X1c3oNPBFAzN5fULjUMfDaxZWGEASNEJ2SnKHxTde7uCIdO2XEFcOHBU 6pUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=mAitka9r; 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-170714-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170714-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 sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x7-20020a170902a38700b001e49bce9d71si9458366pla.276.2024.05.06.22.55.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 22:55:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170714-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=mAitka9r; 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-170714-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170714-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C99C4282983 for ; Tue, 7 May 2024 05:55:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D9606D1D2; Tue, 7 May 2024 05:55:10 +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="mAitka9r" Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) (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 CFF356BFB8; Tue, 7 May 2024 05:55:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.110 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715061309; cv=none; b=t2VJ+V4Kk5yhv7bjpo5MW8I8q69mRh1y/rNOg/VhBqlWjl2iRvF5twcRrti33GhRhULMZ+u7hQF7PebCGw0T81YQlv3N1WBr2VH3hbK7+r3WwQbbX5p3IOo9d92mLqchibymQXdoSxhqylL71BcQSEOuvmzDPaDHMvbG4ZIvfC8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715061309; c=relaxed/simple; bh=Pdne6XsnBJ3ITSgD5gyoB3HBz7+wRA143svwnH2aqpE=; h=Message-ID:Date:MIME-Version:To:From:Subject:Cc:Content-Type; b=ZQ5YuTpJZ6y7QG4ijb0MrhhDRY9u0JQJfSnBQaNe6vUJ8CC1ONtDiAlW/edqI0llPpLFw9kwxalLOrZxBaRsQhaEXy1genJOs8O01N5R4nVpR5G1xJ0mYfo62lZqt4fVEKa2RepqbXtxdzXfFdCANJn5AWW6GirHSKxHmUNJQYc= 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=mAitka9r; arc=none smtp.client-ip=115.124.30.110 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=1715061298; h=Message-ID:Date:MIME-Version:To:From:Subject:Content-Type; bh=ZEG518/BRX8gY2yhcbQUnSzkHiL/oK8UZA07FWoGJIw=; b=mAitka9r1iDCfLCMusF/TcuTMVSGdl/f5YDEo592s4OBwiwxhupp5WYn/LPQvNXYMxxcIwhgJcWleCtnI/v5CXckR+99CcOM1svZjuodBSoI7bmqgFQ3HKOLi+o79Nri9rP3NMNPhz43So7lOk/e+IwWMooCfkek0NBia7bzghI= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R241e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037067111;MF=guangguan.wang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0W6.3fpX_1715061296; Received: from 30.221.101.18(mailfrom:guangguan.wang@linux.alibaba.com fp:SMTPD_---0W6.3fpX_1715061296) by smtp.aliyun-inc.com; Tue, 07 May 2024 13:54:57 +0800 Message-ID: <6d6e870a-3fbf-4802-9818-32ff46489448@linux.alibaba.com> Date: Tue, 7 May 2024 13:54:55 +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 Content-Language: en-US To: wenjia@linux.ibm.com, jaka@linux.ibm.com, kgraul@linux.ibm.com From: Guangguan Wang Subject: some questions about restrictions in SMC-R v2's implementation Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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