Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6017688iob; Tue, 10 May 2022 08:33:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2PsGbyYFl0w8v2uDyr07Ugtxb/fX3+c2JdK9DtWal9YwplDrY78ESHlQq+hsOMCrN/FKh X-Received: by 2002:a50:c055:0:b0:428:8fe7:b2a9 with SMTP id u21-20020a50c055000000b004288fe7b2a9mr14762290edd.288.1652196820228; Tue, 10 May 2022 08:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652196820; cv=none; d=google.com; s=arc-20160816; b=yI0xLD4sC+q79pGuXNzobWOyH7AD6Ku5TzqnjY0c3dHUT6BzOWVIhMqi+NyHrv3kKl n588Bj+dcyGXh0y8MjGLzxBa8mlQgDtF03ud7hatQVXMI81OC/knjuHN2UWtkASIaRf8 pGKvpNho0MiPCiX/tu5kKpmI9ltfgR/+PnYuSSLKMg8iuL1FlcpzJafVKyXlVPROwlyt Zgl+MW6whYJ4EmXHIuQv9PYlynLiyYirY267KDQPmTnrSa4vxAMn+G93yk2z2ac7SbbN YwPceXk2gn2nZai6CKWPGAHcM1wR195iOeLvno60/Cbt73F3ddiypIvFeiB8LoMCUlS0 +ATA== 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=Aw8nHGsPZRrUQCCDZgC/K0rRlByKpbysVBWc6kqTl00=; b=d+jEaRQngHVNbENGl1xb3xPCTdCovJAhqqg09sm0NQPABDOG7Qc0sNCw4Jfw5CAKF3 HwQ5TT5iFDrh6qO8lVWRx4eP7wkbnj70OMproq4crnD8UWsUaYgACQwL9laBwGOITNCC 3TVyuSVMewVQlVIkY+c82xhOdCtUWXBzYx8Cuo6/ASvgsAE1Kkc5YqGugSUblyoslG9A I1qCUNsTomn7Xa1xbhWY8F2wA3N1mqGpiFsvbZk0wZaBog2yL80aL+AX2Po9v2hzvaPS XO1osYi4mqYCExMIOIFGznTKyvMjkInUpnZ88ihtTFPXonDohmbvtMsBxro+uTgUJ+f6 G4Eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t12-20020a056402524c00b00427e7dbfe16si16954693edd.392.2022.05.10.08.33.13; Tue, 10 May 2022 08:33:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242107AbiEJNCn (ORCPT + 99 others); Tue, 10 May 2022 09:02:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235608AbiEJNCl (ORCPT ); Tue, 10 May 2022 09:02:41 -0400 Received: from out199-14.us.a.mail.aliyun.com (out199-14.us.a.mail.aliyun.com [47.90.199.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EA8825BA7A; Tue, 10 May 2022 05:58:42 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=guangguan.wang@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VCrRFdb_1652187518; Received: from 30.43.104.207(mailfrom:guangguan.wang@linux.alibaba.com fp:SMTPD_---0VCrRFdb_1652187518) by smtp.aliyun-inc.com(127.0.0.1); Tue, 10 May 2022 20:58:39 +0800 Message-ID: Date: Tue, 10 May 2022 20:58:38 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH net 2/2] net/smc: align the connect behaviour with TCP Content-Language: en-US To: Tony Lu Cc: kgraul@linux.ibm.com, davem@davemloft.net, kuba@kernel.org, linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220509115837.94911-1-guangguan.wang@linux.alibaba.com> <20220509115837.94911-3-guangguan.wang@linux.alibaba.com> From: Guangguan Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/5/10 17:30, Tony Lu wrote: > On Mon, May 09, 2022 at 07:58:37PM +0800, Guangguan Wang wrote: >> Connect with O_NONBLOCK will not be completed immediately >> and returns -EINPROGRESS. It is possible to use selector/poll >> for completion by selecting the socket for writing. After select >> indicates writability, a second connect function call will return >> 0 to indicate connected successfully as TCP does, but smc returns > > If the connection is established successfully, the following up call of > connect() returns -EISCONN (SS_CONNECTED), which is expected and SMC > does it, same as TCP. > > In case of misunderstanding, could you append more detailed information? > > Thanks, > Tony Lu > io_uring uses nonblocking connect as follow steps: 1) call connect with nonblocking 2) wait for selector/poll to indicate writability 3) call connect to confirm connection's state In the third step, tcp changes the socket state from SS_CONNECTING to SS_CONNECTED and returns 0 if the connection is established successfully, but smc returns -EISCONN.