Received: by 10.223.164.202 with SMTP id h10csp101217wrb; Tue, 7 Nov 2017 03:36:51 -0800 (PST) X-Google-Smtp-Source: ABhQp+RxPSxAW158J+BnG/EITQWI4ZY1KLTU4qc9UEPV3Bi+cZvrXcOpXfJaJ0nQKyixhuBXHiV6 X-Received: by 10.98.223.15 with SMTP id u15mr20428985pfg.115.1510054611590; Tue, 07 Nov 2017 03:36:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510054611; cv=none; d=google.com; s=arc-20160816; b=QRGNR73t88KMv1oftdA4L2DJuDtJ1BOINV8r88wg4xoQSVbTKpM4iofUyHLyX41BHm qpTzJ6gRedB4btspfF/oS7FMEQV80qA9FsKrqGetQda4ZiKxz1EagncOU6aOISySl05n XOErzuQFv4SchVlHddAAxBRjZRZy+KZovmLB65Q7snmqg2eUYiwoil8xLwrhFO/nZ/Pi 0OQY/CQtxmNFkWoeQE/JxwNrTCAyF76hWaDZRkSJBz06p8xujs1le+7u1cbDzYpJCHTr RmpJT31nJrY1nNBYGWTDPDa85VmlHxa3pfb25VDpAcW7ySRIB7VHYiZGT1XrIp0BVR+Q wpsA== 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=lF+MjlqPFwf7cwz3vrI/Fxpgh+HgrO+I+J6wgerr73M=; b=bn0O76w+KB4CrfP2HnAmn3zVfc6VhG0jkJ1TDKQSrSUJS0HyWoGzWks42HOt3bj7fZ dKuHHPxxKfZuNLfXDGKqbljUj/HXeM7JsnrVngKeRgXHk7LGZKdVsFAequg6tXv2sJ+X KTNih4cI+21enLccB7CpDHARUsFy3txxHplI+onyUhBqq3Y9HFT840/jAXeeI+hvGHO7 VMHfUVpcTA5Z05xvLXouEfsMYb4I+FRCk+CaBCCD2XnMoKTiJJQkPoJreQPj3ucug/lA PwB37TfH44pFhEAeuzcrDKJhLrVbU6unEtnCINkzxbc4Wa8lFTnrWJdPflQndTmaU9rR 9Vmg== 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 r84si1038266pfa.352.2017.11.07.03.36.37; Tue, 07 Nov 2017 03:36:51 -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 S932457AbdKGJDk (ORCPT + 91 others); Tue, 7 Nov 2017 04:03:40 -0500 Received: from a2nlsmtp01-03.prod.iad2.secureserver.net ([198.71.225.37]:47100 "EHLO a2nlsmtp01-03.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753260AbdKGI5J (ORCPT ); Tue, 7 Nov 2017 03:57:09 -0500 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id BzfqeqGOvKv33BzfqejPiH; 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-0003L1-8l; 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 08/22] CIFS: SMBD: Upper layer connects to SMBDirect session Date: Tue, 7 Nov 2017 01:55:00 -0700 Message-Id: <20171107085514.12693-9-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: MS4wfOSx9VOPj+7cr1bpGW03WNHIfPwlB9UX16sXS2ocxbLdQTnTZSb2GuG1zvgQMte4m30NsweHatwbvJULNnS6dS5IhHJvrR+eXkvXj62tHp+0MD+cpXw1 HMwb19vKcJbSk5onzO0wXwEcFRzxdGl+PcqTpkE1TY6i8HhEUPNhUUaNkL/iALqUrxPmX2M79nD0QH01/xhaRQqxnA9b/rrh2osFWSUN05UQpR8HlyoA1t4G nH4AEUjh88719JBC7jVJ3paZ69xKfoPO0Fue6FnDgDsZzB7DLx+qg43pdSYRaFwrAs4s9xuwDVKkZ4NBhwktu1ZuTEhCY0ymu2r6suDr1PIxop3pZzYURGyz IbTl7h2mM5st520bU8WytH6A1lm966X2FQe7gfrnt1a5qfCydJ1pAbxsvPog3BdsW/PLaWZNQF3Esh1kQ2KY8v3t5HYHcaCljMrYtQEupwRWCbDtdghgfG3q neATKvI/01uwbjMrhot4b3o7sNdOqvK2v7Xn8A== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Long Li When "rdma" is specified in the mount option, make CIFS connect to SMB Direct. Signed-off-by: Long Li --- fs/cifs/connect.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index b5a575f..75eb50b 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -44,7 +44,6 @@ #include #include #include - #include "cifspdu.h" #include "cifsglob.h" #include "cifsproto.h" @@ -56,6 +55,7 @@ #include "rfc1002pdu.h" #include "fscache.h" #include "smb2proto.h" +#include "smbdirect.h" #define CIFS_PORT 445 #define RFC1001_PORT 139 @@ -2279,13 +2279,29 @@ cifs_get_tcp_session(struct smb_vol *volume_info) tcp_ses->echo_interval = volume_info->echo_interval * HZ; else tcp_ses->echo_interval = SMB_ECHO_INTERVAL_DEFAULT * HZ; - + if (tcp_ses->rdma) { +#ifndef CONFIG_CIFS_SMB_DIRECT + cifs_dbg(VFS, "CONFIG_CIFS_SMB_DIRECT is not enabled\n"); + rc = -ENOENT; + goto out_err_crypto_release; +#endif + tcp_ses->smbd_conn = smbd_get_connection( + tcp_ses, (struct sockaddr *)&volume_info->dstaddr); + if (tcp_ses->smbd_conn) { + cifs_dbg(VFS, "RDMA transport established\n"); + rc = 0; + goto smbd_connected; + } else { + rc = -ENOENT; + goto out_err_crypto_release; + } + } rc = ip_connect(tcp_ses); if (rc < 0) { cifs_dbg(VFS, "Error connecting to socket. Aborting operation.\n"); goto out_err_crypto_release; } - +smbd_connected: /* * since we're in a cifs function already, we know that * this will succeed. No need for try_module_get(). -- 2.7.4 From 1583963139698517233@xxx Mon Nov 13 14:56:04 +0000 2017 X-GM-THRID: 1583694038881830977 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread