From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752500AbdHSXlx (ORCPT ); Sat, 19 Aug 2017 19:41:53 -0400 Received: from mail-cys01nam02on0111.outbound.protection.outlook.com ([104.47.37.111]:10688 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752444AbdHSXlv (ORCPT ); Sat, 19 Aug 2017 19:41:51 -0400 From: Long Li To: Tom Talpey , Steve French , "linux-cifs@vger.kernel.org" , "samba-technical@lists.samba.org" , "linux-kernel@vger.kernel.org" , "linux-rdma@vger.kernel.org" Subject: RE: [[PATCH v1] 18/37] [CIFS] SMBD: Implement API for upper layer to send data Thread-Topic: [[PATCH v1] 18/37] [CIFS] SMBD: Implement API for upper layer to send data Thread-Index: AQHTC8upaPAPpH+nEUu8Y+46XWD9J6KEZJsAgAgNKyA= Date: Sat, 19 Aug 2017 23:41:45 +0000 Message-ID: References: <1501704648-20159-1-git-send-email-longli@exchange.microsoft.com> <1501704648-20159-19-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-19T16:41:44.3758999-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;MWHPR21MB0701;6:+F6I/TEFMIfPDCBLJOhZi5M+ER+KRcspWEqLUX0X1yXMjNNCz1VIiH4t0OR/uRfVtawWDJulDQgylYt8ZyUfBW+fIuW1wGmEe9FeQXKLvRqxXJ4w0fBJcC/GRJSTHzR/Uxrg72H5q/uvi+VWKa1EtiJAU2pjb50jvfkWAl0wFned2/gj1bDsfbeTWAdWz8hMpOitWm/EBeIembr12sOh8Z9XgAAQbRJskJ4SLcX6RqUYHmtoeC1og33Vtmpgj9t7pWxSDcHfV1/x0+uoQ1OCuxT7hfZVNfAn/wcGj8pmBpba0geFNMPqQ2LG3UM3oWiLVuhqWmtTevz12EpW35MVjg==;5:x74tS691A1Dh9+P0YlyB1gHWtrgGxeRh6HyL/1bv0EPswD1Kjxsx8BK+c/AjRxGEMbSy8Dy54FvVq1A/N1y1xMKrwu7sjBp0OmWqPjwD+rQAwhGRJR295rC7UrFkHkEgsWl28ojbU41ki0XLhwANyQ==;24:V3Ol+NKpkbY3Y+YeNxObNuRZxPAxR7csSV77ZVE8IUXcNhtbP2VsTSRjWs1neUiMe9wk/7iX9YqsuKfVmicbc2xgwA8+M/RpaIuZMLf/j+w=;7:jgyDl75LRYvTP9+wSCGUA0jLihLRX0PPoM+EOlEFCFoGmJIpxaYon/Z8kUaoEtn3UuoukQRPri55YDRoPi7xCp3kOmuRMKw5Bscr55dz9O5rQuGSJGrxY9nEiUQUFEC/l7Bw5UrfQ0rZolc1ACV27YR78MaVjRIJOpJc9h8WZOdMjRu9giS3Qweo8TBMdgfbzxq5Ef7QFbp/BoeWcZIwblBKwRSyWHHXB5aB+uowpP8= x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(47760400005)(13464003)(377454003)(199003)(189002)(5005710100001)(102836003)(6116002)(14454004)(53936002)(25786009)(33656002)(74316002)(2561002)(86362001)(2900100001)(10090500001)(55016002)(478600001)(101416001)(2421001)(10290500003)(97736004)(5660300001)(2501003)(86612001)(9686003)(7696004)(8990500004)(105586002)(6436002)(189998001)(2950100002)(99286003)(106356001)(3280700002)(77096006)(68736007)(53546010)(305945005)(7736002)(3660700001)(81156014)(6506006)(8676002)(2201001)(81166006)(1511001)(2906002)(6246003)(229853002)(50986999)(76176999)(54356999)(8936002);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR21MB0701;H:MWHPR21MB0190.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; x-ms-office365-filtering-correlation-id: 6a58295a-c15f-411f-f82d-08d4e75bda7d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603157)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:MWHPR21MB0701; x-ms-traffictypediagnostic: MWHPR21MB0701: authentication-results: spf=none (sender IP is ) smtp.mailfrom=longli@microsoft.com; x-exchange-antispam-report-test: UriScan:(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)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(61426038)(61427038)(6041248)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR21MB0701;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR21MB0701; x-forefront-prvs: 04041A2886 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: 19 Aug 2017 23:41:45.9030 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0701 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 v7JNg0ul024714 > -----Original Message----- > From: Tom Talpey > Sent: Monday, August 14, 2017 1:44 PM > To: Long Li ; Steve French ; > linux-cifs@vger.kernel.org; samba-technical@lists.samba.org; linux- > kernel@vger.kernel.org; linux-rdma@vger.kernel.org > Subject: RE: [[PATCH v1] 18/37] [CIFS] SMBD: Implement API for upper layer > to send data > > > -----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:10 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] 18/37] [CIFS] SMBD: Implement API for upper layer > > to send data > > > > +/* > > + * Write data to transport > > + * Each rqst is transported as a SMBDirect payload > > + * rqst: the data to write > > + * return value: 0 if successfully write, otherwise error code */ > > +int cifs_rdma_write(struct cifs_rdma_info *info, struct smb_rqst > > +*rqst) { > > !!! > This is a VERY confusing name. It is not sending an RDMA Write, which will > confuse any RDMA-enlightened reader. It's performing an RDMA Send, so > that name is perhaps one possibility. > > > + if (info->transport_status != CIFS_RDMA_CONNECTED) { > > + log_cifs_write("disconnected returning -EIO\n"); > > + return -EIO; > > + } > > Isn't this optimizing the error case? There's no guarantee it's still connected > by the time the following request construction occurs. Why not just proceed > without the check? > > > + /* Strip the first 4 bytes MS-SMB2 section 2.1 > > + * they are used only for TCP transport */ > > + iov[0].iov_base = (char*)rqst->rq_iov[0].iov_base + 4; > > + iov[0].iov_len = rqst->rq_iov[0].iov_len - 4; > > + buflen += iov[0].iov_len; > > Ok, that layering choice in the cifs.ko client code needs to be corrected. After > all, it will need to be RDMA-aware to build the SMB3 read/write channel > structures. > And, the code in cifs_post_send_data() is allocating and building a structure > that could have been accounted for much earlier, avoiding the extra > overhead. > > That change could happen later, the hack is mostly ok for now. But > something needs to be said in a comment. Will address those in v2. > > Tom.