All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Lindner <mareklindner@neomailbox.ch>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCHv2 2/8] batman-adv: split tq information in neigh_node struct
Date: Thu, 31 Oct 2013 00:33:40 +0800	[thread overview]
Message-ID: <3955829.tFnjpO9dDf@diderot> (raw)
In-Reply-To: <1383141713-15820-3-git-send-email-sw@simonwunderlich.de>

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

On Wednesday 30 October 2013 15:01:47 Simon Wunderlich wrote:
> @@ -1559,7 +1661,12 @@ static void batadv_iv_ogm_orig_print(struct
> batadv_priv *bat_priv, if (!neigh_node)
>  				continue;
> 
> -			if (neigh_node->bat_iv.tq_avg == 0)
> +			n_ifinfo = batadv_neigh_ifinfo_get(neigh_node,
> +							   BATADV_IF_DEFAULT);
> +			if (!n_ifinfo)
> +				goto next;
> +
> +			if (n_ifinfo->bat_iv.tq_avg == 0)
>  				goto next;
> 
>  			last_seen_jiffies = jiffies - orig_node->last_seen;
> @@ -1569,17 +1676,12 @@ static void batadv_iv_ogm_orig_print(struct
> batadv_priv *bat_priv,
> 
>  			seq_printf(seq, "%pM %4i.%03is   (%3i) %pM [%10s]:",
>  				   orig_node->orig, last_seen_secs,
> -				   last_seen_msecs, neigh_node->bat_iv.tq_avg,
> +				   last_seen_msecs, n_ifinfo->bat_iv.tq_avg,
>  				   neigh_node->addr,
>  				   neigh_node->if_incoming->net_dev->name);
> 
> -			hlist_for_each_entry_rcu(neigh_node_tmp,
> -						 &orig_node->neigh_list, list) {
> -				seq_printf(seq, " %pM (%3i)",
> -					   neigh_node_tmp->addr,
> -					   neigh_node_tmp->bat_iv.tq_avg);
> -			}
> -
> +			batadv_iv_ogm_orig_print_neigh(orig_node,
> +						       BATADV_IF_DEFAULT, seq);
>  			seq_puts(seq, "\n");
>  			batman_count++;

Aren't we missing a free_ref(n_ifinfo) here ?


> +/**
> + * batadv_neigh_node_free_ref - decrement the neighbors refcounter
> + * and possibly free it
> + * neigh_node: neigh neighbor to free
> + */
>  void batadv_neigh_node_free_ref(struct batadv_neigh_node *neigh_node)
>  {
>  	if (atomic_dec_and_test(&neigh_node->refcount))
> -		kfree_rcu(neigh_node, rcu);
> +		call_rcu(&neigh_node->rcu, batadv_neigh_node_free_rcu);
>  }

Isn't there some compat code you can remove as well ?

Cheers,
Marek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  reply	other threads:[~2013-10-30 16:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30 14:01 [B.A.T.M.A.N.] [PATCHv2 0/8] add network wide multi interface optimization Simon Wunderlich
2013-10-30 14:01 ` [B.A.T.M.A.N.] [PATCHv2 1/8] batman-adv: remove bonding and interface alternating Simon Wunderlich
2013-10-30 14:01 ` [B.A.T.M.A.N.] [PATCHv2 2/8] batman-adv: split tq information in neigh_node struct Simon Wunderlich
2013-10-30 16:33   ` Marek Lindner [this message]
2013-11-01  5:53   ` Linus Lüssing
2013-11-05 11:16     ` Simon Wunderlich
2013-11-05  0:13   ` Linus Lüssing
2013-10-30 14:01 ` [B.A.T.M.A.N.] [PATCHv2 3/8] batman-adv: split out router from orig_node Simon Wunderlich
2013-11-05  0:03   ` Linus Lüssing
2013-11-05 13:14     ` Simon Wunderlich
2013-11-05  0:17   ` Linus Lüssing
2013-10-30 14:01 ` [B.A.T.M.A.N.] [PATCHv2 4/8] batman-adv: add WiFi penalty Simon Wunderlich
2013-10-30 14:01 ` [B.A.T.M.A.N.] [PATCHv2 5/8] batman-adv: consider outgoing interface in OGM sending Simon Wunderlich
2013-10-30 14:01 ` [B.A.T.M.A.N.] [PATCHv2 6/8] batman-adv: add bonding again Simon Wunderlich
2013-10-30 14:01 ` [B.A.T.M.A.N.] [PATCHv2 7/8] batman-adv: add debugfs structure for information per interface Simon Wunderlich
2013-10-30 14:01 ` [B.A.T.M.A.N.] [PATCHv2 8/8] batman-adv: add debugfs support to view multiif tables Simon Wunderlich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3955829.tFnjpO9dDf@diderot \
    --to=mareklindner@neomailbox.ch \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.