Multicast optimizations for bridges
Subsystems (2)
v15 cover Multicast optimizations for bridges
This patchset enables the usage of the batman-adv multicast optimizations for scenarios involving bridges on top of e.g. bat0, too.
The first one alters the forwarding behaviour for IGMP and MLD reports which is a prerequisite before enabling multicast optimizations in bridged setups. It also increases the MCAST TVLV version number to 2. More on the issue of insufficient report handling with the v1 MCAST TVLV can be found here:
http://www.open-mesh.org/projects/batman-adv/wiki/Multicast-optimizations-listener-reports
The second patch finally enables the multicast optimizations for bridged setups.
Along come two more patches adding according debugging facilities to make it possible for the user to check why the multicast optimizations might not work ideally to give hints about what they might change about their topology.
This patchset can be found in the current linus/multicast-bridge branch.
Cheers, Linus
-----
With v15 Mareks suggestions were added and all build report errors were fixed.
Changes in v15:
* fixed indentiton in compat-sources/net/core/skbuff.c for skb_postpush_rcsum() [PATCH 1/4]
* fixed 80 characters limit for compat-include/linux/if_bridge.h
* moved querier struct introduction from [PATCH 3/4] to [PATCH 2/4]
* moved a flag variable assignment to a slightly later position
* removed unnecessary linux/mld.h include in [PATCH 1/4]
* added missing include for printk.h in multicast.c [PATCH 2/4]
* added missing include for seq_file.h in multicast.c [PATCH 4/4]
* added missing include for kernel.h in multicast.c [PATCH 3/4]
* fixed cppcheck warnings in multicast.c regarding:
"(style) Clarify calculation precedence for '&' and '?'."
* added "struct seq_file;" declaration in multicast.h [PATCH 4/4]
* fixed kerneldoc for batadv_mcast_flags_seq_print_text() [PATCH 4/4] -> added missing "Return:"
-> renamed "@mcast_flags" to "@flags"
* fixed kerneldoc for batadv_mcast_flags_open() in debugfs.c
by adding "Return:" [PATCH 4/4]
* fixed compat-code return type in compat-source/net/core/skbuff.c, skb_checksum_{simple_,}validate() [PATCH 1/4]
-> -ERRNO, does not suite a __sum16, should return skb_checksum_complete()
directly to fix sparse warnings
Changes in v14:
* replaced compat-sources/net/bridge/br_multicast.c with "static inline [foo]" and #defines in compat-include/linux/if_bridge.h
Changes in v13:
* Substituted a non-breaking space with a boring one
* Dropped compat code for kernels < 3.2
* Removed mcast tvlv container and handler support for v1 completely
* Rebase to current master branch
(automatic 3-way merge without issues)
Changes in v12:
* Rebase to current master branch
(automatic 3-way merge, then batadv_hardif_free_ref() -> batadv_hardif_put())
* Adding Linux upstream fix to compat-sources/net/core/skbuff.c
-> "net: fix bridge multicast packet checksum validation"
(9b368814b33, present since v4.5, queued for stable)
Changes in v11:
* Rewording of commit messages (PATCH 1/4+2/4)
* Rebasing to master (solving conflict with kernel doc "return" changes)
* Updating kerneldoc to proper "Return:" syntax
* Using eth_zero_addr() over memset (fixes a new checkpatch warning)
* Changing uint8_t to u8 and uint32_t to u32 (fixes new checkpatch warnings)
* Turning some batadv_dbg() into batadv_info(), making querier presence more visible (i.e. in dmesg too) (PATCH 3/4)
Changes in v10:
- PATCH 1/4:
* Former "[PATCH 4/4] batman-adv: Forward IGMP/MLD reports to selected querier (only)" substituted by the interim branch "batman-adv: Always flood IGMP/MLD reports" with the following changes:
* Increased compatibility to mcast-v1-tvlv nodes by
registering a v1 tvlv container and handler, too
(note: PATCH 2/4 needs to still unregister the handler
if the node is bridged bc. it can't "trust" v1 nodes)
* Removed skb_set_network_header() call
(extra patch pending for review for maint)
* Compared to patchset v9 this substitution makes things
compilable again for kernels < 2.6.35
- PATCH 2/4:
* Moved enum introduction of BATADV_DBG_MCAST to PATCH 3/4,
not needed in PATCH 2/4 yet
* Adjusted compat code to new compat layout
* Adjustments to batadv_mcast_mla_tvlv_update() to fit now
preceding PATCH 1/4
* bat_priv->mcast.bridged flag already introduced here
(instead of in PATCH 3/4) because we need it for the new
mcast-v1-tvlv handling
---
Interim Changlog of
"batman-adv: Always flood IGMP/MLD reports"
v1:
* Removed query snooping and state
* Squashed all three patches into one
* Renamed "batadv_mcast_tvlv_ogm_handler_v1()" to *_v2()
* Added explicit icmpv6.h include
* Rebased on top of master
-----
Interim Interim Changelog of
"batman-adv: Unicasting multicast reports to querier-node only" v6:
* compat: copied copyright headers from original upstream c files
* compat: unified ordering in compat c files:
-> copyright header, then includes, then kernel specific functions
v5:
* Removed RFC tag: Needed exports got merged to net-next and are going to be available with Linux 4.2
* Redid compat solution - now fully backwards compatible down to 2.6.33
v4:
* excluded bridge part from this patchset, they should
hopefully be added to net-next soon
* Added a compat solution (PATCH 3/3)
* Removed Kconfig-depends as by David's suggestion the needed parsing functions for MLD are going to be forced built-ins even if IPv6 is going to be built as a module
* Removed unused variable 'int ret' in batadv_mcast_is_report_ipv6()
* Adjusted to new folder structure
v3:
* Adding Kconfig-depends and #if's
(so basically adding similar dependancy constraints as the bridge code
has, except that there are no depends if batman-adv gets compiled without multicast optimizations)
-> the case of IPv6=M and batman-adv=y is still impossible if multicast
optimizations are enabled; but I don't see the practical demand for that either - people who use IPv6 as a module will probably also want to use batman-adv as a module
v2:
* various bugfixes (now runtime tested, too - should(tm) work)
* added netdev+bridge mailinglists
-----
---
Changes in v9:
- PATCH 1/4:
* fix: added compat code for pr_warn_once()
* compat fix for bridge export stubs: fixes compile error with kernels < 3.16 without bridge (snooping) support
- PATCH 2/4:
* perform updates of variables within bat_priv->mcast.querier_ipv{4,6} individually (there's a new, third member in 4/4 which shouldn't be overriden)
* PATCH 4/4: NEW
Changes in v8 (thanks to Simon's suggestions):
- PATCH 2/3:
* print shadowing status log of an appearing and shadowing querier, too (the bridge-querier-existence call has an additional 10s delay to ensure reports had their time to arrive -
the bridge-querier-port call doesn't have that)
- PATCH 3/3:
* changing debugfs output from "+" and "-" to "U/4/6" and "."
* fixing "no querier present" logic (introduced in [PATCHv7 3/3])
Changes in v7 (thanks to Simon's suggestions):
- PATCH 2/3:
* renaming old/new_querier to old/new_state
* slightly extended kerneldoc of batadv_mcast_querier_log()
* removing words "good" and "bad" from debug output
* simplified batadv_mcast_flags_log()
* assignment instead of memset in batadv_mcast_mla_tvlv_update() and batadv_softif_init_late()
* simple struct member assignments instead of one complex struct assigment
* removing unnecessary memcmp's
* substituting return statement for an if-block in batadv_mcast_querier_log() and batadv_mcast_bridge_log()
* print "Unsnoopables(U)-flag" instead of just "U-flag"
- PATCH 3/3:
* use bat_priv values instead of querying bridge ABI in batadv_mcast_flags_print_header()
Changes in v6:
* New PATCH 2/3 inserted, moving logging to separate patch
* More verbose logging added to PATCH 2/3:
Bridge and querier state changes are logged too
* upper case to lower case for kernel doc of batadv_mcast_flags_open (PATCH 2/3)
* Adding note to kernel doc of batadv_mcast_get_bridge about increased refcount (PATCH 1/3)
* Printing some lines about current bridge and querier state to debugfs too (PATCH 3/3)
Changes in v5 (PATCH 2/2 only):
* s/dat_cache/mcast_flags/ in kerneldoc (copy&paste error)
Changes in v4 (PATCH 2/2 only):
* initial {ad,e}dition of this patch
Changes in v3 (PATCH 1/2 only):
* Removed "RFC" tag in title again: The stubs and new export are upstream in net-next and therefore going to be included in 3.17
* Added some debug output:
* Two warning messages:
-> Old kernel version or no bridge IGMP/MLD snooping compiled
* New batman-adv log-level "mcast":
-> Logging mcast flag changes (a third debugging facility, a new table for debugfs for a global
mcast flag overview will be added in a separate patch later as discussed with Simon)
Changes in v2 (PATCH 1/2 only):
* fetching local (= on this same kernel) multicast listeners from the bridge instead of the bat0 interface if a bridge is present
- just like ip addresses and routes should be used from br0, the same goes for multicast listeners
* beautification of batadv_mcast_mla_br_addr_cpy(), now using already present functions from the kernel instead of own, hackish approach
* changed names of some goto-labels (not using "skip" anymore)
* using new, third bridge multicast export (because this export is not upstream yet, I've added the "RFC" in the title):
br_multicast_has_querier_anywhere()
* adding compat stubs for two bridge multicast exports, to make batman-adv compile- and usable even if a 3.16 kernel was compiled without bridge code - the stubs are supposed to be upstream in the bridge code in 3.17 (therefore just 'compat')
* updated kerneldocs for batadv_mcast_mla_bridge_get() and batadv_mcast_mla_softif_get()
* The two sentences in the commit message starting with "Queriers: ..." were slightly modified to include the third bridge multicast export
PATCH v15 1/4 batman-adv: Always flood IGMP/MLD reports
With this patch IGMP or MLD reports are always flooded. This is necessary for the upcoming bridge integration to function without multicast packet loss.
With the report handling so far bridges might miss interested multicast listeners, leading to wrongly excluding ports from multicast packet forwarding.
Currently we are treating IGMP/MLD reports, the messages bridges use to learn about interested multicast listeners, just as any other multicast
packet: We try to send them to nodes matching its multicast destination.
Unfortunately, the destination address of reports of the older IGMPv2/MLDv1 protocol families do not strictly adhere to their own
protocol: More precisely, the interested receiver, an IGMPv2 or MLDv1 querier, itself usually does not listen to the multicast destination address of any reports.
Therefore with this patch we are simply excluding IGMP/MLD reports from the multicast forwarding code path and keep flooding them. By that any bridge receives them and can properly learn about listeners.
To avoid compatibility issues with older nodes not yet implementing this report handling, we need to force them to flood reports: We do this by bumping the multicast TVLV version to 2, effectively disabling their multicast optimization.
--- Makefile | 4 + compat-include/linux/igmp.h | 13 ++ compat-include/linux/skbuff.h | 14 ++ compat-include/net/addrconf.h | 13 ++ compat-include/net/ip6_checksum.h | 18 +++ compat-include/net/ipv6.h | 17 +++ compat-sources/Makefile | 3 + compat-sources/net/core/skbuff.c | 212 +++++++++++++++++++++++++++++ compat-sources/net/ipv4/igmp.c | 241 +++++++++++++++++++++++++++++++++ compat-sources/net/ipv6/mcast_snoop.c | 216 +++++++++++++++++++++++++++++ net/batman-adv/Kconfig | 2 +- net/batman-adv/multicast.c | 85 ++++++++++-- 12 files changed, 825 insertions(+), 13 deletions(-) create mode 100644 compat-include/linux/igmp.h create mode 100644 compat-include/net/addrconf.h create mode 100644 compat-include/net/ip6_checksum.h create mode 100644 compat-include/net/ipv6.h create mode 100644 compat-sources/Makefile create mode 100644 compat-sources/net/core/skbuff.c create mode 100644 compat-sources/net/ipv4/igmp.c create mode 100644 compat-sources/net/ipv6/mcast_snoop.c
Makefile +4 -0
@@ -52,6 +52,10 @@ ifneq ($(REVISION),) NOSTDINC_FLAGS += -DBATADV_SOURCE_VERSION=\"$(REVISION)\" endif +include $(PWD)/compat-sources/Makefile + +export batman-adv-y + BUILD_FLAGS := \ M=$(PWD)/net/batman-adv \ CONFIG_BATMAN_ADV=m \
compat-include/linux/igmp.h new file +13 -0
@@ -0,0 +1,13 @@ +#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_IGMP_H_ +#define _NET_BATMAN_ADV_COMPAT_LINUX_IGMP_H_ + +#include <linux/version.h> +#include_next <linux/igmp.h> + +#if LINUX_VERSION_CODE <KERNEL_VERSION (4 ,2 ,0 ) + +int ip_mc_check_igmp (struct sk_buff *skb,struct sk_buff **skb_trimmed); + +#endif /* < KERNEL_VERSION(4, 2, 0) */ + +#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_IGMP_H_ */
compat-include/linux/skbuff.h +14 -0
@@ -60,6 +60,20 @@#define pskb_copy_for_clone pskb_copy +__sum16 skb_checksum_simple_validate (struct sk_buff *skb); + +__sum16 +skb_checksum_validate (struct sk_buff *skb,int proto, +__wsum (*compute_pseudo)(struct sk_buff *skb,int proto)); +#endif /* < KERNEL_VERSION(3, 16, 0) */ +#if LINUX_VERSION_CODE <KERNEL_VERSION (4 ,2 ,0 ) + +struct sk_buff *skb_checksum_trimmed (struct sk_buff *skb, +unsigned int transport_len, +__sum16 (*skb_chkf)(struct sk_buff *skb)); + +#endif /* < KERNEL_VERSION(4, 2, 0) */ +#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_SKBUFF_H_ */
compat-include/net/addrconf.h new file +13 -0
@@ -0,0 +1,13 @@ +#ifndef _NET_BATMAN_ADV_COMPAT_NET_ADDRCONF_H_ +#define _NET_BATMAN_ADV_COMPAT_NET_ADDRCONF_H_ + +#include <linux/version.h> +#include_next <net/addrconf.h> + +#if LINUX_VERSION_CODE <KERNEL_VERSION (4 ,2 ,0 ) + +int ipv6_mc_check_mld (struct sk_buff *skb,struct sk_buff **skb_trimmed); + +#endif /* < KERNEL_VERSION(4, 2, 0) */ + +#endif /* _NET_BATMAN_ADV_COMPAT_NET_ADDRCONF_H_ */
compat-include/net/ip6_checksum.h new file +18 -0
@@ -0,0 +1,18 @@ +#ifndef _NET_BATMAN_ADV_COMPAT_NET_IP6_CHECKSUM_H_ +#define _NET_BATMAN_ADV_COMPAT_NET_IP6_CHECKSUM_H_ + +#include <linux/version.h> +#include_next <net/ip6_checksum.h> + +#if LINUX_VERSION_CODE <KERNEL_VERSION (3 ,16 ,0 ) + +static inline __wsum ip6_compute_pseudo (struct sk_buff *skb,int proto) +{ +return ~csum_unfold (csum_ipv6_magic (&ipv6_hdr (skb)->saddr, + &ipv6_hdr (skb)->daddr, + skb->len, proto,0 )); +} + +#endif /* < KERNEL_VERSION(3, 16, 0) */ + +#endif /* _NET_BATMAN_ADV_COMPAT_NET_IP6_CHECKSUM_H_ */
compat-include/net/ipv6.h new file +17 -0
@@ -0,0 +1,17 @@ +#ifndef _NET_BATMAN_ADV_COMPAT_NET_IPV6_H_ +#define _NET_BATMAN_ADV_COMPAT_NET_IPV6_H_ + +#include <linux/version.h> +#include_next <net/ipv6.h> + +#if LINUX_VERSION_CODE <KERNEL_VERSION (3 ,3 ,0 ) + +#define ipv6_skip_exthdr (skb, start, nexthdrp, frag_offp) \ + ({ \ + (void)frag_offp; \ + ipv6_skip_exthdr(skb, start, nexthdrp); \ + }) + +#endif /* < KERNEL_VERSION(3, 3, 0) */ + +#endif /* _NET_BATMAN_ADV_COMPAT_NET_IPV6_H_ */
compat-sources/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += ../../compat-sources/net/core/skbuff.o +batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += ../../compat-sources/net/ipv4/igmp.o +batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += ../../compat-sources/net/ipv6/mcast_snoop.o
compat-sources/net/core/skbuff.c new file +212 -0
212 lines not on this page · raw message
compat-sources/net/ipv4/igmp.c new file +241 -0
241 lines not on this page · raw message
compat-sources/net/ipv6/mcast_snoop.c new file +216 -0
216 lines not on this page · raw message
net/batman-adv/Kconfig +1 -1
@@ -66,7 +66,7 @@ config BATMAN_ADV_NC config BATMAN_ADV_MCAST bool "Multicast optimisation" - depends on BATMAN_ADV + depends on BATMAN_ADV && INET default n help This option enables the multicast optimisation which aims to
net/batman-adv/multicast.c +73 -12
167 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCHv15 1/4] batman-adv: Always flood IGMP/MLD reports
Quoted 44 lines · On Tuesday, May 10, 2016 18:41:24 Linus Lüssing wrote:
With this patch IGMP or MLD reports are always flooded. This is necessary for the upcoming bridge integration to function without multicast packet loss.
With the report handling so far bridges might miss interested multicast listeners, leading to wrongly excluding ports from multicast packet forwarding.
Currently we are treating IGMP/MLD reports, the messages bridges use to learn about interested multicast listeners, just as any other multicast
packet: We try to send them to nodes matching its multicast destination.Unfortunately, the destination address of reports of the older IGMPv2/MLDv1 protocol families do not strictly adhere to their own
protocol: More precisely, the interested receiver, an IGMPv2 or MLDv1 querier, itself usually does not listen to the multicast destination address of any reports.Therefore with this patch we are simply excluding IGMP/MLD reports from the multicast forwarding code path and keep flooding them. By that any bridge receives them and can properly learn about listeners.
To avoid compatibility issues with older nodes not yet implementing this report handling, we need to force them to flood reports: We do this by bumping the multicast TVLV version to 2, effectively disabling their multicast optimization.
Tested-by Simon Wunderlich <[email protected]>Signed-off-by Linus Lüssing <[email protected]>--- Makefile | 4 + compat-include/linux/igmp.h | 13 ++ compat-include/linux/skbuff.h | 14 ++ compat-include/net/addrconf.h | 13 ++ compat-include/net/ip6_checksum.h | 18 +++ compat-include/net/ipv6.h | 17 +++ compat-sources/Makefile | 3 + compat-sources/net/core/skbuff.c | 212 +++++++++++++++++++++++++++++ compat-sources/net/ipv4/igmp.c | 241 +++++++++++++++++++++++++++++++++ compat-sources/net/ipv6/mcast_snoop.c | 216 +++++++++++++++++++++++++++++ net/batman-adv/Kconfig | 2 +- net/batman-adv/multicast.c | 85 ++++++++++-- 12 files changed, 825 insertions(+), 13 deletions(-)
Quoted 8 lines
create mode 100644 compat-include/linux/igmp.h create mode 100644 compat-include/net/addrconf.h create mode 100644 compat-include/net/ip6_checksum.h create mode 100644 compat-include/net/ipv6.h create mode 100644 compat-sources/Makefile create mode 100644 compat-sources/net/core/skbuff.c create mode 100644 compat-sources/net/ipv4/igmp.c create mode 100644 compat-sources/net/ipv6/mcast_snoop.c
Applied in revision 08bf4dc.
Thanks,
Marek
PATCH v15 2/4 batman-adv: Add multicast optimization support for bridged setups
In reply to Linus LüssingWith this patch we are finally able to support multicast optimizations in bridged setups, too. So far, if a bridge was added on top of a soft-interface (e.g. bat0) the batman-adv multicast optimizations needed to be disabled to avoid packetloss.
Current Linux bridge implementations and API can now provide us with the so far missing information about interested but "remote" multicast receivers behind bridge ports.
The Linux bridge performs the detection of remote participants interested in multicast packets with its own and mature so called IGMP and MLD snooping code and stores that in its database. With the new API provided by the bridge batman-adv can now simply hook into this database.
We then reliably announce the gathered multicast listeners to other nodes through the batman-adv translation table.
Additionally, the Linux bridge provides us with the information about whether an IGMP/MLD querier exists. If there is none then we need to disable multicast optimizations as we cannot learn about multicast listeners on external, bridged-in host then.
--- compat-include/linux/etherdevice.h | 9 ++ compat-include/linux/if_bridge.h | 68 ++++++++++++++ net/batman-adv/multicast.c | 181 ++++++++++++++++++++++++++++++++---- net/batman-adv/types.h | 13 +++ 4 files changed, 253 insertions(+), 18 deletions(-) create mode 100644 compat-include/linux/if_bridge.h
compat-include/linux/etherdevice.h +9 -0
@@ -35,6 +35,15 @@ static inline void batadv_eth_hw_addr_random(struct net_device *dev)#endif /* < KERNEL_VERSION(3, 4, 0) */ +#if LINUX_VERSION_CODE <KERNEL_VERSION (3 ,7 ,0 ) + +static inline void eth_zero_addr (u8 *addr) +{ +memset (addr,0x00 ,ETH_ALEN ); +} + +#endif /* < KERNEL_VERSION(3, 7, 0) */ +#if LINUX_VERSION_CODE <KERNEL_VERSION (3 ,14 ,0 )#define ether_addr_equal_unaligned (_a, _b) (memcmp(_a, _b, ETH_ALEN) == 0)
compat-include/linux/if_bridge.h new file +68 -0
68 lines not on this page · raw message
net/batman-adv/multicast.c +163 -18
260 lines not on this page · raw message
net/batman-adv/types.h +13 -0
@@ -755,6 +755,17 @@ struct batadv_priv_dat {#ifdef CONFIG_BATMAN_ADV_MCAST /** +* struct batadv_mcast_querier_state - IGMP/MLD querier state when bridged +* @exists: whether a querier exists in the mesh +* @shadowing: if a querier exists, whether it is potentially shadowing +* multicast listeners (i.e. querier is behind our own bridge segment) +*/ +struct batadv_mcast_querier_state { +bool exists; +bool shadowing; +}; + +/** * struct batadv_priv_mcast - per mesh interface mcast data * @mla_list: list of multicast addresses we are currently announcing via TT * @want_all_unsnoopables_list: a list of orig_nodes wanting all unsnoopable
@@ -763,6 +774,7 @@ struct batadv_priv_dat {* @want_all_ipv6_list: a list of orig_nodes wanting all IPv6 multicast traffic * @flags: the flags we have last sent in our mcast tvlv * @enabled: whether the multicast tvlv is currently enabled +* @bridged: whether the soft interface has a bridge on top * @num_disabled: number of nodes that have no mcast tvlv * @num_want_all_unsnoopables: number of nodes wanting unsnoopable IP traffic * @num_want_all_ipv4: counter for items in want_all_ipv4_list
@@ -777,6 +789,7 @@ struct batadv_priv_mcast {struct hlist_head want_all_ipv6_list;u8 flags;bool enabled; +bool bridged;atomic_t num_disabled;atomic_t num_want_all_unsnoopables;atomic_t num_want_all_ipv4;
Signature · 1 line
1.7.10.4
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCHv15 2/4] batman-adv: Add multicast optimization support for bridged setups
Quoted 25 lines · On Tuesday, May 10, 2016 18:41:25 Linus Lüssing wrote:
With this patch we are finally able to support multicast optimizations in bridged setups, too. So far, if a bridge was added on top of a soft-interface (e.g. bat0) the batman-adv multicast optimizations needed to be disabled to avoid packetloss.
Current Linux bridge implementations and API can now provide us with the so far missing information about interested but "remote" multicast receivers behind bridge ports.
The Linux bridge performs the detection of remote participants interested in multicast packets with its own and mature so called IGMP and MLD snooping code and stores that in its database. With the new API provided by the bridge batman-adv can now simply hook into this database.
We then reliably announce the gathered multicast listeners to other nodes through the batman-adv translation table.
Additionally, the Linux bridge provides us with the information about whether an IGMP/MLD querier exists. If there is none then we need to disable multicast optimizations as we cannot learn about multicast listeners on external, bridged-in host then.
Tested-by Simon Wunderlich <[email protected]>Signed-off-by Linus Lüssing <[email protected]>
Quoted 8 lines
--- compat-include/linux/etherdevice.h | 9 ++ compat-include/linux/if_bridge.h | 68 ++++++++++++++ net/batman-adv/multicast.c | 181 ++++++++++++++++++++++++++++++++---- net/batman-adv/types.h | 13 +++ 4 files changed, 253 insertions(+), 18 deletions(-) create mode 100644 compat-include/linux/if_bridge.h
Applied in revision 391b59c.
Thanks,
Marek
PATCH v15 3/4 batman-adv: Adding logging of mcast flag changes
In reply to Linus LüssingWith this patch changes relevant to a node's own multicast flags are printed to the 'mcast' log level.
--- net/batman-adv/main.h | 4 +- net/batman-adv/multicast.c | 133 ++++++++++++++++++++++++++++++++++++++- net/batman-adv/soft-interface.c | 4 ++ net/batman-adv/types.h | 4 ++ 4 files changed, 142 insertions(+), 3 deletions(-)
net/batman-adv/main.h +3 -1
@@ -231,6 +231,7 @@ __be32 batadv_skb_crc32(struct sk_buff *skb, u8 *payload_ptr);* @BATADV_DBG_BLA: bridge loop avoidance messages * @BATADV_DBG_DAT: ARP snooping and DAT related messages * @BATADV_DBG_NC: network coding related messages +* @BATADV_DBG_MCAST: multicast related messages * @BATADV_DBG_ALL: the union of all the above log levels */ enum batadv_dbg_level {
@@ -240,7 +241,8 @@ enum batadv_dbg_level {BATADV_DBG_BLA =BIT (3 ),BATADV_DBG_DAT =BIT (4 ),BATADV_DBG_NC =BIT (5 ), - BATADV_DBG_ALL = 63, +BATADV_DBG_MCAST =BIT (6 ), + BATADV_DBG_ALL = 127, };#ifdef CONFIG_BATMAN_ADV_DEBUG
net/batman-adv/multicast.c +131 -2
163 lines not on this page · raw message
net/batman-adv/soft-interface.c +4 -0
@@ -808,6 +808,10 @@ static int batadv_softif_init_late(struct net_device *dev)atomic_set (&bat_priv->distributed_arp_table,1 );#endif #ifdef CONFIG_BATMAN_ADV_MCAST + bat_priv->mcast.querier_ipv4.exists = false; + bat_priv->mcast.querier_ipv4.shadowing = false; + bat_priv->mcast.querier_ipv6.exists = false; + bat_priv->mcast.querier_ipv6.shadowing = false; bat_priv->mcast.flags =BATADV_NO_FLAGS ;atomic_set (&bat_priv->multicast_mode,1 );atomic_set (&bat_priv->mcast.num_disabled,0 );
net/batman-adv/types.h +4 -0
@@ -772,6 +772,8 @@ struct batadv_mcast_querier_state {* multicast traffic * @want_all_ipv4_list: a list of orig_nodes wanting all IPv4 multicast traffic * @want_all_ipv6_list: a list of orig_nodes wanting all IPv6 multicast traffic +* @querier_ipv4: the current state of an IGMP querier in the mesh +* @querier_ipv6: the current state of an MLD querier in the mesh * @flags: the flags we have last sent in our mcast tvlv * @enabled: whether the multicast tvlv is currently enabled * @bridged: whether the soft interface has a bridge on top
@@ -787,6 +789,8 @@ struct batadv_priv_mcast {struct hlist_head want_all_unsnoopables_list;struct hlist_head want_all_ipv4_list;struct hlist_head want_all_ipv6_list; +struct batadv_mcast_querier_state querier_ipv4; +struct batadv_mcast_querier_state querier_ipv6;u8 flags;bool enabled;bool bridged;
Signature · 1 line
1.7.10.4
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCHv15 3/4] batman-adv: Adding logging of mcast flag changes
Quoted 5 lines · On Tuesday, May 10, 2016 18:41:26 Linus Lüssing wrote:
With this patch changes relevant to a node's own multicast flags are printed to the 'mcast' log level.
Tested-by Simon Wunderlich <[email protected]>Signed-off-by Linus Lüssing <[email protected]>
Quoted 7 lines
--- net/batman-adv/main.h | 4 +- net/batman-adv/multicast.c | 133 ++++++++++++++++++++++++++++++++++++++- net/batman-adv/soft-interface.c | 4 ++ net/batman-adv/types.h | 4 ++ 4 files changed, 142 insertions(+), 3 deletions(-)
Applied in revision ffdce4f.
Thanks,
Marek
PATCH v15 4/4 batman-adv: Add debugfs table for mcast flags
In reply to Linus LüssingThis patch adds a debugfs table with originators and their according multicast flags to help users figure out why multicast optimizations might be enabled or disabled for them.
--- net/batman-adv/debugfs.c | 23 ++++++++++ net/batman-adv/multicast.c | 104 ++++++++++++++++++++++++++++++++++++++++++++ net/batman-adv/multicast.h | 3 ++ 3 files changed, 130 insertions(+)
net/batman-adv/debugfs.c +23 -0
@@ -48,6 +48,7 @@#include "distributed-arp-table.h" #include "gateway_client.h" #include "icmp_socket.h" +#include "multicast.h" #include "network-coding.h" #include "originator.h" #include "translation-table.h"
@@ -363,6 +364,22 @@ static int batadv_nc_nodes_open(struct inode *inode, struct file *file) }#endif +#ifdef CONFIG_BATMAN_ADV_MCAST +/** +* batadv_mcast_flags_open - prepare file handler for reads from mcast_flags +* @inode: inode which was opened +* @file: file handle to be initialized +* +* Return: 0 on success or negative error number in case of failure +*/ +static int batadv_mcast_flags_open (struct inode *inode,struct file *file) +{ +struct net_device *net_dev = (struct net_device *)inode->i_private; + +return single_open (file, batadv_mcast_flags_seq_print_text, net_dev); +} +#endif +#define BATADV_DEBUGINFO (_name, _mode, _open) \ struct batadv_debuginfo batadv_debuginfo_##_name = { \ .attr = { \
@@ -407,6 +424,9 @@ static BATADV_DEBUGINFO(transtable_local, S_IRUGO,#ifdef CONFIG_BATMAN_ADV_NC static BATADV_DEBUGINFO(nc_nodes, S_IRUGO, batadv_nc_nodes_open);#endif +#ifdef CONFIG_BATMAN_ADV_MCAST +static BATADV_DEBUGINFO(mcast_flags, S_IRUGO, batadv_mcast_flags_open); +#endif static struct batadv_debuginfo *batadv_mesh_debuginfos[] = { &batadv_debuginfo_neighbors,
@@ -424,6 +444,9 @@ static struct batadv_debuginfo *batadv_mesh_debuginfos[] = {#ifdef CONFIG_BATMAN_ADV_NC &batadv_debuginfo_nc_nodes,#endif +#ifdef CONFIG_BATMAN_ADV_MCAST + &batadv_debuginfo_mcast_flags, +#endif NULL, };
net/batman-adv/multicast.c +104 -0
122 lines not on this page · raw message
net/batman-adv/multicast.h +3 -0
@@ -20,6 +20,7 @@#include "main.h" +struct seq_file ;struct sk_buff ;/**
@@ -46,6 +47,8 @@ batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,void batadv_mcast_init (struct batadv_priv *bat_priv); +int batadv_mcast_flags_seq_print_text (struct seq_file *seq,void *offset); +void batadv_mcast_free (struct batadv_priv *bat_priv);void batadv_mcast_purge_orig (struct batadv_orig_node *orig_node);
Signature · 1 line
1.7.10.4
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCHv15 4/4] batman-adv: Add debugfs table for mcast flags
Quoted 4 lines · On Tuesday, May 10, 2016 18:41:27 Linus Lüssing wrote:
This patch adds a debugfs table with originators and their according multicast flags to help users figure out why multicast optimizations might be enabled or disabled for them.
Quoted 8 lines
Tested-by Simon Wunderlich <[email protected]>Signed-off-by Linus Lüssing <[email protected]>--- net/batman-adv/debugfs.c | 23 ++++++++++ net/batman-adv/multicast.c | 104 ++++++++++++++++++++++++++++++++++++++++++++ net/batman-adv/multicast.h | 3 ++ 3 files changed, 130 insertions(+)
Applied in revision f1f0fbb.
Thanks,
Marek
Quoted 2 lines · Linus Lüssing
Changes in v15:
* [...]
* and added missing INET dependancy in Kconfig [PATCH 1/4]