Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3018588rdg; Tue, 17 Oct 2023 01:52:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFuI8kRzGW/GG7/dBs/s5PHYu1tnwFxVgIEqis0xypJPXDfuiYfBgnjETaqa0TVfYe1NBCz X-Received: by 2002:a17:90a:4b:b0:27d:3ed2:86a5 with SMTP id 11-20020a17090a004b00b0027d3ed286a5mr1452850pjb.33.1697532767460; Tue, 17 Oct 2023 01:52:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697532767; cv=none; d=google.com; s=arc-20160816; b=UIJylrNEeaWKlWUdZRvdYB+zwC83wNO2XxA2j9/DIOTJLMlr3KbpHzrPVHBn/SU8bH 4aVLjcKnak0+ufp5hP5l2zRfxrFit9NbGueU5H8nIAQ3gty6A66h0nY150zYCS04ZXyO mZrzX6qEj4C6DeG/vhWj/KFXnzKEzSLquq/U+0zlCzUFiN0Nv8FPer8LMOsWvZbOYvs3 dJG68JhaA0By9r+/A0wOTqsJIuDh6h2XbLUWQB8o4FqPLRwT5/bxciHTTFHsxVJFm6VR 8ajoSWLXsPI5hI7hgAUt/VeBRJ1F8Z3Cu2d+pvrTNQCFCNVG7FMYgV95bxcw414z3qxO F18w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=BnMlDur1pvUkyWcZJyzD77QuirPaUFm+KAoVqsHTjew=; fh=px+UIZWL4hL0LvVNTB4n9iH0WgTJxx++tviKyX6FVwM=; b=d68qgP3TtTQcnkinN5YBz4aC5aqLUexIVXjmfW5qg18pBryF8KvWqKq1UTDZxf2mDw dgAwcbBd7uNotJ9O8H8T03C2+ERIKWlwtBr+8uMYf3QR0AI3VAozQ/X+BLQE184sUSi4 ObAZ6NNzpT2ybFj2DYgLFuN8W0mMCEyl97i36cK77QHdMqFEYOfBmG4kOaLNqzOKyo53 HJ88zoe5dt6iBBLi6V/YxTiqUksHFS9iov+Tob1MCe3SiFeOa8G1pbW18ttLEe5dES56 oZX/YZEATscBWYDfgDWVP2ySwSRS7Q2a/k0d3EynwBeDhO3QUHyRwYoA9ckx/M9WmGTU yCzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id nm12-20020a17090b19cc00b00274e5b20e65si1227597pjb.50.2023.10.17.01.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 01:52:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id DC49A803E59C; Tue, 17 Oct 2023 01:52:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234779AbjJQIwZ (ORCPT + 99 others); Tue, 17 Oct 2023 04:52:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234620AbjJQIwS (ORCPT ); Tue, 17 Oct 2023 04:52:18 -0400 Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A425493; Tue, 17 Oct 2023 01:52:15 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=guangguan.wang@linux.alibaba.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---0VuMgVhC_1697532731; Received: from 30.221.102.81(mailfrom:guangguan.wang@linux.alibaba.com fp:SMTPD_---0VuMgVhC_1697532731) by smtp.aliyun-inc.com; Tue, 17 Oct 2023 16:52:13 +0800 Message-ID: Date: Tue, 17 Oct 2023 16:52:10 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net] net/smc: correct the reason code in smc_listen_find_device when fallback Content-Language: en-US To: dust.li@linux.alibaba.com, kgraul@linux.ibm.com, wenjia@linux.ibm.com, jaka@linux.ibm.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: tonylu@linux.alibaba.com, alibuda@linux.alibaba.com, guwen@linux.alibaba.com, linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231016061153.40057-1-guangguan.wang@linux.alibaba.com> <20231017073733.GV92403@linux.alibaba.com> From: Guangguan Wang In-Reply-To: <20231017073733.GV92403@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 17 Oct 2023 01:52:45 -0700 (PDT) On 2023/10/17 15:37, Dust Li wrote: > On Mon, Oct 16, 2023 at 02:11:53PM +0800, Guangguan Wang wrote: > > Hi guangguan, > > This patch doesn't apply clearly on net because it conflict with my > previous patch 4abbd2e3c1db(net/smc: return the right falback reason > when prefix checks fail), pls rebase. > This patch sent before the patch 4abbd2e3c1db applied. I will rebase it in the next version. >> The function smc_find_ism_store_rc is not only used for ism, so it is >> reasonable to change the function name to smc_find_device_store_rc. >> >> The ini->rc is used to store the last error happened when finding usable >> ism or rdma device in smc_listen_find_device, and is set by calling smc_ >> find_device_store_rc. Once the ini->rc is assigned to an none-zero value, >> the value can not be overwritten anymore. So the ini-rc should be set to >> the error reason only when an error actually occurs. >> >> When finding ISM/RDMA devices, device not found is not a real error, as >> not all machine have ISM/RDMA devices. Failures after device found, when >> initializing device or when initializing connection, is real errors, and >> should be store in ini->rc. >> >> SMC_CLC_DECL_DIFFPREFIX also is not a real error, as for SMC-RV2, it is >> not require same prefix. > > I think it's better to seperate this patch into 2: > - one for changing the name from smc_find_ism_store_rc to smc_find_device_store_rc. > - one for fixing the return reason. > > More comments below. > OK, I will seperate it. >> >> Signed-off-by: Guangguan Wang >> @@ -2213,11 +2211,12 @@ static void smc_find_ism_v1_device_serv(struct smc_sock *new_smc, >> goto not_found; >> ini->ism_selected = 0; >> rc = smc_listen_ism_init(new_smc, ini); >> - if (!rc) >> + if (!rc) { >> + smc_find_device_store_rc(rc, ini); > > This smc_find_device_store_rc() seems useless when rc == 0 here ? Oh, I see. The code here should be: rc = smc_listen_ism_init(new_smc, ini); if (!rc) return; smc_find_device_store_rc(rc, ini); not_found: ini->smcd_version &= ~SMC_V1; ini->ism_dev[0] = NULL; ini->is_smcd = false; Thanks, Guangguan Wang. > >> return; /* V1 ISM device found */ >> + } >> >> not_found: >> - smc_find_ism_store_rc(rc, ini); >> ini->smcd_version &= ~SMC_V1; >> ini->ism_dev[0] = NULL; >> ini->is_smcd = false;