From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [net-next 1/1] tipc: eliminate buffer cloning in function tipc_msg_extract() Date: Sat, 30 Jun 2018 20:48:41 +0900 (KST) Message-ID: <20180630.204841.519988164548882830.davem@davemloft.net> References: <1530217504-16466-1-git-send-email-jon.maloy@ericsson.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, mohan.krishna.ghanta.krishnamurthy@ericsson.com, tung.q.nguyen@dektech.com.au, hoang.h.le@dektech.com.au, canh.d.luu@dektech.com.au, ying.xue@windriver.com, tipc-discussion@lists.sourceforge.net To: jon.maloy@ericsson.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:37788 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934688AbeF3Lsp (ORCPT ); Sat, 30 Jun 2018 07:48:45 -0400 In-Reply-To: <1530217504-16466-1-git-send-email-jon.maloy@ericsson.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Jon Maloy Date: Thu, 28 Jun 2018 22:25:04 +0200 > From: Tung Nguyen > > The function tipc_msg_extract() is using skb_clone() to clone inner > messages from a message bundle buffer. Although this method is safe, > it has an undesired effect that each buffer clone inherits the > true-size of the bundling buffer. As a result, the buffer clone > almost always ends up with being copied anyway by the message > validation function. This makes the cloning into a sub-optimization. > > In this commit we take the consequence of this realization, and copy > each inner message to a separately allocated buffer up front in the > extraction function. > > As a bonus we can now eliminate the two cases where we had to copy > re-routed packets that may potentially go out on the wire again. > > Signed-off-by: Tung Nguyen > Signed-off-by: Jon Maloy Applied, thanks for following up on this issue.