Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3128746rdg; Tue, 17 Oct 2023 05:42:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHt8u+eYuL8mb4l8OSclAEccaKBkgpq6zIF2+Gv4NdIIBYbz9XZ+vOlbYtUaadcK+CmmlTi X-Received: by 2002:a05:6a20:158d:b0:15c:7223:7bb1 with SMTP id h13-20020a056a20158d00b0015c72237bb1mr2088093pzj.20.1697546574357; Tue, 17 Oct 2023 05:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697546574; cv=none; d=google.com; s=arc-20160816; b=miK34fmDrOKHIisYLtd1SX95ztFQ/6BIEsve305YJhfhi6Tolh9ACGPa696J6J1ojO 5A4D4qCrqAp8WtDjUCeX07+eVsJJqsWcijtr5sxu2cIWsyQW7xcwkZ8N5EZgS179LikZ OC94iFCMgFPMJ+pzM7+Kc/ty/QSCfsYlMzgMgZvJWlnsK9TDWUU70Mi9Yl7fVpG8IQkr Q94GAwlcxDKrs6GR2b2dQbPByklL485EdXf+bB31Vrhx1/YNb0A1XkWuZKFc3TynL3UH tkznrE5wPJvW4+y/ZJAHdOP/LGQ08VDIV5OeDVjR8Ve1ZHILstON2yK+ZTkOozqRPwyL SEHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=LjDWg316JVpHYf93Zvf+U/pDQf5j3Br0DoMR1/0AHGE=; fh=bqCLTmKd7a94lwczbPziWIXwJo6LRuvipCBdtuKMQIk=; b=GIr4upZXexG8ejqd0aM4Dvdjjiui17sXjO9bdYsAtiGr71wP5CzNsZzXdrYkSODTvY OKoioiaN0mUiTUTD4UKw6UFJxftEdpfEXgjdWYegpyC0AfWTotSi7FrtPR2EKoTIjWPz hohfNuErNlgJX44IFAnW1ixU/NmF8hrpEn87wZe3AODnOhPaOJBbe6UYQ0xt2Dk0jO8w 3AJa4QHkk2umpADRfZIemkM4m/mVU0ph8C3sMghUG/7L0NWdzPpjbLr1XYBSJ6o/dE5i ln1NPHbJGIzL7/aj3OBNKv6/ASvrhuexQ9D/t3DzZxcvypdFPtGheJTxVylx1qfl05D/ wI3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id g3-20020a63e603000000b0057823b96685si1696054pgh.681.2023.10.17.05.42.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:42:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id F27F2807E405; Tue, 17 Oct 2023 05:42:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233862AbjJQMmp (ORCPT + 99 others); Tue, 17 Oct 2023 08:42:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232580AbjJQMmo (ORCPT ); Tue, 17 Oct 2023 08:42:44 -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 2EDD4EA; Tue, 17 Oct 2023 05:42:40 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R481e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=guangguan.wang@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0VuNiO21_1697546556; Received: from localhost.localdomain(mailfrom:guangguan.wang@linux.alibaba.com fp:SMTPD_---0VuNiO21_1697546556) by smtp.aliyun-inc.com; Tue, 17 Oct 2023 20:42:38 +0800 From: Guangguan Wang To: 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 Subject: [PATCH net v2 0/2] net/smc: correct the reason code in smc_listen_find_device when fallback Date: Tue, 17 Oct 2023 20:42:32 +0800 Message-Id: <20231017124234.99574-1-guangguan.wang@linux.alibaba.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 morse.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 (morse.vger.email [0.0.0.0]); Tue, 17 Oct 2023 05:42:52 -0700 (PDT) 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. Guangguan Wang (2): net/smc: change function name from smc_find_ism_store_rc to smc_find_device_store_rc net/smc: correct the reason code in smc_listen_find_device when fallback net/smc/af_smc.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) -- 2.24.3 (Apple Git-128)