Received: by 10.223.164.202 with SMTP id h10csp94157wrb; Tue, 7 Nov 2017 03:30:06 -0800 (PST) X-Google-Smtp-Source: ABhQp+Q4amY4RFgVXf4Kt1xl6Jb896nWvyVKVL/UwYASQrz1urAbk4EZtWprA38ahCnGNeKTjkIO X-Received: by 10.98.159.210 with SMTP id v79mr20057430pfk.162.1510054206547; Tue, 07 Nov 2017 03:30:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510054206; cv=none; d=google.com; s=arc-20160816; b=LdFe2ixTlEdpD0rj2obabLY//H5y/t+LIOaGB8uwxmqVhXvtAYhTdcpiku7RBfEWFi 3c6tia3IlV3awsKYc3Y11Ug5DwyXxt6ZimZJz+De8Q/yADX/aYsChJs+6fbl2/ZF+i32 N/CrfV22O9AU6hCfngHtJL5SE3/wV9TNTbXV03vpc6FQCOSq60Xrvig8V9iGUmSuAg/V xkUr0F+3yOY+N2+dOew4XChXVFRBSC/v0dawhBMUj9VQvjPC74lcswYD9WRCeqBNdFZl kaF0T5V3deZteoA5zcjBN6pjV/w9blBB6BBin7jyb+JDQkCU/asUDKAkt1qYHqDG/vbz hr1A== 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=8FzR0XBBQTc7QtWB6sEpEeB9mRdcvG3ZbnZ9V2F56S8=; b=Zwtk/E0MrC74G+EM+lTDF7ou3kU57uRRRkL4z28eYRbmRK76qEhRbJ/37EjiAmRyn7 CMtzK6Xtqhu2C4hyuy9Hv6XhDCeT8iV6odmTXAW+uAAd0VocZCHBbkbf0tWULsKfMBT6 ZgtjTNuOFIfCosuwLclhnu9jfD9U7tY/Ql9HjLZ5ObeqnriNfUWj+9eiFkMUKgoOk/VJ pcdEpo9i80wQuGxIqjmVgyytvLlLtjCzw1ch5pG9abjP7r2WbGbBTInBPcfaXS8vPX7P MV0mYdFfHGWp8As7zU24DuFGx1gWvrpVC9fyofwEJObXAtkLP9KQDqbLq6jwcAemR8FK noeg== 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 k76si945947pgc.537.2017.11.07.03.29.53; Tue, 07 Nov 2017 03:30:06 -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 S1755900AbdKGJA4 (ORCPT + 91 others); Tue, 7 Nov 2017 04:00:56 -0500 Received: from a2nlsmtp01-04.prod.iad2.secureserver.net ([198.71.225.38]:39004 "EHLO a2nlsmtp01-04.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753295AbdKGI5J (ORCPT ); Tue, 7 Nov 2017 03:57:09 -0500 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id BzfqeKNopV6DQBzfqe7rb5; 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-0003LV-Rw; 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 13/22] CIFS: SMBD: Set SMB Direct maximum read or write size for I/O Date: Tue, 7 Nov 2017 01:55:05 -0700 Message-Id: <20171107085514.12693-14-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 When connecting over SMB Direct, the transport negotiates its maximum I/O sizes with the server and determines how to choose to do RDMA send/recv vs read/write. Expose these maximum I/O sizes to upper layer so we will get the correct sized payloads. Signed-off-by: Long Li --- fs/cifs/smb2ops.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index fb2934b..abc8bd5 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -32,6 +32,7 @@ #include "smb2status.h" #include "smb2glob.h" #include "cifs_ioctl.h" +#include "smbdirect.h" static int change_conf(struct TCP_Server_Info *server) @@ -250,7 +251,11 @@ smb2_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *volume_info) /* start with specified wsize, or default */ wsize = volume_info->wsize ? volume_info->wsize : CIFS_DEFAULT_IOSIZE; wsize = min_t(unsigned int, wsize, server->max_write); - +#ifdef CONFIG_CIFS_SMB_DIRECT + if (server->rdma) + wsize = min_t(unsigned int, + wsize, server->smbd_conn->max_readwrite_size); +#endif if (!(server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU)) wsize = min_t(unsigned int, wsize, SMB2_MAX_BUFFER_SIZE); @@ -266,6 +271,11 @@ smb2_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *volume_info) /* start with specified rsize, or default */ rsize = volume_info->rsize ? volume_info->rsize : CIFS_DEFAULT_IOSIZE; rsize = min_t(unsigned int, rsize, server->max_read); +#ifdef CONFIG_CIFS_SMB_DIRECT + if (server->rdma) + rsize = min_t(unsigned int, + rsize, server->smbd_conn->max_readwrite_size); +#endif if (!(server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU)) rsize = min_t(unsigned int, rsize, SMB2_MAX_BUFFER_SIZE); -- 2.7.4 From 1583383432028798005@xxx Tue Nov 07 05:21:52 +0000 2017 X-GM-THRID: 1583372057101262602 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread