Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752814AbdHNXMk (ORCPT ); Mon, 14 Aug 2017 19:12:40 -0400 Received: from mail-sn1nam01on0127.outbound.protection.outlook.com ([104.47.32.127]:59484 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752654AbdHNXMi (ORCPT ); Mon, 14 Aug 2017 19:12:38 -0400 From: Tom Talpey To: Long Li , Christoph Hellwig CC: Steve French , "linux-cifs@vger.kernel.org" , "samba-technical@lists.samba.org" , "linux-kernel@vger.kernel.org" Subject: RE: [[PATCH v1] 16/37] [CIFS] SMBD: Post a SMBD message with no payload Thread-Topic: [[PATCH v1] 16/37] [CIFS] SMBD: Post a SMBD message with no payload Thread-Index: AQHTC8xrFejxcMpowkO5mAEbLNswiqKCJQMAgAIXTACAAAnaYIAAQdqAgAAEH+A= Date: Mon, 14 Aug 2017 23:12:31 +0000 Message-ID: References: <1501704648-20159-1-git-send-email-longli@exchange.microsoft.com> <1501704648-20159-17-git-send-email-longli@exchange.microsoft.com> <20170813102412.GH17287@infradead.org> In-Reply-To: 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;CY4PR21MB0119;6:Kbh9rUeCxlh5OcVcEVij62iLHKBsl0wrg+z9bFfzpf86c0BR2KHc1Mces1b+e/MZDg+QqgGBfeUT1/Vlg2+z6kB3t3/p/0rQ7y82rb/HOyArTsZTagpOR+G17RcynKYcoQWnyQchV5l4D7s198tA7sZE5K51JwqRHQ94NnbublqH+gUo8iM3n51n2L/TsaNag6aBmQ10fyfrG/Mbn0OCDRaeXgIQ4xsOzGqtapmuaBFCPqa7/qdKkhgFz//CRPeXBdImcB0KYcbLMCC9LrdTNzkhBUPJypHUPyyOzaP0v0agKP0oAtrHNuCO3aojJwqdsnGQswEgzcgY8e06lAF2QQ==;5:t6yOkogUPP/1etEnVqId1dzn3vuAEMzBFXJ5Ls2nXKv+gjymWJmwa567MmYUPj2QzmhA2sWWFd4TK2MpDvLrFP0UwkSbcs4/QjVKmbBpejaTw/knm6a17LuMM/EzDSb0JMiuWZHk5UOZwc/VZ7I8lA==;24:IB8xnyUCsLwqKeupPlYpNBUFZluFz429uwJ8i7wPQIrt54HVguZV4rXLxqgYEUkQdqe+cA9Tl3PN4nDDVQUFGuRO0QcGJsAzCQ6ZGi2Cfwo=;7:9QFiPxXUmBLBM2jIKS4G/8ESXIlbNBNcfrGoFDZJ96jP/JVwh0dl4YX4CMcfdNGdBFD/Rb8/zYoeYBLCDY5QeztN7nyu1CJgIuipBNi+nzJQnY+Kd9Ns3i9eOGGSaLA2l2dj6XymjRDXbZXUpx1iC2igLz/vL/aGjAe6cjvr8SCzNFaIKx8lGJIptWgG8pCHCAIGoTCqF6k5FGa6o8W0Qu5N7gmM6FXYO1jjFqpy/8M= x-ms-office365-filtering-correlation-id: 3d48740c-18c8-45bb-3f6f-08d4e369f0f6 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:CY4PR21MB0119; x-ms-traffictypediagnostic: CY4PR21MB0119: 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)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041248)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR21MB0119;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR21MB0119; x-forefront-prvs: 039975700A x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(6009001)(39860400002)(47760400005)(13464003)(377454003)(189002)(199003)(55016002)(2906002)(54906002)(8990500004)(6246003)(106356001)(105586002)(101416001)(99286003)(5005710100001)(6116002)(81166006)(81156014)(3846002)(102836003)(25786009)(2421001)(54356999)(50986999)(76176999)(8676002)(478600001)(6506006)(5660300001)(74316002)(86362001)(77096006)(33656002)(10090500001)(53936002)(15650500001)(9686003)(2950100002)(4326008)(229853002)(7696004)(1511001)(66066001)(86612001)(7736002)(53546010)(189998001)(6436002)(305945005)(14454004)(8936002)(97736004)(68736007)(93886004)(3280700002)(10290500003)(2900100001)(2561002)(3660700001)(226483002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR21MB0119;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=ttalpey@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:12:31.8573 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0119 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 v7ENCkEW010572 Content-Length: 2749 Lines: 68 > -----Original Message----- > From: Long Li > Sent: Monday, August 14, 2017 6:51 PM > To: Tom Talpey ; Christoph Hellwig > > Cc: Steve French ; linux-cifs@vger.kernel.org; samba- > technical@lists.samba.org; linux-kernel@vger.kernel.org > Subject: RE: [[PATCH v1] 16/37] [CIFS] SMBD: Post a SMBD message with no > payload > > > > > -----Original Message----- > > From: Tom Talpey > > Sent: Monday, August 14, 2017 12:00 PM > > To: Long Li ; Christoph Hellwig > > Cc: Steve French ; linux-cifs@vger.kernel.org; samba- > > technical@lists.samba.org; linux-kernel@vger.kernel.org > > Subject: RE: [[PATCH v1] 16/37] [CIFS] SMBD: Post a SMBD message with no > > payload > > > > > -----Original Message----- > > > From: linux-cifs-owner@vger.kernel.org [mailto:linux-cifs- > > > owner@vger.kernel.org] On Behalf Of Long Li > > > Sent: Monday, August 14, 2017 2:20 PM > > > To: Christoph Hellwig > > > Cc: Steve French ; linux-cifs@vger.kernel.org; > > > samba- technical@lists.samba.org; linux-kernel@vger.kernel.org > > > Subject: RE: [[PATCH v1] 16/37] [CIFS] SMBD: Post a SMBD message with > > > no payload > > > > > > > > Implement the function to send a SMBD message with no payload. > > > > > This is > > > > required at times when we want to extend credtis to server to have > > > > it continue to send data, without sending any actual data payload. > > > > > > > > Shouldn't this just be implemented as a special case in the version > > > > that posts data? > > > > > > It uses a different packet format "struct smbd_data_transfer_no_data". > > > I can restructure some common code to share between packet sending > > functions. > > > > The SMB Direct keepalive is just a Data Transfer Message with no payload > > (MS-SMBD section 2.2.3) and the SMB_DIRECT_RESPONSE_REQUESTED flag > > possibly set. I don't see any need to define a special structure to describe > > this? > > Data Transfer Message has the following extra fields at the end of an empty > packet. > > __le32 padding; No need to omit the padding, it's ignored anyway and the DataLength is zero so there's no other payload to consume. You can send a packet of pretty much any length. Just send the regular struct. BTW, the "padding" field is defined as variable array of bytes, meaning semantically you might want to code it as u8 padding[0] as well. However in practice it is either 4 bytes or not present at all, so you'd probably end up writing extra code for that choice. > char buffer[0]; > > I agree with you those can be merged to a special structure case. Will make the > change. Tom.