b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] Basic Multicast Optimizations
@ 2013-11-14  6:26 Linus Lüssing
  2013-11-14  6:26 ` [B.A.T.M.A.N.] [PATCHv11 1/6] batman-adv: Multicast Listener Announcements via Translation Table Linus Lüssing
                   ` (5 more replies)
  0 siblings, 6 replies; 38+ messages in thread
From: Linus Lüssing @ 2013-11-14  6:26 UTC (permalink / raw)
  To: b.a.t.m.a.n

This is the eleventh revision of the basic multicast optimization patches.

Changes:

* two non-critical compat code fixes (fixes sparse/smatch warnings):
  * typo: 'struct dev_addr_list' vs. 'struct batadv_dev_addr_list'
  * (unreachable code with netdev_master_upper_dev_get_rcu() compat code,
     patch provided by Simon)
* included multicast.h in multicast.c (fixes an sparse warning)
* substituted BATADV_UNINIT_FLAGS with a orig->capa_initialized and
  bat_priv->mcast.enabled as suggested by Marek
  (this adds patch 2/6)
* removed batadv_mcast_counter_update() to increase readability as
  suggested and provided by Marek
* rebased on top of the latest gateway code modifications:
  "batman-adv: send every DHCP packet as bat-unicast"
  (2d5b555644b22e171f3e0486abc0c2e627452d14)
  

^ permalink raw reply	[flat|nested] 38+ messages in thread
* [B.A.T.M.A.N.] Basic Multicast Optimizations
@ 2014-01-27  9:48 Linus Lüssing
  0 siblings, 0 replies; 38+ messages in thread
From: Linus Lüssing @ 2014-01-27  9:48 UTC (permalink / raw)
  To: b.a.t.m.a.n

This is the twelfth revision of the basic multicast optimization patches.

Changes in v12 include (thanks for the feedback again, Marek and Simon):

* added three reserved bytes to the mcast TVLV container to have a four bytes
  alignment (thanks Simon)
* Return value description in kernel docs for batadv_mcast_mla_tvlv_update
  added (thanks Marek)
* Using eth_hdr() instead of skb->data in various places (thanks Marek)
* Switched order of function parameters bat_priv and skb in various places
  for style consistency reasons (thanks Marek)
* renamed one occurence of "BATMAN_IV" to "BATMAN" (thanks Marek)
* kerneldoc for multicast_mode added (thanks Marek)
* rebased on top of master
* now that batadv_tt_local_add() has a potential failure case, a check for
  its return value was added

For Marek's question on gateway code interoperability, I reread that part
and couldn't find any issues with it either. Moreover, any additional
dhcp_rcp variable check seemed redundant to me, so I left that part as is.

Cheers, Linus


^ permalink raw reply	[flat|nested] 38+ messages in thread
* [B.A.T.M.A.N.] Basic Multicast Optimizations
@ 2013-10-26 19:16 Linus Lüssing
  0 siblings, 0 replies; 38+ messages in thread
From: Linus Lüssing @ 2013-10-26 19:16 UTC (permalink / raw)
  To: b.a.t.m.a.n

This is the tenth revision of the basic multicast optimization patches.

No changes were made except dealing with two or three rebase conflicts
while rebasing on top of 24c51de20.

Cheers, Linus


^ permalink raw reply	[flat|nested] 38+ messages in thread
* [B.A.T.M.A.N.] Basic Multicast Optimizations
@ 2013-08-15 19:21 Linus Lüssing
  2013-08-19 20:12 ` Simon Wunderlich
  0 siblings, 1 reply; 38+ messages in thread
From: Linus Lüssing @ 2013-08-15 19:21 UTC (permalink / raw)
  To: b.a.t.m.a.n

This is the ninth revision of the basic multicast optimization patches.

It fixes a regression in Patch 3/5, introduced in v8 while rebasing:
An atomic_dec() for the orig_list_count got lost.

Cheers, Linus


^ permalink raw reply	[flat|nested] 38+ messages in thread
* [B.A.T.M.A.N.] Basic Multicast Optimizations
@ 2013-08-13  8:23 Linus Lüssing
  2013-08-15 13:56 ` Simon Wunderlich
  0 siblings, 1 reply; 38+ messages in thread
From: Linus Lüssing @ 2013-08-13  8:23 UTC (permalink / raw)
  To: b.a.t.m.a.n

This is the eighth revision of the basic multicast optimization patches.

It adds many style + functional changes and fixes some bugs.

It also adds a new, important fifth patch, which addresses an issue
that I would have overlooked if it weren't for the extensive offline
talks with Simon about the interaction of batman-adv and various
multicast related RFCs.


# Changelog v7 -> v8

## Style improvements

