Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751713AbdH2XBE (ORCPT ); Tue, 29 Aug 2017 19:01:04 -0400 Received: from mail-sn1nam01on0107.outbound.protection.outlook.com ([104.47.32.107]:53323 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751272AbdH2XBA (ORCPT ); Tue, 29 Aug 2017 19:01:00 -0400 From: Long Li To: Pavel Shilovsky CC: Steve French , linux-cifs , samba-technical , Kernel Mailing List , "linux-rdma@vger.kernel.org" , Christoph Hellwig , "Tom Talpey" , Matthew Wilcox Subject: RE: [Patch v3 02/19] CIFS: SMBD: Add SMBDirect protocol and transport constants Thread-Topic: [Patch v3 02/19] CIFS: SMBD: Add SMBDirect protocol and transport constants Thread-Index: AQHTIP1QFsiLue4xdECU8T7UMl1K9aKb7uiAgAADaFA= Date: Tue, 29 Aug 2017 23:00:58 +0000 Message-ID: References: <20170829192915.26251-1-longli@exchange.microsoft.com> <20170829192915.26251-3-longli@exchange.microsoft.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Ref=https://api.informationprotection.azure.com/api/72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=longli@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2017-08-29T16:00:56.7280444-07:00; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General x-originating-ip: [2001:4898:80e8:c::735] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR21MB0797;6:r6Q7f3PhJ4CFyllb0xkYlGokKTO3cYFfWyoCOL/cShgNzJ90TqjNQmbCf8tX8g99B8hHmSLfWVeRBrnGf8cZj+8mwPn6JNEA168urU8wI5sVBQOyl3sFjAvDKMtcAMUuBZOQNFLRd4KCpKRcB/wrAmlw5gYqo+AcnnJcNPU28XH3wOY7EJU0jZ5NQdeKu4V+HXIqPMyx04B2oedpCj6AqBFvIG19USCvkV9ZeFCC1d8cRNaRTWxcUtzF7W2DRM8AIkhaFx252TIKpZAuU4fz1D1KMwYMljIHWP+FsXC/fbaxtGgFAba8ZY3eenUo1v0llxHJZAtcotMlr2g98VDZPw==;5:5s8ATPeJxCCE+AewPx2eEcvATL1C67J76g5Ha7GQm7urtnhmrCOETFq9ILBLxT3Q8/rF6I9DlbrN3srn2RGwH36TODK///2roCuL3aYRqEnY8HzUIBNty/AiE2siDv5oJ2++AFSHBYTwearr4wtD/w==;24:ceTfPt6WbpMMfCt8wrbmmqfYJoQ9qqNz79sGu0RuWnVS7wuNwzvVVec939QfzmZSPVVjxOl7qPCm/RfRie7RZtdilp9LFVT2NhohSNEkleI=;7:h/PiURkSW1GQpRLzZTY37Cfvgfjdrs2JfDT46GpNM5uBKpCqtiGzuqW+sFzcSYie+1JdcxXVx3ECHGLWxXjQ3aCVQIPb7T5/AqnBYuuULu95eDbXOOL3HnHsrurkC1P3eIHIVC45cmeLX+gdDdTeDKsWroRaNTVKWOyunz8rDjP7AbxK5wikqppyzcKBnueH+d+uJniVOnQu6PKmecYqxs3/yDblmp7cM/KuSeC1Drk= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: bd39c152-c0ff-4fc5-6246-08d4ef31cfb7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:MWHPR21MB0797; x-ms-traffictypediagnostic: MWHPR21MB0797: x-exchange-antispam-report-test: UriScan:(89211679590171)(9452136761055)(189930954265078)(140211028294663)(219752817060721)(17755550239193); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(61425038)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(61426038)(61427038)(6041248)(20161123558100)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR21MB0797;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR21MB0797; x-forefront-prvs: 0414DF926F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(47760400005)(199003)(377424004)(377454003)(189002)(13464003)(54356999)(53546010)(107886003)(110136004)(101416001)(39060400002)(6246003)(33656002)(53936002)(99286003)(55016002)(54906002)(9686003)(8936002)(6306002)(77096006)(3660700001)(6436002)(6506006)(76176999)(50986999)(966005)(2900100001)(229853002)(81166006)(102836003)(6116002)(81156014)(8676002)(106356001)(68736007)(105586002)(2950100002)(6916009)(8990500004)(14454004)(10090500001)(7736002)(5005710100001)(305945005)(74316002)(5660300001)(4326008)(2906002)(575784001)(86362001)(86612001)(25786009)(97736004)(189998001)(10290500003)(478600001)(1411001)(3280700002)(7696004)(2004002);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR21MB0797;H:MWHPR21MB0190.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; authentication-results: spf=none (sender IP is ) smtp.mailfrom=longli@microsoft.com; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Aug 2017 23:00:58.0764 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0797 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id v7TN18EA022740 Content-Length: 6664 Lines: 173 > -----Original Message----- > From: Pavel Shilovsky [mailto:piastryyy@gmail.com] > Sent: Tuesday, August 29, 2017 3:45 PM > To: Long Li > Cc: Steve French ; linux-cifs cifs@vger.kernel.org>; samba-technical ; > Kernel Mailing List ; linux- > rdma@vger.kernel.org; Christoph Hellwig ; Tom Talpey > ; Matthew Wilcox ; > Long Li > Subject: Re: [Patch v3 02/19] CIFS: SMBD: Add SMBDirect protocol and > transport constants > > 2017-08-29 12:28 GMT-07:00 Long Li : > > From: Long Li > > > > To prepare for protocol implementation, add constants and > > user-configurable values in the SMBDirect protocol. > > > > Signed-off-by: Long Li > > --- > > fs/cifs/smbdirect.c | 78 > > +++++++++++++++++++++++++++++++++++++++++++++++++++++ > > fs/cifs/smbdirect.h | 20 ++++++++++++++ > > 2 files changed, 98 insertions(+) > > create mode 100644 fs/cifs/smbdirect.c create mode 100644 > > fs/cifs/smbdirect.h > > > > diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c new file mode > > 100644 index 0000000..d785bc1 > > --- /dev/null > > +++ b/fs/cifs/smbdirect.c > > @@ -0,0 +1,78 @@ > > +/* > > + * Copyright (C) 2017, Microsoft Corporation. > > + * > > + * Author(s): Long Li > > + * > > + * This program is free software; you can redistribute it and/or modify > > + * it under the terms of the GNU General Public License as published by > > + * the Free Software Foundation; either version 2 of the License, or > > + * (at your option) any later version. > > + * > > + * This program is distributed in the hope that it will be useful, > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See > > + * the GNU General Public License for more details. > > + */ > > +#include > > +#include "smbdirect.h" > > +#include "cifs_debug.h" > > + > > +/* SMBD version number */ > > +#define SMBD_V1 0x0100 > > + > > +/* Port numbers for SMBD transport */ > > +#define SMB_PORT 445 > > +#define SMBD_PORT 5445 > > + > > +/* Address lookup and resolve timeout in ms */ > > +#define RDMA_RESOLVE_TIMEOUT 5000 > > + > > +/* SMBD negotiation timeout in seconds */ #define > > +SMBD_NEGOTIATE_TIMEOUT 120 > > + > > +/* SMBD minimum receive size and fragmented sized defined in [MS- > SMBD] */ > > +#define SMBD_MIN_RECEIVE_SIZE 128 > > +#define SMBD_MIN_FRAGMENTED_SIZE 131072 > > + > > +/* > > + * Default maximum number of RDMA read/write outstanding on this > > +connection > > + * This value is possibly decreased during QP creation on hardware > > +limit */ > > +#define SMBD_CM_RESPONDER_RESOURCES 32 > > + > > +/* Maximum number of retries on data transfer operations */ > > +#define SMBD_CM_RETRY 6 > > +/* No need to retry on Receiver Not Ready since SMBD manages credits > */ > > +#define SMBD_CM_RNR_RETRY 0 > > + > > +/* > > + * User configurable initial values per SMBD transport connection > > + * as defined in [MS-SMBD] 3.1.1.1 > > + * Those may change after a SMBD negotiation */ > > Since these value are per transport connection, why they are global? > Shouldn't they be inside a some structure that is created for a particular > connection? Also the constants below should be defines. Those are configurable initial values (default values) for all connections. Each connection has its own values based on those initial values. But connection-based values can change after negotiation is done, or after RDMA hardware capabilities are probed. > > > +/* The local peer's maximum number of credits to grant to the peer */ > > +static int receive_credit_max = 255; > > +/* The remote peer's credit request of local peer */ static int > > +send_credit_target = 255; > > +/* The maximum single message size can be sent to remote peer */ > > +static int max_send_size = 1364; > > +/* The maximum fragmented upper-layer payload receive size supported > > +*/ static int max_fragmented_recv_size = 1024 * 1024; > > +/* The maximum single-message size which can be received */ static > > +int max_receive_size = 8192; > > + > > +/* The timeout to initiate send of a keepalive message on idle */ > > +static int keep_alive_interval = 120; > > + > > +/* > > + * User configurable initial values for RDMA transport > > + * The actual values used may be lower and are limited to hardware > > +capabilities */ > > +/* Default maximum number of SGEs in a RDMA send/recv */ static int > > +max_send_sge = SMBDIRECT_MAX_SGE; static int max_recv_sge = > > +SMBDIRECT_MAX_SGE; > > +/* Default maximum number of SGEs in a RDMA write/read */ static int > > +max_frmr_depth = 2048; > > + > > +/* If payload is less than this byte, use RDMA send/recv not > > +read/write */ static int rdma_readwrite_threshold = 4096; > > diff --git a/fs/cifs/smbdirect.h b/fs/cifs/smbdirect.h new file mode > > 100644 index 0000000..06eeb0b > > --- /dev/null > > +++ b/fs/cifs/smbdirect.h > > @@ -0,0 +1,20 @@ > > +/* > > + * Copyright (C) 2017, Microsoft Corporation. > > + * > > + * Author(s): Long Li > > + * > > + * This program is free software; you can redistribute it and/or modify > > + * it under the terms of the GNU General Public License as published by > > + * the Free Software Foundation; either version 2 of the License, or > > + * (at your option) any later version. > > + * > > + * This program is distributed in the hope that it will be useful, > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See > > + * the GNU General Public License for more details. > > + */ > > +#ifndef _SMBDIRECT_H > > +#define _SMBDIRECT_H > > + > > +#define SMBDIRECT_MAX_SGE 16 > > +#endif > > -- > > 2.7.4 > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-cifs" > > in the body of a message to majordomo@vger.kernel.org More > majordomo > > info at > > > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvger.k > > ernel.org%2Fmajordomo- > info.html&data=02%7C01%7Clongli%40microsoft.com% > > > 7C048aaa90c05748ee36a808d4ef2f9564%7C72f988bf86f141af91ab2d7cd011d > b47% > > > 7C1%7C0%7C636396435035660594&sdata=qdY4CwjZ74W7AdqTVklpo8XlWFI6 > fxZ9y3i > > fPyPQ%2Fcg%3D&reserved=0 > > > > -- > Best regards, > Pavel Shilovsky