Received: by 10.223.164.197 with SMTP id h5csp684981wrb; Sat, 4 Nov 2017 22:47:57 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SLy+tQOblTUPj97EDfTbxWvFabzwQ7d9RV2HY+MClz/jXY8F/Yf6CSwZH+RHBZbzVE1ZSY X-Received: by 10.159.229.136 with SMTP id az8mr11031282plb.133.1509860877208; Sat, 04 Nov 2017 22:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509860877; cv=none; d=google.com; s=arc-20160816; b=0gnk74FqiI+RYvhEHggyNg/QeC1HJruvg7G6bdrcygchYOMmN3xc7ZCPY5ZR4dj6mR mRr4URrBX3g9pbKbsIQtIBEPxyaHqQAPS16U7cPfORjnqkPJ7fzkhmEPqWQAG2pKIuWL 4BZ58pTe0p4K8kw6U5Ar1qcdJPdmmS/uyZ6nN1w9vOONH9ZAp9/82sJPB/aG/uy/EgAc eg/PkXg1A194LMn+HnEEaiimOtL9ZyYCZvXho9ohFhQro7RqmsXGx2KxVADWqWjCvi+q 23/QF9Qg9cb3kKZeybAG8bdBCOZB/QGatO5ZoLjYTiLWSdhGFsSSFyUGPWfxkTLd5gKu FX2Q== 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=rKwEJovwguHkAKJ04vgVi8n3ZKNYBM6eNn2sZSwQ/sU=; b=02LaD4XABeiCAThlK5pSRDoeLQN3Bc+9hHtrrdaZcVT/oxHNhEbMTGmZJ6eAfujE0I fRyRLcIRoFq3pNsVe/UVuPee2yOyBx4by76cy8m256b73p2LUNP7QIE5QQkNowvkOmuY 78KA0LJuTreSY7y3gUeot/zDOGRBYSyjNh3XIaar9/4dgifcALg0uW5I/3FhSGRghClv m545l1i2wwQrlaI7+/PhqTsMszA6um6553UxZXvKga7dVbWZy7osiLoKDw8WfLaUAUwu pk/dZ9B07qHa6tPYNjwxOHxp1gal0WbTg4uCoPraGMBCQ3WwM8Hf38RurYGWcX1RS3dx Y3gA== 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 7si9137835pgd.489.2017.11.04.22.47.43; Sat, 04 Nov 2017 22:47:57 -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 S1752752AbdKEFqf (ORCPT + 96 others); Sun, 5 Nov 2017 01:46:35 -0400 Received: from a2nlsmtp01-05.prod.iad2.secureserver.net ([198.71.225.49]:50200 "EHLO a2nlsmtp01-05.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751077AbdKEFpy (ORCPT ); Sun, 5 Nov 2017 01:45:54 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id BDjUeq3nL3w7hBDjUeBCbT; 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-0006EW-6Q; 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 06/22] CIFS: SMBD: export protocol initial values Date: Sat, 4 Nov 2017 22:43:48 -0700 Message-Id: <20171105054404.23886-7-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: MS4wfAs4bO0gwNscWK+8c2qxIwmVjyr3uZIRVImVYe8j4W6HXUQcqlSQbP7z26l7+J6bEcE3pev+jrQTqkMPapB0UvEKhVCEiSUJDP8of+PuwJIaPSIy8WmG fXy4Mob02Xm7o3NzEJHmlPjBkFv+t/C6EdFw8wdlaKmOWnDVYtoKgjEns7Hk3Hk/WsW2tiJO7v6iWXccF6BD9c/CXsG2DMleeHfAuhHByH0CQWx5GWcDovMX iOH78/w4wxuhVU4hmjK0GEbkDi/W8tY23kdJt2nZhonHznL+sRfuld09vNT0AZywXZJXK5F9wn/aF8JPzk7JuigUFGdF/hJedRioOGtzYDei0xZoSn95gFt7 7/XTVhijqeuUvcASvhlXiq4jdsMvZJp8V/U7QhThK4NK4GoaHmtD1RkqvSnN49qgTX+Xhtw57b4jaTgBROANuEvlXytzuz+xfv5f9iIZ7gkJyGN0fV5xjQnM mQUoluAX1IzBRPv9yoe2WW4x5qEV/ClAisOezA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Long Li For use-configurable SMB Direct protocol values, export them to /proc/fs/cifs. Signed-off-by: Long Li --- fs/cifs/cifs_debug.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index ba0870d..7025d8d 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c @@ -30,6 +30,9 @@ #include "cifsproto.h" #include "cifs_debug.h" #include "cifsfs.h" +#ifdef CONFIG_CIFS_SMB_DIRECT +#include "smbdirect.h" +#endif void cifs_dump_mem(char *label, void *data, int length) @@ -371,6 +374,54 @@ static const struct file_operations cifs_stats_proc_fops = { }; #endif /* STATS */ +#ifdef CONFIG_CIFS_SMB_DIRECT +#define PROC_FILE_DEFINE(name) \ +static ssize_t name##_write(struct file *file, const char __user *buffer, \ + size_t count, loff_t *ppos) \ +{ \ + int rc; \ + rc = kstrtoint_from_user(buffer, count, 10, & name ); \ + if (rc) \ + return rc; \ + return count; \ +} \ +static int name##_proc_show(struct seq_file *m, void *v) \ +{ \ + seq_printf(m, "%d\n", name ); \ + return 0; \ +} \ +static int name##_open(struct inode *inode, struct file *file) \ +{ \ + return single_open(file, name##_proc_show, NULL); \ +} \ +\ +static const struct file_operations cifs_##name##_proc_fops = { \ + .open = name##_open, \ + .read = seq_read, \ + .llseek = seq_lseek, \ + .release = single_release, \ + .write = name##_write, \ +} + +extern int rdma_readwrite_threshold; +extern int smbd_max_frmr_depth; +extern int smbd_keep_alive_interval; +extern int smbd_max_receive_size; +extern int smbd_max_fragmented_recv_size; +extern int smbd_max_send_size; +extern int smbd_send_credit_target; +extern int smbd_receive_credit_max; + +PROC_FILE_DEFINE(rdma_readwrite_threshold); +PROC_FILE_DEFINE(smbd_max_frmr_depth); +PROC_FILE_DEFINE(smbd_keep_alive_interval); +PROC_FILE_DEFINE(smbd_max_receive_size); +PROC_FILE_DEFINE(smbd_max_fragmented_recv_size); +PROC_FILE_DEFINE(smbd_max_send_size); +PROC_FILE_DEFINE(smbd_send_credit_target); +PROC_FILE_DEFINE(smbd_receive_credit_max); +#endif + static struct proc_dir_entry *proc_fs_cifs; static const struct file_operations cifsFYI_proc_fops; static const struct file_operations cifs_lookup_cache_proc_fops; @@ -398,6 +449,24 @@ cifs_proc_init(void) &cifs_security_flags_proc_fops); proc_create("LookupCacheEnabled", 0, proc_fs_cifs, &cifs_lookup_cache_proc_fops); +#ifdef CONFIG_CIFS_SMB_DIRECT + proc_create("rdma_readwrite_threshold", 0, proc_fs_cifs, + &cifs_rdma_readwrite_threshold_proc_fops); + proc_create("smbd_max_frmr_depth", 0, proc_fs_cifs, + &cifs_smbd_max_frmr_depth_proc_fops); + proc_create("smbd_keep_alive_interval", 0, proc_fs_cifs, + &cifs_smbd_keep_alive_interval_proc_fops); + proc_create("smbd_max_receive_size", 0, proc_fs_cifs, + &cifs_smbd_max_receive_size_proc_fops); + proc_create("smbd_max_fragmented_recv_size", 0, proc_fs_cifs, + &cifs_smbd_max_fragmented_recv_size_proc_fops); + proc_create("smbd_max_send_size", 0, proc_fs_cifs, + &cifs_smbd_max_send_size_proc_fops); + proc_create("smbd_send_credit_target", 0, proc_fs_cifs, + &cifs_smbd_send_credit_target_proc_fops); + proc_create("smbd_receive_credit_max", 0, proc_fs_cifs, + &cifs_smbd_receive_credit_max_proc_fops); +#endif } void @@ -415,6 +484,16 @@ cifs_proc_clean(void) remove_proc_entry("SecurityFlags", proc_fs_cifs); remove_proc_entry("LinuxExtensionsEnabled", proc_fs_cifs); remove_proc_entry("LookupCacheEnabled", proc_fs_cifs); +#ifdef CONFIG_CIFS_SMB_DIRECT + remove_proc_entry("rdma_readwrite_threshold", proc_fs_cifs); + remove_proc_entry("smbd_max_frmr_depth", proc_fs_cifs); + remove_proc_entry("smbd_keep_alive_interval", proc_fs_cifs); + remove_proc_entry("smbd_max_receive_size", proc_fs_cifs); + remove_proc_entry("smbd_max_fragmented_recv_size", proc_fs_cifs); + remove_proc_entry("smbd_max_send_size", proc_fs_cifs); + remove_proc_entry("smbd_send_credit_target", proc_fs_cifs); + remove_proc_entry("smbd_receive_credit_max", proc_fs_cifs); +#endif remove_proc_entry("fs/cifs", NULL); } -- 2.7.4 From 1583289414985382165@xxx Mon Nov 06 04:27:30 +0000 2017 X-GM-THRID: 1583289414985382165 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread