From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751262AbdKTHix (ORCPT ); Mon, 20 Nov 2017 02:38:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48890 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751107AbdKTHiv (ORCPT ); Mon, 20 Nov 2017 02:38:51 -0500 Date: Mon, 20 Nov 2017 02:38:50 -0500 (EST) From: Leif Sahlberg To: Long Li Cc: Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Christoph Hellwig , Tom Talpey , Matthew Wilcox , Stephen Hemminger , Long Li Message-ID: <1711300759.28570763.1511163530669.JavaMail.zimbra@redhat.com> In-Reply-To: <20171105054404.23886-8-longli@exchange.microsoft.com> References: <20171105054404.23886-1-longli@exchange.microsoft.com> <20171105054404.23886-8-longli@exchange.microsoft.com> Subject: Re: [Patch v6 07/22] CIFS: SMBD: Implement function to create a SMB Direct connection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.64.54.107, 10.4.195.1] Thread-Topic: CIFS: SMBD: Implement function to create a SMB Direct connection Thread-Index: +HfmYZei8IexFkfCxEDiDaUOFU3L0g== X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 20 Nov 2017 07:38:51 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Acked-by: Ronnie Sahlberg ----- Original Message ----- From: "Long Li" To: "Steve French" , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, "Christoph Hellwig" , "Tom Talpey" , "Matthew Wilcox" , "Stephen Hemminger" Cc: "Long Li" Sent: Sunday, 5 November, 2017 4:43:49 PM Subject: [Patch v6 07/22] CIFS: SMBD: Implement function to create a SMB Direct connection From: Long Li The upper layer calls this function to connect to peer through SMB Direct. Each SMB Direct connection is based on a RDMA RC Queue Pair. Signed-off-by: Long Li --- fs/cifs/smbdirect.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index 7af49cd..47d999f 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -1652,3 +1652,20 @@ struct smbd_connection *_smbd_get_connection( kfree(info); return NULL; } + +struct smbd_connection *smbd_get_connection( + struct TCP_Server_Info *server, struct sockaddr *dstaddr) +{ + struct smbd_connection *ret; + int port = SMBD_PORT; + +try_again: + ret = _smbd_get_connection(server, dstaddr, port); + + /* Try SMB_PORT if SMBD_PORT doesn't work */ + if (!ret && port == SMBD_PORT) { + port = SMB_PORT; + goto try_again; + } + return ret; +} -- 2.7.4