* renamed batadv_mcast_tt_clean() tobatadv_mcast_tt_retract()
* renamed batadv_mcast_tvlv_update_flag_counter() to batadv_mcast_update_counter()
* renamed batadv_mcast_mla_tt_update() to batadv_mcast_mla_update()
* renamed batadv_mcast_update_counter() to batadv_mcast_counter_update()

* renamed BATADV_MCAST_HAS_NO_BRIDGE to BATADV_MCAST_WANT_ALL_UNSNOOPABLES (and reverse its logic)
* change value of BATADV_UNINIT_FLAGS from -1 to an unused bit, BIT(15)
  -> no more need to check BATADV_UNINIT_FLAGS in batadv_mcast_counter_update()

* moved code from batadv_mcast_mla_tt_update() to newly introduced batadv_mcast_mla_tvlv_update
* moved introduction of multicast_mode sysfs file to the third patch
* added kernel doc for struct batadv_priv_mcast and enum batadv_mcast_flag

## Functional improvements

* changed a '== -EINVAL' to '< 0'
* check for a bridge anywhere on top of bat0 (like br0 on bond0 on bat0, not just br0 on bat0)
  (as discussed on IRC we don't need to check for bridges on top of vlans yet as multicast
  optimizations are only enabled for non-VLAN packets at the moment)
* removed sysfs file control over multicast TT+TVLV announcements, moved sysfs file introduction to the third patch
* removed BATADV_MCAST_LISTENER_ANNOUNCEMENT flag: its purpose is now provided by checking the existence of the multicast tvlv instead
* made the tvlv value length check in the multicast tvlv handler to not only accept a length of one byte but anything greater, too
* New Patch: batman-adv: Send multicast packets to nodes with a WANT_ALL flag

## Bugs

* converted the static 'enabled' variable in batadv_mcast_mla_tt_update() to a per bat_priv variable, using bat_priv->mcast.flags (fixes a bug when using multiple batX interfaces)
* the announced tvlv was missing the BATADV_MCAST_HAS_NO_BRIDGE flag (not needed anymore with the reversed logic)
* batadv_mcast_update_counter() was missing a case which would have needed a BATADV_UNINIT_FLAGS check (not needed anymore with reversed logic and new value for BATADV_UNINIT_FLAGS)
* added missing update for num_want_all_unsnoopables (former num_has_bridge) counter in batadv_mcast_purge_orig()


Cheers, Linus


^ permalink raw reply	[flat|nested] 38+ messages in thread
* [B.A.T.M.A.N.] Basic Multicast Optimizations
@ 2013-07-03 22:03 Linus Lüssing
  2013-07-04  5:06 ` Linus Lüssing
  0 siblings, 1 reply; 38+ messages in thread
From: Linus Lüssing @ 2013-07-03 22:03 UTC (permalink / raw)
  To: b.a.t.m.a.n

This is the seventh revision of the basic multicast optimization patches.

It adds the style changes as suggested by Marek via eMail.

It also adds various suggestion from IRC (for instance adding kerneldoc for the
functions touched in translation-table.c, making the counter an atomic
one to be on the safe side for some "exotic" targets).


PATCHv7 4/4 is a new one and the result of a longer discussion on IRC:
Whether to add some support for some IPv4 addresses already for the cost of
a slightly larger complexity both code and documentation wise
- for a case which is uncommon for most mesh networks anyway: a mesh
with no bridges on any node involved.

So the fourth patch is sort of an RFC patch one, too (although the consense/
tendency on IRC so far was to add and support this case).

If everyone is fine with that concept, then I can also easily merge it
into patches 2/4 and 3/4 (if that is desired).

Cheers, Linus

^ permalink raw reply	[flat|nested] 38+ messages in thread
* [B.A.T.M.A.N.] Basic Multicast Optimizations
@ 2013-06-14 17:50 Linus Lüssing
  2013-06-16 14:08 ` Simon Wunderlich
  0 siblings, 1 reply; 38+ messages in thread
From: Linus Lüssing @ 2013-06-14 17:50 UTC (permalink / raw)
  To: b.a.t.m.a.n

This is the sixth revision of the basic multicast optimization patches.

It simplifies and speeds-up the new batadv_tt_global_hash_count():

* We now use batadv_tt_global_hash_find() instead of our custom look-up.
* A counter for the orig_list was added, so that we won't need to recount
  with every multicast packet.

Cheers, Linus

^ permalink raw reply	[flat|nested] 38+ messages in thread
* [B.A.T.M.A.N.] Basic Multicast Optimizations
@ 2013-06-14  9:02 Linus Lüssing
  0 siblings, 0 replies; 38+ messages in thread
From: Linus Lüssing @ 2013-06-14  9:02 UTC (permalink / raw)
  To: b.a.t.m.a.n

This is the fifth revision of the basic multicast optimization patches.

It fixes two bugs:

