Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752437AbdHNUok (ORCPT ); Mon, 14 Aug 2017 16:44:40 -0400 Received: from mail-co1nam03on0107.outbound.protection.outlook.com ([104.47.40.107]:52128 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752031AbdHNUoi (ORCPT ); Mon, 14 Aug 2017 16:44:38 -0400 From: Tom Talpey 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 Thread-Topic: [[PATCH v1] 18/37] [CIFS] SMBD: Implement API for upper layer to send data Thread-Index: AQHTC8xzKNs4k0d9aEewq2gj+iYcu6KEYFHw Date: Mon, 14 Aug 2017 20:44:18 +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: <1501704648-20159-19-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;CY4PR21MB0629;6:jrfWDpu5ESGt9FtJ/3/2zbjFWRvi4fZsvDXR2bmeGiedyzQnOh+MG886HEmDko3bMWi6dkK98WaDeRCumYJH03r1anGB3viTF/QbB6rz36nys5fQJzEPKXzjzJ9vIBuz+vAza0vFinBmLlZUj+kBkW/6t6OE0Egw/uqCDVEZO8iOxyxEnjQM4y370hAhJdRYTdN5Ugln+pDbX7THsVWzRL3drQ2jURhqPG9UpHZ1hzwYrYG4t6MGS+3ZmRYgScg6UMG8vSW0usEZCi2s5+agQerGtCOGtoSaANGpasEPAuHaFlaY0Du3NsdSCgdlTbtIoPJSfjE7kWJKNuh/OINQvw==;5:vzLPFKYPIKpX7BHcGXLOM3GnDi6IVR7CrfSo9J6hTOjGu3D31UUX714LzuYrkcp+QiZ6+IM4bqXornYrhZBggRS7ndCfc240+cYSNqoxIat6DcYdrQs/4Qt2IEhf05jrNBmPU4Sak7tGajL9pghabw==;24:bdiQoLsLacAPZ/ssgppBLOiab8wFzhOLcOxSDsIUkF/9BF2opMSLz3gC0iNtqBDDCQ1Cn4ggE/PyFN8ojNHFISi43Tm3rU8s0eC7lhW4Ups=;7:8WZGO7sRpriS8PzyQ6lfy5tNvMEsldqK2SXdX42Bh1wi7yMB7Or4Velf9EKSUM9KTb7tJu0LX5w2EH8PRYctQzOQROcnlBeUMixFAZtjnFncgzsGNBeJ2BZ3/5Vaya7zMIF8qHcMs0pkC9np8FGZyOtjcO2wazhv6Ws+F1v45UQvanu1E2Z03SLnZpybBoJo3p3B+19SyEKrFKZjEhCehPrOC2b+a+Ttmh7IqNJ0Ghc= x-ms-office365-filtering-correlation-id: c9437644-523c-479c-b1b6-08d4e3554655 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)(2017052603142)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY4PR21MB0629; x-ms-traffictypediagnostic: CY4PR21MB0629: authentication-results: spf=none (sender IP is ) smtp.mailfrom=ttalpey@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)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR21MB0629;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR21MB0629; x-forefront-prvs: 039975700A x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(47760400005)(199003)(377454003)(13464003)(189002)(55016002)(76176999)(9686003)(54356999)(229853002)(77096006)(66066001)(86612001)(6116002)(74316002)(102836003)(6506006)(1511001)(99286003)(86362001)(101416001)(50986999)(3280700002)(305945005)(106356001)(3660700001)(68736007)(105586002)(7736002)(8676002)(2906002)(6436002)(81166006)(7696004)(81156014)(2900100001)(97736004)(2501003)(8990500004)(5005710100001)(5660300001)(10290500003)(3846002)(2201001)(33656002)(10090500001)(53546010)(478600001)(14454004)(189998001)(25786009)(6246003)(8936002)(53936002)(2950100002)(6666003);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR21MB0629;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:44:18.6423 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0629 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 v7EKihOn031810 Content-Length: 1958 Lines: 48 > -----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. Tom.