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.] [PATCH 5/7] batman-adv: consider outgoing interface in OGM sending
Date: Sun, 27 Oct 2013 18:12:28 +0800 [thread overview]
Message-ID: <3097636.PlnBFYxLHF@diderot> (raw)
In-Reply-To: <1381323938-26931-6-git-send-email-siwu@hrz.tu-chemnitz.de>
[-- Attachment #1: Type: text/plain, Size: 1964 bytes --]
On Wednesday 09 October 2013 15:05:36 Simon Wunderlich wrote:
> @@ -573,6 +561,13 @@ batadv_iv_ogm_can_aggregate(const struct
> batadv_ogm_packet *new_bat_ogm_packet, if (!primary_if)
> goto out;
>
> + /* packet is not leaving on the same interface.
> + * TODO: some other parts here could be reworked as the
> + * outgoing interface is specified now.
> + */
> + if (forw_packet->if_outgoing != if_outgoing)
> + goto out;
> +
> /* packets without direct link flag and high TTL
> * are flooded through the net
> */
What is the TODO trying tell us ?
> @@ -895,9 +922,31 @@ static void batadv_iv_ogm_schedule(struct
> batadv_hard_iface *hard_iface) atomic_inc(&hard_iface->bat_iv.ogm_seqno);
>
> batadv_iv_ogm_slide_own_bcast_window(hard_iface);
> - batadv_iv_ogm_queue_add(bat_priv, hard_iface->bat_iv.ogm_buff,
> - hard_iface->bat_iv.ogm_buff_len, hard_iface, 1,
> - batadv_iv_ogm_emit_send_time(bat_priv));
> +
> + send_time = batadv_iv_ogm_emit_send_time(bat_priv);
> +
> + if (hard_iface == primary_if) {
> + /* OGMs from primary interfaces are scheduled on all
> + * interfaces.
> + */
> + rcu_read_lock();
> + list_for_each_entry_rcu(tmp_hard_iface, &batadv_hardif_list,
> + list) {
> + if (tmp_hard_iface->soft_iface !=
> + hard_iface->soft_iface)
> + continue;
> + batadv_iv_ogm_queue_add(bat_priv, *ogm_buff,
> + *ogm_buff_len, hard_iface,
> + tmp_hard_iface, 1, send_time);
> + }
> + rcu_read_unlock();
> + } else {
> + /* OGMs from secondary interfaces are only scheduled on their
> + * respective interfaces.
> + */
> + batadv_iv_ogm_queue_add(bat_priv, *ogm_buff, *ogm_buff_len,
> + hard_iface, hard_iface, 1, send_time);
> + }
The 2 line if-statement certainly won't pass. You could handle the hard_iface
!= primary_if case and then return. No need to have a big if-else block. That
should give you enough space to move the if-statement to one line.
Cheers,
Marek
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
next prev parent reply other threads:[~2013-10-27 10:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-09 13:05 [B.A.T.M.A.N.] [PATCH 0/7] add network wide multi interface optimization Simon Wunderlich
2013-10-09 13:05 ` [B.A.T.M.A.N.] [PATCH 1/7] batman-adv: remove bonding and interface alternating Simon Wunderlich
2013-10-09 13:05 ` [B.A.T.M.A.N.] [PATCH 2/7] batman-adv: split tq information in neigh_node struct Simon Wunderlich
2013-10-12 23:52 ` Antonio Quartulli
2013-10-19 9:59 ` Marek Lindner
2013-10-19 14:53 ` Simon Wunderlich
2013-10-09 13:05 ` [B.A.T.M.A.N.] [PATCH 3/7] batman-adv: split out router from orig_node Simon Wunderlich
2013-10-26 15:04 ` Marek Lindner
2013-10-09 13:05 ` [B.A.T.M.A.N.] [PATCH 4/7] batman-adv: add WiFi penalty Simon Wunderlich
2013-10-09 13:05 ` [B.A.T.M.A.N.] [PATCH 5/7] batman-adv: consider outgoing interface in OGM sending Simon Wunderlich
2013-10-27 10:12 ` Marek Lindner [this message]
2013-10-09 13:05 ` [B.A.T.M.A.N.] [PATCH 6/7] batman-adv: add bonding again Simon Wunderlich
2013-10-27 10:27 ` Marek Lindner
2013-10-09 13:05 ` [B.A.T.M.A.N.] [PATCH 7/7] batman-adv: add debugfs support to view multiif tables Simon Wunderlich
2013-10-27 10:55 ` Marek Lindner
2013-10-27 12:49 ` Antonio Quartulli
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=3097636.PlnBFYxLHF@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.