For one thing packets to the IPv6 all-hosts-link-scope multicast address
(ff02::1) were optimized, too. However this is the one link local address
which we should not never optimize (see RFC4541, section 3 [1]).

For another since commit 87d4a282 ("batman-adv: remove useless find_router look up"
the unicast-forwarding of multicast packets was broken and I had
only runtime tested the patches based on an older commit
(before 87d4a282 such unicast-forwarding was "only" broken if
a gateway-server was present).


Also note that rebasing on top of the TT-VLAN patches wasn't trivial:
Simply resolving the rebase complaints resulted in subtle runtime
bugs. A few lines in the counting methods added to translation-table.c
needed changes.

Cheers, Linus


[1]: Considerations for Internet Group Management Protocol (IGMP)
     and Multicast Listener Discovery (MLD) Snooping Switches
     -> "Packets with the all hosts link-scope address should be forwarded
         on all ports."
     https://tools.ietf.org/html/rfc4541

^ permalink raw reply	[flat|nested] 38+ messages in thread
* [B.A.T.M.A.N.] Basic Multicast Optimizations
@ 2013-06-10  7:11 Linus Lüssing
  2013-06-12 10:14 ` Simon Wunderlich
  0 siblings, 1 reply; 38+ messages in thread
From: Linus Lüssing @ 2013-06-10  7:11 UTC (permalink / raw)
  To: b.a.t.m.a.n

This is the fourth revision of the basic multicast optimization patches.

It adds a missing enum keyword to the return type of a mcast_forw_mode().

Cheers, Linus

^ permalink raw reply	[flat|nested] 38+ messages in thread
* [B.A.T.M.A.N.] Basic Multicast Optimizations
@ 2013-06-10  6:28 Linus Lüssing
  2013-06-10  7:06 ` Linus Lüssing
  0 siblings, 1 reply; 38+ messages in thread
From: Linus Lüssing @ 2013-06-10  6:28 UTC (permalink / raw)
  To: b.a.t.m.a.n

This is the third revision of the basic multicast optimization patches.
It includes one functional and some compat fixes, and some style improvements,
thanks to Simons feedback:

PATCHv3 1/3:
* the pmc_rcu functions got removed - they weren't actually used in the
  submitted revision - so there's no more patch for net to export
  for_each_pmc_rcu() needed anymore. Should also fix Simon's compat error.
* Compat code for netdev_for_each_mc_addr() added.
  (I needed to introduce a batadv_hw_addr because I wasn't able to achieve
  backwards compatibility with a netdev_hw_addr - my "official reasoning" will
  be that netdev_hw_addr is unnecessarily bloated, struct batadv_hw_addr
  has just the right size to do the job)
* Compat fix for IFF_BRIDGE_PORT
* Removed primary_if->soft_iface in batadv_mcast_mla_tt_update() as we
  can always use bat_priv->soft_iface instead.

PATCHv3 2/3
* Renamed num_non_aware to a more specific num_no_mla - because we will need
  things like a num_no_tracker for instance with the multicast tracker feature
  in the future.
* Fixed removal of orig_node's without BATADV_MCAST_LISTENER_ANNOUNCEMENT
  flag, update num_no_mla properly now.

PATCHv3 3/3
* Renamed batadv_mcast_flood() to batadv_mcast_forw_mode() because it does not
  only show whether to flood or not (=drop), but also whether to forward via
  unicast. In the future with the multicast tracker feature a fourth return value
  is going to be added, making the name "batadv_mcast_flood()" even less fitting.
* Simon's style suggestions for batadv_mcast_forw_mode() and
  batadv_interface_tx().
* batadv_mcast_forw_mode() now returns an enum (thanks to Marek and Antonio for
  the suggestion).

I did not change:
> I don't quite understand why you return -1, maybe the packet could still
> be forwarded even if it could not be pulled?

Because if it returns -1 then something is wrong, for instance we could be
out of memory. If we are out of memory then we probably won't be able to
forward any packet. Also we shouldn't allocate any more memory for one thing
but I think it is also better to drop/free packets to save some memory
to increase the possibility of the system to recover without crashing.

Cheers, Linus


^ permalink raw reply	[flat|nested] 38+ messages in thread
* [B.A.T.M.A.N.] Basic Multicast Optimizations
@ 2013-05-24  8:02 Linus Lüssing
  2013-05-24  9:00 ` Linus Lüssing
  2013-05-24  9:33 ` Marek Lindner
  0 siblings, 2 replies; 38+ messages in thread
From: Linus Lüssing @ 2013-05-24  8:02 UTC (permalink / raw)
  To: b.a.t.m.a.n

This is the second revision of the basic multicast optimization patches.
It includes one functional fix and many style fixes, thanks to Antonios
feedback.

Three things were not included from these suggestions:

* The default mcast TVLV flags were left as it is not as easy to
switch. (see answer/explanation to [PATCH 2/3])
* for_each_pmc_rcu() was not moved to a commen net header file,
only a TODO was added. Will do that after this code might have
landed in net.


Additionally the limitation of 255 multicast listeners per originator
was removed (it was more a relic of the pre-TT announcement mechanism
and such limitations should be taken care of by the current TT
infrastructure instead).

Cheers, Linus

^ permalink raw reply	[flat|nested] 38+ messages in thread
* [B.A.T.M.A.N.] Basic Multicast Optimizations
@ 2013-05-11 17:23 Linus Lüssing
  2013-05-16 11:51 ` Simon Wunderlich
  0 siblings, 1 reply; 38+ messages in thread
From: Linus Lüssing @ 2013-05-11 17:23 UTC (permalink / raw)
  To: b.a.t.m.a.n

This set of patches is the first one for a more efficient, group aware
multicast forwarding infrastructure in batman-adv.

This initial set mainly consists of the integration of announcing the
location of multicast listeners via the translation table mechanism to
be able to find out which batman-adv nodes are actually interested in
certain multicast traffic. As well as the signalizing of this
announcement capability via a new multicast TVLV.

Finally some basic multicast forwarding opitimizations are introduced:
If all nodes signalized the MLA capability then link-local IPv6 traffic
will be dropped if there is no interested listener or gets forwarded
via a batman-adv unicast packet if there is just one node interested
in the data.


For now, these optimizations only apply if all nodes in the mesh have
no bridge interface on top their bat0 interface. However making it
possible with bridges, too, and other features are on the roadmap. See
the according wiki page for details [1].


[1]: http://www.open-mesh.org/projects/batman-adv/wiki/Multicast-ideas-updated#Roadmap


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

end of thread, other threads:[~2014-01-27  9:48 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-14  6:26 [B.A.T.M.A.N.] Basic Multicast Optimizations Linus Lüssing
2013-11-14  6:26 ` [B.A.T.M.A.N.] [PATCHv11 1/6] batman-adv: Multicast Listener Announcements via Translation Table Linus Lüssing
2013-11-14  6:26 ` [B.A.T.M.A.N.] [PATCHv11 2/6] batman-adv: introduce capability initialization bitfield Linus Lüssing
2013-11-14  6:26 ` [B.A.T.M.A.N.] [PATCHv11 3/6] batman-adv: Announce new capability via multicast TVLV Linus Lüssing
2014-01-05 14:44   ` Marek Lindner
2013-11-14  6:26 ` [B.A.T.M.A.N.] [PATCHv11 4/6] batman-adv: Modified forwarding behaviour for multicast packets Linus Lüssing
2014-01-06  8:06   ` Marek Lindner
2013-11-14  6:26 ` [B.A.T.M.A.N.] [PATCHv11 5/6] batman-adv: Add IPv4 link-local/IPv6-ll-all-nodes multicast support Linus Lüssing
2013-11-14  6:26 ` [B.A.T.M.A.N.] [PATCHv11 6/6] batman-adv: Send multicast packets to nodes with a WANT_ALL flag Linus Lüssing
  -- strict thread matches above, loose matches on Subject: below --
2014-01-27  9:48 [B.A.T.M.A.N.] Basic Multicast Optimizations Linus Lüssing
2013-10-26 19:16 Linus Lüssing
2013-08-15 19:21 Linus Lüssing
2013-08-19 20:12 ` Simon Wunderlich
2013-08-13  8:23 Linus Lüssing
2013-08-15 13:56 ` Simon Wunderlich
2013-08-15 18:25   ` Linus Lüssing
2013-07-03 22:03 Linus Lüssing
2013-07-04  5:06 ` Linus Lüssing
2013-06-14 17:50 Linus Lüssing
2013-06-16 14:08 ` Simon Wunderlich
2013-06-14  9:02 Linus Lüssing
2013-06-10  7:11 Linus Lüssing
2013-06-12 10:14 ` Simon Wunderlich
2013-06-12 12:27   ` Linus Lüssing
2013-06-12 12:44     ` Simon Wunderlich
2013-06-12 20:33       ` Linus Lüssing
2013-06-10  6:28 Linus Lüssing
2013-06-10  7:06 ` Linus Lüssing
2013-05-24  8:02 Linus Lüssing
2013-05-24  9:00 ` Linus Lüssing
2013-05-24  9:06   ` Antonio Quartulli
2013-05-24  9:33 ` Marek Lindner
2013-05-11 17:23 Linus Lüssing
2013-05-16 11:51 ` Simon Wunderlich
2013-05-16 17:42   ` Linus Lüssing
2013-05-16 18:31     ` Simon Wunderlich
2013-05-17  1:38       ` Linus Lüssing
2013-05-17 10:24         ` Simon Wunderlich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).