Received: by 10.223.164.202 with SMTP id h10csp102877wrb; Wed, 22 Nov 2017 16:44:45 -0800 (PST) X-Google-Smtp-Source: AGs4zMaglxdbyuwUexrdjZTv5wF4R+mZWgogYUQXmyVbMAbJs+StTBGGeHIc0hRKkMX3amVUFQKy X-Received: by 10.98.204.198 with SMTP id j67mr4534856pfk.41.1511397885392; Wed, 22 Nov 2017 16:44:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511397885; cv=none; d=google.com; s=arc-20160816; b=sxMu0cxYzSNthfW5rk1Z6LH3uXH3umfYZQh3koztPABUwFYEZIzCWuR5RWIbl48D86 SSWVnn5ZoU//8rngZ56ZTI+nCsQjT6gBgOmzatkayu3QeVUv0doChLjMbnF55JsH3fiJ klk1T2cWaGAne34HqfwjY/2/aygJargQobI8HkpJQjuc/eY3wvNjcIdqMvp8r+wh4DS6 aHKX9yy3HGNM114XzXNN3JXhcJq6bATBM3pnb/5GqjkCotbrFRr+zfkCt12jFRVTvTUz 8B4wh0xzn84c+MFYZjlbyisbmffziaB0QIVXGRdbgeO2/NjrRZADlFK7NwOAim/PmIM8 VXhg== 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=PBs05DAbrmYZMwchMm36vNgd20MXLf65hKS0mWHV/ec=; b=hlR0yCvzM0Z2glXFSIryFb38GaBNjdvFCz4GWLEw4vZ9eb9NmXL9FMbFBZ9irWZjwq 75wZo/2yMQ2LgvAGjARIr6CHArIhCVIGPke2ftWdaj3KONedgj6L9atLiY2l4VWh2Yyz jQBQdknfPfQc+2hIhwp+Up4zYGxM1eBS01QhJOManArb2iScd2b2BBIsswPQTPBrZzip g3WU7BsaOCFqkDQLnUly665oOSVI28UO0oRWemJoYx38sy8cEn/x+VPTPSlJke1P/WGT tS/5oYloK/CN6dn3IFeHhuQkFtk+HNbGnQEFM9PCo8VZOXSql3ZJImsGjgDQF6Kzg6g3 3JiQ== 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 s13si14459653plp.649.2017.11.22.16.44.34; Wed, 22 Nov 2017 16:44:45 -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 S1753042AbdKWAml (ORCPT + 76 others); Wed, 22 Nov 2017 19:42:41 -0500 Received: from a2nlsmtp01-04.prod.iad2.secureserver.net ([198.71.225.38]:39094 "EHLO a2nlsmtp01-04.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752846AbdKWAkR (ORCPT ); Wed, 22 Nov 2017 19:40:17 -0500 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id HfXbe4a0ZgsKFHfXbeQWzV; Wed, 22 Nov 2017 17:39:15 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1eHfXa-0004Sb-Vf; Wed, 22 Nov 2017 17:38:55 -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 v8 01/16] CIFS: SMBD: Upper layer connects to SMBDirect session Date: Wed, 22 Nov 2017 17:38:34 -0700 Message-Id: <20171123003849.17093-2-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171123003849.17093-1-longli@exchange.microsoft.com> References: <20171123003849.17093-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfMx17fB2IM18OhHya7nSqeI1TU27HfLb89W61fSKlWSryyU91KItac6cYa3RjtRWcWS1hLH43/nB3EYvgbOLFL+rG/wvKSYjcdRQb27fSJfHxKxuHj74 sWq6oBYPzdXSY8BV6sAOIBzJwyNRx9BQBzsImZMtQPAf4pfGGHc2u/Y+Bt0uauz4/sFJeUvAnFfDo+4OW3nsOne+oPOAcPbO6TTTYuCIjcApUz6Pse1zm/Xx p5n18XyDBAX6qDnuSz0EL8it4SIYMsLhZ6KfKhCtgF4d4JncJu95Wv6vumDYdik1AO95w4be+TAsgParTJ8O5ToBpj9tHjYFYv52Q6ELXk2kqViRjY0T349M hzKqvKKbfyxMM88BLvVhQjCFpu3BDT5kyj7+GdyC19r2jgrs+GP3KLxSlxifzja+0Vg5DW0ofokfxFHVe/UBwRbqBQ2NlP17OvP0/Ei1KBBg1xG31xqRriBP Xjxgj/vgLIsoc+GwxWjqFZcQ9vl60OS257IG8g== 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 64be6f9..fafaecb 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 @@ -2310,13 +2310,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 1584761022419102322@xxx Wed Nov 22 10:18:04 +0000 2017 X-GM-THRID: 1584761022419102322 X-Gmail-Labels: Inbox,Category Promotions,HistoricalUnread