From patchwork Tue Jul 5 13:43:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 103290 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 DCA7BB6F53 for ; Tue, 5 Jul 2011 23:44:26 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751833Ab1GENoS (ORCPT ); Tue, 5 Jul 2011 09:44:18 -0400 Received: from nm5.bullet.mail.ukl.yahoo.com ([217.146.182.226]:40638 "HELO nm5.bullet.mail.ukl.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751725Ab1GENoR (ORCPT ); Tue, 5 Jul 2011 09:44:17 -0400 Received: from [217.146.183.182] by nm5.bullet.mail.ukl.yahoo.com with NNFMP; 05 Jul 2011 13:44:16 -0000 Received: from [217.146.183.172] by tm13.bullet.mail.ukl.yahoo.com with NNFMP; 05 Jul 2011 13:44:16 -0000 Received: from [127.0.0.1] by omp1013.mail.ukl.yahoo.com with NNFMP; 05 Jul 2011 13:44:16 -0000 X-Yahoo-Newman-Id: 301366.62593.bm@omp1013.mail.ukl.yahoo.com Received: (qmail 9417 invoked from network); 5 Jul 2011 13:44:16 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; h=DKIM-Signature:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=eVrg48/WxSR1Op2h/yIntGmjNZMCaMtWqKDlJGRMaSf2ImlcHjXa08XWR/vn4pTzhH1Gza7JMBMWqFNA4q3p8uwozLrd419+baeg0K9+9zuVeYzghrrMmV4lMb4spgCLfGdWGV9OjbZCXW54ObZq3NZgdiGrtJ5oJ0pCuCEE120= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1309873456; bh=Fvr/8ktX1AKPVhzEUmk4BoXsBt9Y99AItYtErfdV5/U=; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=SRZzdRIqZ3UXQU087G6V0ld5lU0At3s0LDwl+du4ZyAHHRJn+rlS0/j3fOhsL4z+dbQfS880NZOEi+p/Bb4p4WnpW2Q5iREQQZwBBUYr/6QeaLCM4vldu2MJMO37ebNF1HDs3bUtB/rxa5OWqBm+egldOfKIPen+VntZ+UXAkH4= Received: from localhost (lindner_marek@90.35.97.9 with plain) by smtp128.mail.ukl.yahoo.com with SMTP; 05 Jul 2011 13:44:15 +0000 GMT X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- X-YMail-OSG: cX2YY4UVM1kby0Xq9hmpwegkZulNapnQu4d3wM3eZxHjSw2 ApJDnnnvitQF4lMY9ciogBkv5korC_e7r1ccCcYeS_jrJHqdCC2TyfH0Az4k D9yVQSy1zPe_m3dygWc1AFoUoBUFY5VkM5JcSaCMHisuv_gs81V2ZOazWSIS eQXYTaehGrBAaWIrTlRQvyt5vX2Ub.WI.BvYdATLf0HHuCF8kZmG22FSMIF0 GoBa2snHNX9VmH8.zV_.vNobbVUXvY7ozgD2EOk3SgsP9GQ4kdI1PB0XsqVq _Fq62hIEMHapy_JUDY7TOVJHOWMqgH0ftT.RRMi9nLIaFwQYEwE4HWYKOUus 7 X-Yahoo-Newman-Property: ymail-3 From: Marek Lindner To: davem@davemloft.net Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Antonio Quartulli , Marek Lindner Subject: [PATCH 2/6] batman-adv: add_bcast_packet_to_list() takes the sending delay as parameter Date: Tue, 5 Jul 2011 15:43:56 +0200 Message-Id: <1309873440-11704-3-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.5.3 In-Reply-To: <1309873440-11704-1-git-send-email-lindner_marek@yahoo.de> References: <1309873440-11704-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 In order to make possible to use the broadcast list for delayed sendings the "delay" parameter is now provided instead of using 1 as hardcoded value. Signed-off-by: Antonio Quartulli Signed-off-by: Marek Lindner --- net/batman-adv/routing.c | 2 +- net/batman-adv/send.c | 4 ++-- net/batman-adv/send.h | 2 +- net/batman-adv/soft-interface.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 0ce090c..2cb98be 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -1677,7 +1677,7 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if) spin_unlock_bh(&orig_node->bcast_seqno_lock); /* rebroadcast packet */ - add_bcast_packet_to_list(bat_priv, skb); + add_bcast_packet_to_list(bat_priv, skb, 1); /* broadcast for me */ interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size); diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c index 7a2f082..2f62b2e 100644 --- a/net/batman-adv/send.c +++ b/net/batman-adv/send.c @@ -455,7 +455,7 @@ static void _add_bcast_packet_to_list(struct bat_priv *bat_priv, * The skb is not consumed, so the caller should make sure that the * skb is freed. */ int add_bcast_packet_to_list(struct bat_priv *bat_priv, - const struct sk_buff *skb) + const struct sk_buff *skb, unsigned long delay) { struct hard_iface *primary_if = NULL; struct forw_packet *forw_packet; @@ -492,7 +492,7 @@ int add_bcast_packet_to_list(struct bat_priv *bat_priv, /* how often did we send the bcast packet ? */ forw_packet->num_packets = 0; - _add_bcast_packet_to_list(bat_priv, forw_packet, 1); + _add_bcast_packet_to_list(bat_priv, forw_packet, delay); return NETDEV_TX_OK; packet_free: diff --git a/net/batman-adv/send.h b/net/batman-adv/send.h index 633224a..1f2d1e8 100644 --- a/net/batman-adv/send.h +++ b/net/batman-adv/send.h @@ -31,7 +31,7 @@ void schedule_forward_packet(struct orig_node *orig_node, int directlink, struct hard_iface *if_outgoing); int add_bcast_packet_to_list(struct bat_priv *bat_priv, - const struct sk_buff *skb); + const struct sk_buff *skb, unsigned long delay); void send_outstanding_bat_packet(struct work_struct *work); void purge_outstanding_packets(struct bat_priv *bat_priv, const struct hard_iface *hard_iface); diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 2dcdbb7..3f20332 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@ -634,7 +634,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface) bcast_packet->seqno = htonl(atomic_inc_return(&bat_priv->bcast_seqno)); - add_bcast_packet_to_list(bat_priv, skb); + add_bcast_packet_to_list(bat_priv, skb, 1); /* a copy is stored in the bcast list, therefore removing * the original skb. */