From patchwork Wed Aug 2 20:10:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 9877649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9FB00604D9 for ; Wed, 2 Aug 2017 20:24:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92590286BB for ; Wed, 2 Aug 2017 20:24:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87742287A8; Wed, 2 Aug 2017 20:24:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3657028801 for ; Wed, 2 Aug 2017 20:24:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752116AbdHBUX1 (ORCPT ); Wed, 2 Aug 2017 16:23:27 -0400 Received: from a2nlsmtp01-05.prod.iad2.secureserver.net ([198.71.225.49]:47956 "EHLO a2nlsmtp01-05.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752597AbdHBUMP (ORCPT ); Wed, 2 Aug 2017 16:12:15 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id czz8d3W1080gSczz8dCUXN; Wed, 02 Aug 2017 13:11:14 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1dczz8-0005G4-R2; Wed, 02 Aug 2017 13:11:14 -0700 From: Long Li To: Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org Cc: Long Li Subject: [[PATCH v1] 04/37] [CIFS] SMBD: Define per-channel SMBD transport parameters and default values Date: Wed, 2 Aug 2017 13:10:15 -0700 Message-Id: <1501704648-20159-5-git-send-email-longli@exchange.microsoft.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1501704648-20159-1-git-send-email-longli@exchange.microsoft.com> References: <1501704648-20159-1-git-send-email-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfJU8QLF3gwLpQNs1GcHW/ko/m7J1cT34sxFPMfYOoga4PIc/tgsZerPQxuyaXzQBs5Gzp7RXs2zlO2vAOcsTTLmg2u6bAHtjaBo+VitJwpqYau8sOsqX vCv0tZCXlbeGRQvxYOVXe45l9leHrn8imtVaDKMAacdLvgEj54Zw3Nm0n/hmNh6ZqTzr2vceJMDcvuX8O7GfQO5Sf/FAaTdsbYkWZRCQhhE6O6OviFpBTbgj Q7/w4FVPdcD7U6nyprbHwbjgGYPXN5nISlZnv/AQwFCOjfCWT3NKhWto4DBYZJQh0lEdFiJNeKlvFUX47xu2PNFYXKsohTkKCI4OWFi4Z/E= Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Long Li For each channel, SMBD defines per-channel parameters. Those can be negotiated with the server, and are restricted by RDMA hardware limitations. Signed-off-by: Long Li --- fs/cifs/cifsrdma.c | 14 ++++++++++++++ fs/cifs/cifsrdma.h | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/fs/cifs/cifsrdma.c b/fs/cifs/cifsrdma.c index 3c9f478..7c4c178 100644 --- a/fs/cifs/cifsrdma.c +++ b/fs/cifs/cifsrdma.c @@ -54,6 +54,20 @@ #include "cifsrdma.h" +/* + * Per RDMA transport connection parameters + * as defined in [MS-SMBD] 3.1.1.1 + */ +static int receive_credit_max = 512; +static int send_credit_target = 512; +static int max_send_size = 8192; +static int max_fragmented_recv_size = 1024*1024; +static int max_receive_size = 8192; + +// maximum number of SGEs in a RDMA I/O +static int max_send_sge = 16; +static int max_recv_sge = 16; + /* Logging functions * Logging are defined as classes. They can be ORed to define the actual * logging level via module parameter rdma_logging_class diff --git a/fs/cifs/cifsrdma.h b/fs/cifs/cifsrdma.h index ec6aa61..9979fd4 100644 --- a/fs/cifs/cifsrdma.h +++ b/fs/cifs/cifsrdma.h @@ -36,6 +36,19 @@ struct cifs_rdma_info { struct TCP_Server_Info *server_info; + //connection paramters + int receive_credit_max; + int send_credit_target; + int max_send_size; + int max_fragmented_recv_size; + int max_fragmented_send_size; + int max_receive_size; + int max_readwrite_size; + int protocol; + atomic_t send_credits; + atomic_t receive_credits; + atomic_t receive_credit_target; + // for debug purposes unsigned int count_receive_buffer; unsigned int count_get_receive_buffer;