Received: by 10.223.164.197 with SMTP id h5csp685668wrb; Sat, 4 Nov 2017 22:49:23 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SufIKI9e1weIVvjpWn01CsS4NYqaZlSBlzDewiroFO1qd7s3BJJ+AMq+ghW2zc2ErGRJ3Y X-Received: by 10.84.241.207 with SMTP id t15mr11227987plm.158.1509860963546; Sat, 04 Nov 2017 22:49:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509860963; cv=none; d=google.com; s=arc-20160816; b=iM2a6xjDe8qCvQmFG+vBYpjCElOv/Ym5XnBqRa2B4VcgxI+DFndHR4EIS436UEDbUh y6x1l6RVUYZcJ3jRtHQP3yUIezGZq1IDPzrjH2PkGdhcADKFt+HLTWIYtVNlL/3e2qns 8+1aQnnYMq7WS4s8n0jtO0KTnP7haoM0IhoT8SKmoHafxcLq9rRVYOJImq+fP/QcqdVo MKmvWQUdB4eE2Yesc9y11PiDf5F9Ftq+gOjG5cJ0vvV31n/5CvvUuJ1MbV+WLPdDCgB/ lBNMQjBOqMgGCf9bKoQojd9vcTWd/VLAnkpZljnFXmJfB4La+IqDY76CHbma+2RGnXiE 6l5g== 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=p4USneiNbfND1uYd3Rr/8PYDMwfLKWbcgU28mgWBQfM=; b=Y+M56B9OpzatpsX48dH5Hm0MQcVtqYIG8WNpg71UiK081PX5CLrWrdztcDlzIRFAtw AtuFh2I7rNa9lu6Jb4tW5ZjlFlIBhkJABL5tBCCkHpOmAQ0LPb8+2VYyJknw4ubZ4DJS /KUDuTi9D0eDd91DD8hkYHVHIgCb0GTCQ0BfBmId14rA/2CmzHV79KiX54zdCwiwo0hh adWR2lJc1dv+MCL873TtfDV+S5SD18COj8ZbQb+oos4s8cKgA8qfx9HQUfWeMNLaA37j S3fFqL7zFQBX8RDWnHT1dzzSmUQrt2Q3av/4rVd5hT/taLLtRgcG3pq7SxvZwLOFJKgf yXcA== 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 w5si9540334pgm.393.2017.11.04.22.49.10; Sat, 04 Nov 2017 22:49:23 -0700 (PDT) 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 S1752863AbdKEFrF (ORCPT + 96 others); Sun, 5 Nov 2017 01:47:05 -0400 Received: from a2nlsmtp01-04.prod.iad2.secureserver.net ([198.71.225.38]:55912 "EHLO a2nlsmtp01-04.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751058AbdKEFpy (ORCPT ); Sun, 5 Nov 2017 01:45:54 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id BDjUeEGrzV6DQBDjUe8bPb; Sat, 04 Nov 2017 22:44:52 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1eBDjU-0006Ei-DB; Sat, 04 Nov 2017 22:44:32 -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 v6 08/22] CIFS: SMBD: Upper layer connects to SMBDirect session Date: Sat, 4 Nov 2017 22:43:50 -0700 Message-Id: <20171105054404.23886-9-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171105054404.23886-1-longli@exchange.microsoft.com> References: <20171105054404.23886-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfCE1mYXmjYluDDVfQQEFb9VxVSn0Yn8qHGlRtZSNuXAUaArJhlWV3uTMpr+tMSvNkn6BaDAyS/xf+4DStJvGPoBXW1C1srZQXp2bZtApb5ZuJ7sTr40i EAN5xYSUh/tegeXxE/AKLXE9zFWJBFo+nzQRVCQSFCUjxBNhkPP+OKVBg1pPlQux6r75BtHgGNm11eN1Yxu7iCPOw3CjP0JFUYWJp6volWCry51om7U9PW8H 5OmJhf7uGO+TT7rIkmbFuStJi2HLSlECA0Xfofd/XsCQwehKCK4b3DABcVspbXJug2X4jsMrRs+xalPspIq8hhPoxKg9Xxg6P5fl91Tb8ujNzqm7/VvF8yIZ pJvuHTn7oTai8vBtz71rcM3mv5gapoN28ADx2kpwG38pHn/eeBosNdO6fRdxcl9pEyrADrVRrAkWTRWbI3zVcRvLa992OmyeyIxVNeDttH3fIkTb18iDKbKl ngOPg+HcVMvP99J3EeeA7CbuTHfIaXz9metrdQ== 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 | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index b5a575f..2c0b34a 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,9 @@ #include "rfc1002pdu.h" #include "fscache.h" #include "smb2proto.h" +#ifdef CONFIG_CIFS_SMB_DIRECT +#include "smbdirect.h" +#endif #define CIFS_PORT 445 #define RFC1001_PORT 139 @@ -2279,13 +2281,32 @@ 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) { +#ifdef CONFIG_CIFS_SMB_DIRECT + 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; + } +#else + cifs_dbg(VFS, "CONFIG_CIFS_SMB_DIRECT is not enabled\n"); + rc = -ENOENT; + goto out_err_crypto_release; +#endif + } rc = ip_connect(tcp_ses); if (rc < 0) { cifs_dbg(VFS, "Error connecting to socket. Aborting operation.\n"); goto out_err_crypto_release; } - +#ifdef CONFIG_CIFS_SMB_DIRECT +smbd_connected: +#endif /* * since we're in a cifs function already, we know that * this will succeed. No need for try_module_get(). -- 2.7.4 From 1583055760854360724@xxx Fri Nov 03 14:33:40 +0000 2017 X-GM-THRID: 1583055760854360724 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread