public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCHv2] batman-adv: print packets re-routing on DBG_TT and ratelimit it
@ 2012-08-24 16:32 Antonio Quartulli
  2012-08-24 17:18 ` Martin Hundebøll
  0 siblings, 1 reply; 3+ messages in thread
From: Antonio Quartulli @ 2012-08-24 16:32 UTC (permalink / raw)
  To: b.a.t.m.a.n

To simplify TranslationTable debugging it is better to print the packet
rerouting message on the DBG_TT log level. In this way a developer interested in
packets rerouting doesn't need to filter it out of the whole ROUTES log.

Moreover, since this message will appear for each rerouted message, it is now
"ratelimited".

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---

v2:
- use net_ratelimited_function() macro

 routing.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/routing.c b/routing.c
index e7a4e25..9b8ff61 100644
--- a/routing.c
+++ b/routing.c
@@ -972,10 +972,10 @@ static int batadv_check_unicast_ttvn(struct batadv_priv *bat_priv,
 			batadv_orig_node_free_ref(orig_node);
 		}
 
-		batadv_dbg(BATADV_DBG_ROUTES, bat_priv,
-			   "TTVN mismatch (old_ttvn %u new_ttvn %u)! Rerouting unicast packet (for %pM) to %pM\n",
-			   unicast_packet->ttvn, curr_ttvn, ethhdr->h_dest,
-			   unicast_packet->dest);
+		net_ratelimited_function(batadv_dbg, BATADV_DBG_TT, bat_priv,
+					 "TTVN mismatch (old_ttvn %u new_ttvn %u)! Rerouting unicast packet (for %pM) to %pM\n",
+					 unicast_packet->ttvn, curr_ttvn,
+					 ethhdr->h_dest, unicast_packet->dest);
 
 		unicast_packet->ttvn = curr_ttvn;
 	}
-- 
1.7.9.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCHv2] batman-adv: print packets re-routing on DBG_TT and ratelimit it
  2012-08-24 16:32 [B.A.T.M.A.N.] [PATCHv2] batman-adv: print packets re-routing on DBG_TT and ratelimit it Antonio Quartulli
@ 2012-08-24 17:18 ` Martin Hundebøll
  2012-08-25 23:01   ` Antonio Quartulli
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Hundebøll @ 2012-08-24 17:18 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

Hi Antonio,

On Fri, 24 Aug 2012 18:32:31 +0200
Antonio Quartulli <ordex@autistici.org> wrote:

> diff --git a/routing.c b/routing.c
> index e7a4e25..9b8ff61 100644
> --- a/routing.c
> +++ b/routing.c
> @@ -972,10 +972,10 @@ static int batadv_check_unicast_ttvn(struct
> batadv_priv *bat_priv, batadv_orig_node_free_ref(orig_node);
>  		}
>  
> -		batadv_dbg(BATADV_DBG_ROUTES, bat_priv,
> -			   "TTVN mismatch (old_ttvn %u new_ttvn %u)!
> Rerouting unicast packet (for %pM) to %pM\n",
> -			   unicast_packet->ttvn, curr_ttvn,
> ethhdr->h_dest,
> -			   unicast_packet->dest);
> +		net_ratelimited_function(batadv_dbg, BATADV_DBG_TT,
> bat_priv,

Please add net_ratelimited_function() to compat.h, since it didn't make
its way into mainline before 3.5.

// Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCHv2] batman-adv: print packets re-routing on DBG_TT and ratelimit it
  2012-08-24 17:18 ` Martin Hundebøll
@ 2012-08-25 23:01   ` Antonio Quartulli
  0 siblings, 0 replies; 3+ messages in thread
From: Antonio Quartulli @ 2012-08-25 23:01 UTC (permalink / raw)
  To: Martin Hundebøll
  Cc: The list for a Better Approach To Mobile Ad-hoc Networking

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]

On Fri, Aug 24, 2012 at 07:18:04 +0200, Martin Hundebøll wrote:
> Hi Antonio,
> 
> Please add net_ratelimited_function() to compat.h, since it didn't make
> its way into mainline before 3.5.

oh right. Thank Martin. I'll send a new version of the patch including the
change in compat.h

Cheers,

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-25 23:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-24 16:32 [B.A.T.M.A.N.] [PATCHv2] batman-adv: print packets re-routing on DBG_TT and ratelimit it Antonio Quartulli
2012-08-24 17:18 ` Martin Hundebøll
2012-08-25 23:01   ` Antonio Quartulli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox