From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 320D7C433EF for ; Tue, 10 May 2022 12:58:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242098AbiEJNCm (ORCPT ); Tue, 10 May 2022 09:02:42 -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 Precedence: bulk List-ID: X-Mailing-List: linux-s390@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.