On Sonntag, 7. August 2016 12:34:19 CEST Linus Lüssing wrote:
With this patch, (re)broadcasting on a specific interfaces is avoided:
No neighbor: There is no need to broadcast on an interface if there is no node behind it.
Single neighbor is source: If there is just one neighbor on an interface and if this neighbor is the one we actually got this broadcast packet from, then we do not need to echo it back.
Single neighbor is originator: If there is just one neighbor on an interface and if this neighbor is the originator of this broadcast packet, then we do not need to echo it back.
Goodies for BATMAN V:
("Upgrade your BATMAN IV network to V now to get these for free!")
Thanks to the split of OGMv1 into two packet types, OGMv2 and ELP that is, we can now apply the same optimizations stated above to OGMv2 packets, too.
Furthermore, with BATMAN V, rebroadcasts can be reduced in certain multi interface cases, too, where BATMAN IV cannot. This is thanks to the removal of the "secondary interface originator" concept in BATMAN V.
Signed-off-by: Linus Lüssing linus.luessing@c0d3.blue
Changes in v5:
- remove a skb_reset_inner_mac_header() call again which was overlooked during the forw_packet->own switch in v4
Changes in v4:
- added @if_outgoing kerneldoc
- removed "NULL if we originated" note for @orig_addr in kerneldoc again
- added two @orig_node kerneldoc instances
- substituted fancy skb_inner_mac_header stuff with boring forw_packet->own
:)
Changes in v3:
- Replaced the new hardif_neigh_node's orig_node reference with a simple copy of the originator's MAC address -> avoids a potential dependancy cycle / memory leak (thanks Sven!)
- style:
- Swapped order of arguments orig_addr/orig_neigh of new batadv_hardif_no_broadcast()
- Added an else to avoid unnecessary, maybe confusing reassignments in batadv_hardif_no_broadcast()
Changes in v2:
- Changed some "if"s to "switch"es (thanks Sven!)
- Moved kref_get() closer to assignment in neigh_node_create() (thanks
Sven!) * Added missing hardif_put() calls (urgh... thanks Sven!)
- Added kerneldoc for new hardif_neigh_node->orig_node in types.h
- Removed "###" in this commit message (seems like patchwork didn't like it)
net/batman-adv/bat_v_ogm.c | 56 +++++++++++++++++++++++++++++++++++++++++ net/batman-adv/hard-interface.c | 52 ++++++++++++++++++++++++++++++++++++++ net/batman-adv/hard-interface.h | 16 ++++++++++++ net/batman-adv/originator.c | 13 +++++++--- net/batman-adv/routing.c | 2 +- net/batman-adv/send.c | 55 +++++++++++++++++++++++++++++++++++++++- net/batman-adv/send.h | 3 ++- net/batman-adv/soft-interface.c | 2 +- net/batman-adv/types.h | 2 ++ 9 files changed, 193 insertions(+), 8 deletions(-)
Applied in a00797d8fa8fd1471e8be1ac23d506f76d866aaa [1]. I had to fix some patch conflicts while applying it. Please check that no problems were introduced by me.
Kind regards, Sven
[1] https://git.open-mesh.org/batman-adv.git/commit/a00797d8fa8fd1471e8be1ac23d5...