From patchwork Sat Nov 26 14:26:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 127808 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id F106A1007D7 for ; Sun, 27 Nov 2011 01:30:24 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752526Ab1KZOaT (ORCPT ); Sat, 26 Nov 2011 09:30:19 -0500 Received: from nm22-vm2.bullet.mail.ukl.yahoo.com ([217.12.10.220]:39370 "HELO nm22-vm2.bullet.mail.ukl.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751858Ab1KZOaS (ORCPT ); Sat, 26 Nov 2011 09:30:18 -0500 Received: from [217.146.183.216] by nm22.bullet.mail.ukl.yahoo.com with NNFMP; 26 Nov 2011 14:30:17 -0000 Received: from [77.238.184.74] by tm9.bullet.mail.ukl.yahoo.com with NNFMP; 26 Nov 2011 14:30:17 -0000 Received: from [127.0.0.1] by smtp143.mail.ukl.yahoo.com with NNFMP; 26 Nov 2011 14:30:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1322317817; bh=Yan5Ip+6SI9aKCLaCs+4U5j7ghVRSkB5d8Lc7ruPCxs=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=TPEkZP36CkkR/Zle1AYn+5hsRzp7pEGaV5ig6ZPYJhWCFS3vdbgfX7JtvaLvVVGBJadd4m39xPGpBRTHtDMn+1Y5LEFv9FM5YxMoZCTdckWxkVk5qKDn7WYfJp3fh0wvaiV74uPoTXacEit60pfldhuPGVdRJV5eVGvnrqmA5z4= X-Yahoo-Newman-Id: 95997.1773.bm@smtp143.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Q.JuNhMVM1mCyETsovbQeTIzHHY6k2n4_Esphy8nq5ZQhJM u2Awa_nvZL4kAPSIrLhdtbzyIVKZSR_DsB4Si9OXrFOXJQWwFrPQQ6nz.UtC lZetOiJyvnCsXycZXtcvtWZrEFglnsL09yXAxpkYSXA9Wkg3F8uLZ7q6cWdb YNu_5a_ALuwpvcuqVVbgrl_iZh.eyTvx6e0th3RXyL5kUfJqIhJUMQCNny2v qRSTf7KBJUb8OQnrrUa8hx.Wj5jMp88gplq5AExYw.NTnqLrykoWQmTbu0_v h.HB5eCKg.2WNCPoU_pGl9TVBhXPCa5ezDRtV3nqdCsokWsgqrxhk9K2UDB7 IIK8peBFeF15uI8sOB.6Q8NHzBhvZscx5uC8qBFYzI3gFVzRsZ2157g-- X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@210.177.7.38 with plain) by smtp143.mail.ukl.yahoo.com with SMTP; 26 Nov 2011 14:30:15 +0000 GMT From: Marek Lindner To: davem@davemloft.net Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Antonio Quartulli , Sven Eckelmann Subject: [PATCH 08/10] batman-adv: linearise the tt_response skb only if needed Date: Sat, 26 Nov 2011 22:26:50 +0800 Message-Id: <1322317612-7770-9-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1322317612-7770-1-git-send-email-lindner_marek@yahoo.de> References: <1322317612-7770-1-git-send-email-lindner_marek@yahoo.de> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Antonio Quartulli The TT_RESPONSE skb has to be linearised only if the node plans to access the packet payload (so only if the message is directed to that node). In all the other cases the node can avoid this memory operation Signed-off-by: Antonio Quartulli Signed-off-by: Sven Eckelmann --- net/batman-adv/routing.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 60ce407..e0e7b7b 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -616,13 +616,14 @@ int recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if) } break; case TT_RESPONSE: - /* packet needs to be linearized to access the TT changes */ - if (skb_linearize(skb) < 0) - goto out; + if (is_my_mac(tt_query->dst)) { + /* packet needs to be linearized to access the TT + * changes */ + if (skb_linearize(skb) < 0) + goto out; - if (is_my_mac(tt_query->dst)) handle_tt_response(bat_priv, tt_query); - else { + } else { bat_dbg(DBG_TT, bat_priv, "Routing TT_RESPONSE to %pM [%c]\n", tt_query->dst,