Re: [RFC v3 0/4] flow_dissector: Provide basic batman-adv unicast handling

From: Willem de Bruijn
Date: Fri Dec 15 2017 - 17:52:09 EST


On Fri, Dec 15, 2017 at 1:23 PM, Sven Eckelmann
<sven.eckelmann@xxxxxxxxxxxx> wrote:
> Hi,
>
> we are currently starting to use batman-adv as mesh protocol on multicore
> embedded devices. These usually don't have a lot of CPU power per core but
> are reasonable fast when using multiple cores.
>
> It was noticed that sending was working very well but receiving was
> basically only using on CPU core per neighbor. The reason for that is
> format of the (normal) incoming packet:
>
> +--------------------+
> | ip(v6)hdr |
> +--------------------+
> | inner ethhdr |
> +--------------------+
> | batadv unicast hdr |
> +--------------------+
> | outer ethhdr |
> +--------------------+
>
> The flow dissector will therefore stop after parsing the outer ethernet
> header and will not parse the actual ipv(4|6)/... header of the packet. Our
> assumption was now that it would help us to add minimal support to the flow
> dissector to jump over the batman-adv unicast and inner ethernet header
> (like in gre ETH_P_TEB). The patch was implemented in a slightly hacky
> way [1] and the results looked quite promising.
>
> I didn't get any feedback how the files should actually be named and I am
> not really happy with the current names - so please feel free to propose
> better names.
>
> The discussion of the RFC v2 can be found in the related patches of
> https://patchwork.ozlabs.org/cover/844783/
>
>
> Changes in v3:
> ==============
>
> * removed change of uapi/linux/batman_adv.h to uapi/linux/batadv_genl.h
> - requested by Willem de Bruijn <willemdebruijn.kernel@xxxxxxxxx>
> * removed naming fixes for enums/defines in uapi/linux/batadv_genl.h
> - requested by Willem de Bruijn <willemdebruijn.kernel@xxxxxxxxx>
> * renamed uapi/linux/batadv.h to uapi/linux/batadv_packet.h
> * moved batadv dissector functionality in own function
> - requested by Tom Herbert <tom@xxxxxxxxxxxxxxx>
> * added support for flags FLOW_DISSECTOR_F_STOP_AT_ENCAP and
> FLOW_DIS_ENCAPSULATION
> - requested by Willem de Bruijn <willemdebruijn.kernel@xxxxxxxxx>

Thanks for making these changes. The flow dissection looks good to me.

One possible issue is that this exposes kernel fixed width types u8/u16/..
to userspace. For posix compatibility reasons, uapi headers use the
variant with underscores.