From patchwork Sun Aug 1 21:20:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 324 Return-Path: Received: from mail.gmx.net (mailout-de.gmx.net [213.165.64.23]) by open-mesh.net (Postfix) with SMTP id DD6CD154320 for ; Sun, 1 Aug 2010 23:20:27 +0200 (CEST) Received: (qmail invoked by alias); 01 Aug 2010 21:20:26 -0000 Received: from i59F6B41E.versanet.de (EHLO sven-desktop.lazhur.ath.cx) [89.246.180.30] by mail.gmx.net (mp021) with SMTP; 01 Aug 2010 23:20:26 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX1+wccUHQTuwkSE2xCHmq6+U8u4G/g5UwquCvW7jw7 DDabn4EYRJzV8g From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 1 Aug 2010 23:20:08 +0200 Message-Id: <1280697613-32001-3-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1280697613-32001-1-git-send-email-sven.eckelmann@gmx.de> References: <1280697613-32001-1-git-send-email-sven.eckelmann@gmx.de> X-Y-GMX-Trusted: 0 Subject: [B.A.T.M.A.N.] [PATCH 2/7] batman-adv: Only clone skb data for multiple broadcasts X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Aug 2010 21:20:28 -0000 batman-adv tries to resend broadcasts on all interfaces up to three times. For each round and each interface it must provide a skb which gets consumed by the sending function. It is unnecessary to copy the data of each broadcast because the actual data is either not shared or already copied by add_bcast_packet_to_list. So it is enough to just copy the skb control data Reported-by: David S. Miller Signed-off-by: Sven Eckelmann --- batman-adv/send.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/batman-adv/send.c b/batman-adv/send.c index fb0bfbf..524c0a9 100644 --- a/batman-adv/send.c +++ b/batman-adv/send.c @@ -477,7 +477,7 @@ static void send_outstanding_bcast_packet(struct work_struct *work) rcu_read_lock(); list_for_each_entry_rcu(batman_if, &if_list, list) { /* send a copy of the saved skb */ - skb1 = skb_copy(forw_packet->skb, GFP_ATOMIC); + skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC); if (skb1) send_skb_packet(skb1, batman_if, broadcast_addr);