Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752749AbdHNXEL (ORCPT ); Mon, 14 Aug 2017 19:04:11 -0400 Received: from mail-bn3nam01on0122.outbound.protection.outlook.com ([104.47.33.122]:55328 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752643AbdHNXEJ (ORCPT ); Mon, 14 Aug 2017 19:04:09 -0400 From: Long Li To: Tom Talpey , 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: AQHTC8uq06ewhGGyXEuklt/DHvwUcKKEZX6AgAAkqhA= Date: Mon, 14 Aug 2017 23:03:42 +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: 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-14T16:03:41.2877588-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:2::735] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY4PR21MB0181;6:kUW8hTsKetj3omxJuQSk/89p+G3H8kQ1//o1KDTBvdyBZRueluzwMynphbvJuuESglxZ4xY60K++gFl6YQmJ7jsE7b00XmO5l3NCStgZ/Di5mzMDBwHsN9/rhZpBWkVgnwUfSKzolvhUh2z9lMbRYYP/5+EVRhIuLrP7Qj9S1oNXhJkyUKPVR7H7O0aQUeewwrIfEdroFOv/R2yWnEfzVy1/4biSZb0hu34e9S2ts2k1NGSV+OFgTb74dMkpCegpKNWXvB/nO1Jm8er6SYO0/MmkoEbmIvow9BP6Z7/EnZyx2/mC1Hyt0AqL7M3Kbfk7C2KJZRkF2AmNR5CrERs6fQ==;5:JYYXfjqfmPicLkTi98lQ6vaoIMvSiTMlt6GgqmxWv6WVJJD+WYKTp7adXD8drzwf6qnmDUTtqldtsqc4i9Z3IzGBeu2UX/dlci4zm2n2Q1nlZ6jLPp2emH0BeAJs2ZaVqHCd3c+DT051LBFmbc/b6w==;24:QK34jMrgnQvu9eNZtJFzxBp5iQwlEEr8oZs23DLIkMVyT7GIffti/jIF650apTTlOcPj/hdU/Cnd2B9+nOUUjWNQoa5MQBJTuUp9/98/AyY=;7:hTSSGGZJd89if8a5lQSOuRQTKyeSdx9kwzc6fXqUkQhdMs+qpQtTdGXw517W0oZPJ/iZru6bLo9CuA+0R2VT5Z8qrwb/M4PqBm8xH5KYbGhLOcGZgZrYv2vxm/x7ah4QsX83w30bXeGlhE7Rmof8A6rQjS8qaumZaQYBt+EgLkZT2yXfmwZB+zBvPi+JYP0TaO0pCwpZoRAT4wD5QGU6MoQH/t6Hm6ywyjq6Ohm3K5o= x-ms-office365-filtering-correlation-id: 76992826-90c2-4621-fce4-08d4e368b5a8 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)(2017052603143)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY4PR21MB0181; x-ms-traffictypediagnostic: CY4PR21MB0181: 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)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6055026)(61426038)(61427038)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR21MB0181;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR21MB0181; x-forefront-prvs: 039975700A x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(47760400005)(189002)(199003)(377454003)(13464003)(99286003)(305945005)(55016002)(10090500001)(8990500004)(8676002)(2906002)(81156014)(5005710100001)(81166006)(7736002)(54356999)(76176999)(50986999)(33656002)(6436002)(5660300001)(2501003)(2900100001)(101416001)(25786009)(229853002)(8936002)(2421001)(14454004)(6246003)(189998001)(478600001)(1511001)(53936002)(2950100002)(102836003)(6116002)(105586002)(68736007)(97736004)(53546010)(106356001)(86362001)(3280700002)(74316002)(86612001)(3660700001)(6506006)(77096006)(10290500003)(2561002)(2201001)(7696004)(9686003);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR21MB0181;H:CY4PR21MB0182.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A: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="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Aug 2017 23:03:42.8531 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0181 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 v7EN4I94010534 Content-Length: 1811 Lines: 48 > -----Original Message----- > From: Tom Talpey > Sent: Monday, August 14, 2017 1:47 PM > 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 > > > -----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. It could be potentially changed while receiving a SMBD packet, as specified in MS-SMBD 3.1.5.8. I agree with you there is no need to use atomic since this value is not increased or decreased, just being set. Will change it. > > Tom.