Received: by 10.192.165.148 with SMTP id m20csp4139568imm; Mon, 30 Apr 2018 12:28:50 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpW+KWtNDxZeuEmfWxEVl/g9qVu2syoqmrkv9rAv865f4ExFkki9xwgS0oOq/8jZXYImtZC X-Received: by 2002:a63:a34d:: with SMTP id v13-v6mr11005002pgn.224.1525116530735; Mon, 30 Apr 2018 12:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525116530; cv=none; d=google.com; s=arc-20160816; b=RlE1bjXe1zsT8LdtHonfueFOJyO3Uwr2UiWLrc+RhlYSjKOf68A7xXJcV8g/+Ed4Li gpOFH+7VkFkaO90Ma768mB75qZvmIPfwxuR2ayNWsGQamR0jcjzRHgn6VP+9l0Li67IE W9VANZDTdpkFCEolnQrLHUKZbjAro7bkz0v4KCMFI+WPUzwjjxQiEaUe5wBImrh7j8ho lbAWxt197Fwlqvpk2/VNEcyryrHIf5pxyev7vSJCEYw0QA4PtbR7ct09iQYiX+9qDKL7 XSZjx0qcOfyxZRI/FD7Wl8uX8lHtU8m+eclgpNTbl60tcmHVmp2/NQXpVaOORFyUHGwU bkhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=NZOK8a2W9sac1dxmndh2Limie5/EXA+pcqQmcoT1slA=; b=ioCKYy17St6CYFVW0BZS2WjYMWHOZOD0CoeGb7qdGA7eqq5bBJFioxb+f3Pii7ztXg rnF3yIDk1Qhc9cc5eELWKTYSLHC8kE69OcoqvKIxlhkMgwtTCFfVK1K9PQF5ujpgV1Q5 k7k8zlAERsCFcXJEBiDd3Ihb+QFAghGIJ5PY2Eq0CVXra4PD3zipZOS01HJhxEaZoSeS tAi9Hocbx2YJGYswPw4OlWff6BswiVSS/ug6SAE30cfWpchHlWy6C8dVrqkl+GqjhRvF Itc6lbb8O9wc3CVRk8Rmfhe0VsUTbu2nZe/J0g9P1LYhc7RSGxwlvhjG+Z+Wd7PSZIX/ JqHw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si7936473plv.217.2018.04.30.12.28.36; Mon, 30 Apr 2018 12:28:50 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756337AbeD3T2c (ORCPT + 99 others); Mon, 30 Apr 2018 15:28:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:36174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756297AbeD3T21 (ORCPT ); Mon, 30 Apr 2018 15:28:27 -0400 Received: from localhost (unknown [104.132.1.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E01A822DBF; Mon, 30 Apr 2018 19:28:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E01A822DBF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Long Li , Ronnie Sahlberg , Steve French Subject: [PATCH 4.16 037/113] cifs: smbd: Dont use RDMA read/write when signing is used Date: Mon, 30 Apr 2018 12:24:08 -0700 Message-Id: <20180430184016.617700186@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184015.043892819@linuxfoundation.org> References: <20180430184015.043892819@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Long Li commit bb4c0419476bd3982ba802f0f49de83cd79532d8 upstream. SMB server will not sign data transferred through RDMA read/write. When signing is used, it's a good idea to have all the data signed. In this case, use RDMA send/recv for all data transfers. This will degrade performance as this is not generally configured in RDMA environemnt. So warn the user on signing and RDMA send/recv. Signed-off-by: Long Li Acked-by: Ronnie Sahlberg Cc: stable@vger.kernel.org Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/cifssmb.c | 3 +++ fs/cifs/smb2ops.c | 18 ++++++++++++++---- fs/cifs/smb2pdu.c | 4 ++-- 3 files changed, 19 insertions(+), 6 deletions(-) --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -453,6 +453,9 @@ cifs_enable_signing(struct TCP_Server_In server->sign = true; } + if (cifs_rdma_enabled(server) && server->sign) + cifs_dbg(VFS, "Signing is enabled, and RDMA read/write will be disabled"); + return 0; } --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -252,9 +252,14 @@ smb2_negotiate_wsize(struct cifs_tcon *t 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, + if (server->rdma) { + if (server->sign) + wsize = min_t(unsigned int, + wsize, server->smbd_conn->max_fragmented_send_size); + else + 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); @@ -272,9 +277,14 @@ smb2_negotiate_rsize(struct cifs_tcon *t 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, + if (server->rdma) { + if (server->sign) + rsize = min_t(unsigned int, + rsize, server->smbd_conn->max_fragmented_recv_size); + else + rsize = min_t(unsigned int, rsize, server->smbd_conn->max_readwrite_size); + } #endif if (!(server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU)) --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -2479,7 +2479,7 @@ smb2_new_read_req(void **buf, unsigned i * If we want to do a RDMA write, fill in and append * smbd_buffer_descriptor_v1 to the end of read request */ - if (server->rdma && rdata && + if (server->rdma && rdata && !server->sign && rdata->bytes >= server->smbd_conn->rdma_readwrite_threshold) { struct smbd_buffer_descriptor_v1 *v1; @@ -2857,7 +2857,7 @@ smb2_async_writev(struct cifs_writedata * If we want to do a server RDMA read, fill in and append * smbd_buffer_descriptor_v1 to the end of write request */ - if (server->rdma && wdata->bytes >= + if (server->rdma && !server->sign && wdata->bytes >= server->smbd_conn->rdma_readwrite_threshold) { struct smbd_buffer_descriptor_v1 *v1;