Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp797526rdg; Fri, 13 Oct 2023 01:01:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkZJj3be76R2AwLglrpREMtyBwfYWEMEPJAPmnCyZATjraX+PaLzXxEA+0EYaxVsvEhuAY X-Received: by 2002:a05:6358:7e8b:b0:143:9dcb:2 with SMTP id o11-20020a0563587e8b00b001439dcb0002mr25844953rwn.24.1697184077047; Fri, 13 Oct 2023 01:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697184077; cv=none; d=google.com; s=arc-20160816; b=SiTaNGuww4sLpceWGdqOSHuh9JSAlGZs0loGcZWtkV86udAkgougro4h1GZLckGGo3 7pJJ3kHczmRuozxrrVDMHWZdSM+IElTG8zZrr9BV9Wa6ERUBwKj7oxijwcYJrGWEf4UY y09ZWHQYf2VfoTeh9PHoB4IWOZq+B906Rn+UQGx6YVu9RN2PXvlg/9qV7XWAvsS9ZQcK XMY5AMXYuVBrdrNNS/Rv046v89V1ioW1eFIwlDrcY92JPDbxObQl93el64ZHrhm4rUdH OcmCR28NsolGteV+PCyNy0YUrsyE4ivmU1UCoK9md0EPVQZK+/JuLcPwJFMmcZ16A//B BipA== 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:references :cc:to:subject:from:user-agent:mime-version:date:message-id; bh=A59b/AM5gYeCQzUG1OFau0rs6n6QoI3yyLgY2LCKdQU=; fh=tLSSqYWHpmmxspJljEYa8O3IE0s1BLbwoPZT6x0W31Q=; b=UY/r7Frt22Jx25eWDkfHxKA4Od7pW2sCRguPWJbMN9ZfrKxjt520HbbuALKJzHh1Hx xjvi8yJSabhFgodulmiz2C6GHfMBcZnWJRYPn9ddKhcFNoyUTUhls+HEqTpS0mu4m8+G gx4FamukDeA/1U66u5ofcKw0XUJcDHcFO26zlebws5oWnOHsbYLxGXKsCKns2IFM8HlK SecLfe/QZuYH6ZUkPLYcMcEEwjZ8ZuiegGGjxZCCqfe/wLPszoukY/6L34rIE2NBQtOs JiywHU8cadGUwgl+WOyhRH04L6wpHFYVeJl7BFJJ/7nucH0trLfk2D7GMhumvJcRJ04Q /ebw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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. [23.128.96.31]) by mx.google.com with ESMTPS id h68-20020a636c47000000b00565325c6ca6si4126732pgc.489.2023.10.13.01.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 01:01:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 EB6EB842C6AE; Fri, 13 Oct 2023 01:01:13 -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 S229726AbjJMIBE (ORCPT + 99 others); Fri, 13 Oct 2023 04:01:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbjJMIBD (ORCPT ); Fri, 13 Oct 2023 04:01:03 -0400 Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7487283; Fri, 13 Oct 2023 01:00:58 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=guwen@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0Vu1RuqR_1697184054; Received: from 30.221.129.88(mailfrom:guwen@linux.alibaba.com fp:SMTPD_---0Vu1RuqR_1697184054) by smtp.aliyun-inc.com; Fri, 13 Oct 2023 16:00:55 +0800 Message-ID: Date: Fri, 13 Oct 2023 16:00:52 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 From: Wen Gu Subject: Re: [PATCH net] net/smc: return the right falback reason when prefix checks fail To: Dust Li , Karsten Graul , Wenjia Zhang , Jan Karcher , "D. Wythe" , Tony Lu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231012123729.29307-1-dust.li@linux.alibaba.com> In-Reply-To: <20231012123729.29307-1-dust.li@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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]); Fri, 13 Oct 2023 01:01:14 -0700 (PDT) On 2023/10/12 20:37, Dust Li wrote: > In the smc_listen_work(), if smc_listen_prfx_check() failed, > the real reason: SMC_CLC_DECL_DIFFPREFIX was dropped, and > SMC_CLC_DECL_NOSMCDEV was returned. > > Althrough this is also kind of SMC_CLC_DECL_NOSMCDEV, but return > the real reason is much friendly for debugging. > > Fixes: e49300a6bf62 ("net/smc: add listen processing for SMC-Rv2") > Signed-off-by: Dust Li > --- > net/smc/af_smc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c > index bacdd971615e..21d4476b937b 100644 > --- a/net/smc/af_smc.c > +++ b/net/smc/af_smc.c > @@ -2361,7 +2361,7 @@ static int smc_listen_find_device(struct smc_sock *new_smc, > smc_find_ism_store_rc(rc, ini); > return (!rc) ? 0 : ini->rc; > } > - return SMC_CLC_DECL_NOSMCDEV; > + return prfx_rc; > } > > /* listen worker: finish RDMA setup */ Inspired by this fix, I am thinking that is it suitable to store the first decline reason rather than real decline reason that caused the return of smc_listen_find_device()? For example, when running SMC between two peers with only RDMA devices. Then in smc_listen_find_device(): 1. call smc_find_ism_v2_device_serv() and find that no ISMv2 can be used. the reason code will be stored as SMC_CLC_DECL_NOSMCD2DEV. ... 2. call smc_find_rdma_v1_device_serv() and find a RDMA device, but somehow it failed to create buffers. It should inform users that SMC_CLC_DECL_MEM occurs, but now the reason code returned SMC_CLC_DECL_NOSMCD2DEV. I think users may be confused that why peer declines with this reason and wonder what happens when trying to use SMC-R. Thanks, Wen Gu