Received: by 10.223.164.202 with SMTP id h10csp97701wrb; Tue, 7 Nov 2017 03:33:16 -0800 (PST) X-Google-Smtp-Source: ABhQp+QP6W3ugr7ZOYuxTsnX90nFCh2gqzrrwbbiPvbyxTDg70LJN3QOmYhyKSEhsGqgiBMxCLml X-Received: by 10.98.131.68 with SMTP id h65mr20168339pfe.148.1510054396602; Tue, 07 Nov 2017 03:33:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510054396; cv=none; d=google.com; s=arc-20160816; b=oca8i7XtBIgxEFYxsh29XCR+SGGDIvHqg4FRY0R2VUgdHbJZdQFjUK2FiJTzJjOvbN 9P+NGG29ULozdw+5TYuoFWnIKta0lG9Dw4NnBgS/cSTdJ+WCfj0zxc8ixsJ2F6AeLOww uxe+6IJKeqs89nQtc3t8XrPi9XXAJkpjEsg6OPoA6kKmZx9LKKdRD2T4no5/dlJdJ0ri gLgGtvlGJtQr6tkHKuSZeCtTnzN4ApNo9oPzV8FxKVJHgDVi94GgZ6ZkqiTXhL+ePmRM phPWAArf8fre16U1j7w///FwEFFEfgTvt5idtZs0PWGcmQtIrKUrfuy68EiCO4WpDm00 tl/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=NUG2vIw/lS5J/OUKcsgAlSj0gQc9sImP1jgrX7tb8DA=; b=Tixp70YOWVgoOH645geMi02ty5wd5xhSs4/xWGkZMJoIofHgqeDCk1vM1iae0mDECn X7RxmsFwZXKQQnlXI8F5/RczSNM1SzoSa/y3udRJu0XPrhc/K//o9dhDFBPDjDnpcVGm IdrzkQL5M3g7LCx0UqnCbPohcWeSfllmXPaEQCvRVJwRv6NFgD+TZaRWmAw82tK74HxG DVedmGcFUVSonZlyDpXRyJPIzAsiVbKC/ykHWBfuoIheuRDhyDWXN3rxzlBpo+FhEFwv XhPNgYZk2r3lMsVXjrmcv4s517Jd5RRc6yF0WIqoftX9zuG/nDF6zMArTFYC/2wLowDf xRIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=exchange.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p8si922676pls.804.2017.11.07.03.32.41; Tue, 07 Nov 2017 03:33:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=exchange.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756002AbdKGJBq (ORCPT + 91 others); Tue, 7 Nov 2017 04:01:46 -0500 Received: from a2nlsmtp01-04.prod.iad2.secureserver.net ([198.71.225.38]:39006 "EHLO a2nlsmtp01-04.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753263AbdKGI5J (ORCPT ); Tue, 7 Nov 2017 03:57:09 -0500 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id BzfqeKNnzV6DQBzfqe7raL; Tue, 07 Nov 2017 01:56:08 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1eBzfq-0003Kv-4i; Tue, 07 Nov 2017 01:55:58 -0700 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 Subject: [Patch v7 07/22] CIFS: SMBD: Implement function to create a SMB Direct connection Date: Tue, 7 Nov 2017 01:54:59 -0700 Message-Id: <20171107085514.12693-8-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171107085514.12693-1-longli@exchange.microsoft.com> References: <20171107085514.12693-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfF8i4O/0Ho5FkUKPV/D3rffDpagbqHas5BADeIknaixcqFOVAO4jizlh1d8PGM/muU8VKeS+swNrzckuStzijmprWSqB8x236KhhABmK+k6UcNq+6WTU FtteOgf+Dio2nZGdiWHpMz08FhYN5tocipEB8GrLTTfS1KCplWXZG7PHsrgnxaHkn4CHF8UmSUyhaYJBSIzAzJTCOrF+YPqV/7ysglI1LQA2ApZiwSChMEVx z/+COsEJHQztbupgHhyHiX5NfVqderSbBVTPALyAOSIagicNYuMUkmFJcaQWEHLTMbSZB/Vx97O6cGQqCjBI6k7yPbePT/B1QvD2gcCNxrfjY+oO9W30nDTd 9qA4esvwOoJ5Ocfk+Sq0Uywe/nP+z9X80jKAHiH9VJPLi+EUXKRhMq7k3lwwrvH1cBTuLzepdApr3KmkODDltp14YQnGvwymdm7BhwDWL6007PXx7SBAe1QT G6GwuhLqHD0T9yNlQNAPJmcw6+h4xs/6CjTexA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 021d527..1db39a34 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -1651,3 +1651,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 From 1583351122268195227@xxx Mon Nov 06 20:48:19 +0000 2017 X-GM-THRID: 1582193826625793849 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread