[v5,0/3] Implementation of a Stateless Multicast Packet Type

Message ID 20230708215113.15325-1-linus.luessing@c0d3.blue (mailing list archive)
Headers
Series Implementation of a Stateless Multicast Packet Type |

Message

Linus Lüssing July 8, 2023, 9:51 p.m. UTC
  [PATCH v5 0/3] Implementation of a Stateless Multicast Packet Type

Hi,

The following patchset implements a stateless, TVLV capable batman-adv
multicast packet type.

The new batman-adv multicast packet type allows to contain several
originator destination MAC addresses within a TVLV. Routers on the way will
potentially split the batman-adv multicast packet and adjust its tracker
TVLV contents.

Routing decisions are still based on the selected BATMAN IV or BATMAN V
routing algorithm. So this new batman-adv multicast packet type retains
the same loop-free properties.

The purpose of this new packet type is to allow to forward an IP
multicast packet with less transmissions / overhead than the 
multicast-via-multiple-unicasts approach. Or to reach a lot more
destinations (currently up to 196, depending on the payload size, see 
Wiki documentation for details) than with the default multicast fanout
for the via-unicasts approach.

This will allow using applications like mDNS again in several Freifunk
communities. And with less transmissions will also make more bulky
multicast applications, like media streaming (to an assessable amount of
receivers) a lot more feasible.

This approach is way simpler than the original multicast (tracker) packet
approach we envisioned years ago. As it involves no maintenance of an
extra, state based multicast routing table. However the TVLV capability
should allow to extend things later, to split control and data plane a bit
more for instance, to further increase the number of destinations, to
further reduce overhead.

A compact overview can be found in the Wiki here, including limitations:

https://www.open-mesh.org/projects/batman-adv/wiki/Multicast-Packet-Type

Regards, Linus

---

Changelog v5:
* removed patches 1/5 + 2/5, as they were already applied
* rebased to current main branch
* changed padding behaviour:
  * now 2 bytes padding on the end of the multicast
    tracker TVLV, if number of destination nodes is
    even
  * as number of destination nodes might change between
    initial check until after pushing them, functions
    to post-adjust padding after pushing were added
* added/fixed TTL handling
* removed skb_pull() bailing from sub-functions of
  batadv_mcast_forw_push(), to only have a single
  skb_pull() to keep track of in batadv_mcast_forw_push()
  to revert the changes to the skb; instead a
  "unsigned short *tvlv_len" is passsed along in 
  batadv_mcast_.*push.*() functions to keep track of
  how many bytes were pushed
* moved + verified skb->ip_summed invalidation
* batadv_mcast_forw_shrink_tracker() xmas tree ordering
* reword batadv_mcast_forw_push_dest() "Return:" kerneldoc
* fixed spelling: outter -> outer

Changelog v4:
* PATCH 4/5:
  * add missing include for linux/types.h in multicast.h
  * add missing kerneldoc for @bat_priv in batadv_mcast_forw_push_dest()
    and batadv_mcast_forw_push_tvlvs()
  * use sizeof_field(type, field) instead of sizeof(((type *)0)->field)
    in batadv_mcast_forw_push_dest()
* PATCH 5/5:
  * rename num_dests_remove to num_dests_reduce in
    batadv_mcast_forw_shrink_align_offse() to fix kerneldocs and for
    consistency
  * fix typo in kerneldoc in batadv_mcast_forw_shrink_update_headers()
    -> @num_dest_reduce -> @num_dests_reduce
  * use sizeof_field(type, field) instead of sizeof(((type *)0)->field)
    in batadv_mcast_forw_shrink_align_offset()

Changelog v3:
* PATCH 1/5:
  * remove now obsolete includes
* PATCH 2/5:
  * fix batadv_tvlv_handler_register() in network-coding.c
  * add missing include for linux/skbuff.h
  * move variable declarations out of the switch case
    in batadv_tvlv_call_handler()
* PATCH 3/5:
  * remove unnecessary include of multicast.h in routing.c
  * add a few missing includes to multicast_forw.c
    (linux/byteorder/generic.h, linux/errno.h, linux/gfp.h, linux/stddef.h
     uapi/linux/batadv_packet.h, multicast.h)
* PATCH 4/5:
  * add missing rcu_read_unlock() in error case before returning in
    batadv_mcast_forw_push_dests_list()
  * remove unnecessary include of soft-interface.h in multicast_forw.c
  * add a few missing includes to multicast_forw.c
    (linux/bug.h, linux/build_bug.h, linux/limits.h, linux/rculist.h,
     linux/rcupdate.h, linux/string.h)
  * make batadv_mcast_forw_mode_by_count() static
  * fix return types in the declaration of
    batadv_mcast_forw_packet_hdrlen() and batadv_mcast_forw_push()
    in multicast.h
  * fix typo in commit message: "that the are capable of"
    -> "that the*y* are capable of"
* PATCH 5/5:
  * make batadv_mcast_forw_shrink_pack_dests() adhere to 80 characters
    per line for consistency
  * add a "continue" statement after the jump label in
    batadv_mcast_forw_shrink_pack_dests() to silence the sparse error
    "error: label at end of compound statement"

Changelog v2:
* Add "[PATCH v2 0/5]" prefix to title of cover letter, so that
  Patchwork can hopefully find it - no other changes
  

Comments

Sven Eckelmann July 19, 2023, 9:22 a.m. UTC | #1
On Saturday, 8 July 2023 23:51:10 CEST Linus Lüssing wrote:
[...]
> Changelog v5:
> * removed patches 1/5 + 2/5, as they were already applied
> * rebased to current main branch
> * changed padding behaviour:
>   * now 2 bytes padding on the end of the multicast
>     tracker TVLV, if number of destination nodes is
>     even
>   * as number of destination nodes might change between
>     initial check until after pushing them, functions
>     to post-adjust padding after pushing were added
> * added/fixed TTL handling
> * removed skb_pull() bailing from sub-functions of
>   batadv_mcast_forw_push(), to only have a single
>   skb_pull() to keep track of in batadv_mcast_forw_push()
>   to revert the changes to the skb; instead a
>   "unsigned short *tvlv_len" is passsed along in 
>   batadv_mcast_.*push.*() functions to keep track of
>   how many bytes were pushed
> * moved + verified skb->ip_summed invalidation
> * batadv_mcast_forw_shrink_tracker() xmas tree ordering
> * reword batadv_mcast_forw_push_dest() "Return:" kerneldoc
> * fixed spelling: outter -> outer


Didn't perform any actual review. But here are the buildbot complaints. The 
compiler.h is missing since patch 2 (for the "likely()").

Output of different failed tests
================================

ecsv/multicast: headers
-----------------------

    diff --git a/net/batman-adv/multicast_forw.c b/net/batman-adv/multicast_forw.c
    index a90e9057..96ec3f06 100644
    --- a/net/batman-adv/multicast_forw.c
    +++ b/net/batman-adv/multicast_forw.c
    @@ -10,6 +10,7 @@
     #include <linux/bug.h>
     #include <linux/build_bug.h>
     #include <linux/byteorder/generic.h>
    +#include <linux/compiler.h>
     #include <linux/errno.h>
     #include <linux/etherdevice.h>
     #include <linux/gfp.h>

ecsv/multicast: kerneldoc ./net/batman-adv/multicast_forw.c
-----------------------------------------------------------

    ./net/batman-adv/multicast_forw.c:433: warning: Function parameter or member 'num_dests_pushed' not described in 'batadv_mcast_forw_push_adjust_padding'

ecsv/multicast: sparse linux-5.1 cfg: BLA=y DAT=n DEBUG=n TRACING=y NC=y MCAST=y BATMAN_V=y
---------------------------------------------------------------------------

    /home/build_test/build_env/tmp.SpMnhX4MAz/net/batman-adv/multicast_forw.c:783:7: warning: symbol 'batadv_mcast_forw_shrink_align_offset' was not declared. Should it be static?

ecsv/multicast: unused_symbols linux-5.1 cfg: BLA=y DAT=n DEBUG=n TRACING=y NC=y MCAST=y BATMAN_V=y
---------------------------------------------------------------------------

    batadv_mcast_forw_shrink_align_offset

Kind regards,
	Sven