Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752594AbdHNUre (ORCPT ); Mon, 14 Aug 2017 16:47:34 -0400 Received: from mail-dm3nam03on0131.outbound.protection.outlook.com ([104.47.41.131]:7248 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752357AbdHNUrc (ORCPT ); Mon, 14 Aug 2017 16:47:32 -0400 From: Tom Talpey To: Long Li , Steve French , "linux-cifs@vger.kernel.org" , "samba-technical@lists.samba.org" , "linux-kernel@vger.kernel.org" Subject: RE: [[PATCH v1] 19/37] [CIFS] SMBD: Manage credits on SMBD client and server Thread-Topic: [[PATCH v1] 19/37] [CIFS] SMBD: Manage credits on SMBD client and server Thread-Index: AQHTC8vAaxzRp9uipk25vJ1YwAJ8RKKEZNsA Date: Mon, 14 Aug 2017 20:47:29 +0000 Message-ID: References: <1501704648-20159-1-git-send-email-longli@exchange.microsoft.com> <1501704648-20159-20-git-send-email-longli@exchange.microsoft.com> In-Reply-To: <1501704648-20159-20-git-send-email-longli@exchange.microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [24.218.182.144] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY4PR21MB0472;6:2HbFtLM1vd+XjmdQNM2zlTaY8dqlY84DgcgHwfjHWruOjRa8Ahx+fxeXAqG+FBTv+SqQQALJylLQmlLR3lm1IBbqz6P1amEto9UEcemdVDqw8fXDEgKPL9fndyd7n0DA4pLiSeYXfjvurrhHiI8b4Ckh08mU5IyuAsKOupUcBLgDM7DTAbTj854xE9ttz4yV5PnTCq5Gm3A/ZUS3r5zFuootOdN+tDsbaGuCmjUQ6ziEq6yl9KGLRHYhB7//HsLFV2l5x/3iL5dkc8j1kFwNW0DwSn7FdGHhdISOYnkGTieTCyVAz62XhTOr8YMu6AhuVlgzmLotHijDYaNqRO4K/Q==;5:GrsCp4jhKzGEj1fXDgiEGZAZQIYBEUPedrqx/ZBzHXkSOVxfB2xCSosGoIOpbBgR0RFQ3177sXZsEqzzRnXqsZvIQquMSshrxzdqEVSdWA4G3yvN/6R0WcrA5LipbyfmO9C7pzsS2m9ktvj/VwDS7w==;24:en05EGozTypL5fOb6oG3ZETco/C4c+3FP/uMC5A0uW2/WWPGLJV4/p404+yxirCqw8hBePG31zqarOzAl/MYoR9aOLW50hhzFDonRBtAsgo=;7:BCVf9r7PTcbHBnxN1qx28rFBgAGKugqjAION5TjQ31cvWK69ChjziNREzSMdutEeZCtkLejuMIK2FNXPL4pRol4iq1gBUw5hyUFnxCxYwLtEcML0D7DJECBsRKTovy1e4zNIi/w8Q64zLghU3KOKCrHczLO7x/f7YLa1TLGWiGeh1CsR63iZTIlv3UI3DVwU2QfkdYamv8ZQBkc9UQ2/WGale534FiomD764h4TFpP8= x-ms-office365-filtering-correlation-id: f761ba41-305c-40a2-1afb-08d4e355ae45 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(2017052603142)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY4PR21MB0472; x-ms-traffictypediagnostic: CY4PR21MB0472: authentication-results: spf=none (sender IP is ) smtp.mailfrom=ttalpey@microsoft.com; x-exchange-antispam-report-test: UriScan:(158342451672863)(89211679590171)(9452136761055); 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)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6055026)(61426038)(61427038)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123560025)(20161123558100)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR21MB0472;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR21MB0472; x-forefront-prvs: 039975700A x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(47760400005)(13464003)(199003)(189002)(377454003)(86612001)(14454004)(305945005)(86362001)(478600001)(7736002)(9686003)(106356001)(105586002)(33656002)(97736004)(2201001)(6506006)(74316002)(55016002)(25786009)(6436002)(7696004)(1511001)(10290500003)(53546010)(2501003)(66066001)(99286003)(8990500004)(50986999)(5660300001)(2950100002)(5005710100001)(8936002)(189998001)(101416001)(76176999)(54356999)(81156014)(81166006)(8676002)(2906002)(77096006)(3280700002)(229853002)(3846002)(3660700001)(6116002)(102836003)(10090500001)(6246003)(53936002)(68736007)(2900100001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR21MB0472;H:CY4PR21MB0182.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Aug 2017 20:47:29.9853 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0472 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 quoted-printable to 8bit by nfs id v7EKlbIC002843 Content-Length: 1165 Lines: 30 > -----Original Message----- > From: linux-cifs-owner@vger.kernel.org [mailto:linux-cifs- > owner@vger.kernel.org] On Behalf Of Long Li > Sent: Wednesday, August 2, 2017 4:11 PM > To: Steve French ; linux-cifs@vger.kernel.org; samba- > technical@lists.samba.org; linux-kernel@vger.kernel.org > Cc: Long Li > Subject: [[PATCH v1] 19/37] [CIFS] SMBD: Manage credits on SMBD client and > server > > /* > + * Extend the credits to remote peer > + * This implements [MS-SMBD] 3.1.5.9 > + * The idea is that we should extend credits to remote peer as quickly as > + * it's allowed, to maintain data flow. We allocate as much as receive > + * buffer as possible, and extend the receive credits to remote peer > + * return value: the new credtis being granted. > + */ > +static int manage_credits_prior_sending(struct cifs_rdma_info *info) > +{ > + int ret = 0; > + struct cifs_rdma_response *response; > + int rc; > + > + if (atomic_read(&info->receive_credit_target) > When does the receive_credit_target value change? It seems wasteful to perform an atomic_read() on this local value each time. Tom.