pull request: batman-adv 20160109
Subsystems (4)
Hello David,
here you have a late batch of patches intended for net-next.
Most of the changes are about kerneldoc and other minor cleanups introduced by Sven Eckelmann and Marek Lindner.
Other than those you have the number of BLA wait periods increased to 6 to reduce the probability of temporary LAN loops by Simon Wunderlich.
Several useless NULL checks have been removed by Markus Elfring in order to make the code simpler and slimmer.
Another change by Simon Wunderlich makes sure that the function consuming the value written in a sysfs file is executed only when such value was really changed to a new value.
Please pull or let me know of any problem!
Thanks a lot,
Antonio
The following changes since commit d86cdfcd5d7e1179e695977b7088882822f365c4:
Merge branch 'r8152-adjustments' (2016-01-08 21:57:26 -0500)
are available in the git repository at:
git://git.open-mesh.org/linux-merge.git tags/batman-adv-for-davem
for you to fetch changes up to ed21d170e878b6b067a3216040b7b935c8007196:
batman-adv: Add kerneldoc for batadv_neigh_node::refcount (2016-01-09 20:56:00 +0800)
----------------------------------------------------------------
Included changes:
- increase internal module version
- increase BLA wait periods to 6
- purge BLA backbone table when it is disabled
- make sure post function is invoked only if sysfs value is changed
- simplify code by removing useless NULL checks
- various corrections to existing kerneldoc
- minor cleanups
----------------------------------------------------------------
Marek Lindner (1):
batman-adv: remove leftovers of unused BATADV_PRIMARIES_FIRST_HOP flag
Markus Elfring (4):
batman-adv: Delete unnecessary checks before the function call "kfree_skb"
batman-adv: Less checks in batadv_tvlv_unicast_send()
batman-adv: Delete an unnecessary check before the function call "batadv_softif_vlan_free_ref"
batman-adv: Split a condition check
Simon Wunderlich (4):
batman-adv: Start new development cycle
batman-adv: purge bridge loop avoidance when its disabled
batman-adv: increase BLA wait periods to 6
batman-adv: only call post function if something changed
Sven Eckelmann (7):
batman-adv: Fix lockdep annotation of batadv_tlv_container_remove
batman-adv: Add function to convert string to batadv throughput
batman-adv: Change ifconfig examples to iproute2
batman-adv: Fix kernel-doc parsing of main structs
batman-adv: Fix kerneldoc member names in for main structs
batman-adv: Remove kerneldoc for missing struct members
batman-adv: Add kerneldoc for batadv_neigh_node::refcount
Documentation/networking/batman-adv.txt | 9 ++- net/batman-adv/bat_iv_ogm.c | 3 - net/batman-adv/bridge_loop_avoidance.c | 20 ++++++ net/batman-adv/bridge_loop_avoidance.h | 2 + net/batman-adv/gateway_common.c | 117 +++++++++++++------------------- net/batman-adv/main.c | 17 ++--- net/batman-adv/main.h | 4 +- net/batman-adv/network-coding.c | 4 +- net/batman-adv/packet.h | 3 +- net/batman-adv/send.c | 3 +- net/batman-adv/sysfs.c | 16 +++-- net/batman-adv/translation-table.c | 8 ++- net/batman-adv/types.h | 32 +++++---- 13 files changed, 122 insertions(+), 116 deletions(-)
PATCH 1/16 batman-adv: Start new development cycle
From: Simon Wunderlich <[email protected]>
--- net/batman-adv/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/main.h +1 -1
@@ -24,7 +24,7 @@#define BATADV_DRIVER_DEVICE "batman-adv"#ifndef BATADV_SOURCE_VERSION -#define BATADV_SOURCE_VERSION "2015.2" +#define BATADV_SOURCE_VERSION "2016.0"#endif /* B.A.T.M.A.N. parameters */
Signature · 1 line
2.7.0
PATCH 2/16 batman-adv: Fix lockdep annotation of batadv_tlv_container_remove
In reply to Antonio QuartulliFrom: Sven Eckelmann <[email protected]>
The function handles tlv containers and not tlv handlers. Thus the lockdep_assert_held has to check for the container_list lock.
--- net/batman-adv/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/main.c +1 -1
@@ -747,7 +747,7 @@ static u16 batadv_tvlv_container_list_size(struct batadv_priv *bat_priv)static void batadv_tvlv_container_remove (struct batadv_priv *bat_priv,struct batadv_tvlv_container *tvlv) { -lockdep_assert_held (&bat_priv->tvlv.handler_list_lock); +lockdep_assert_held (&bat_priv->tvlv.container_list_lock);if (!tvlv)return ;
Signature · 1 line
2.7.0
PATCH 3/16 batman-adv: remove leftovers of unused BATADV_PRIMARIES_FIRST_HOP flag
In reply to Antonio QuartulliFrom: Marek Lindner <[email protected]>
--- net/batman-adv/bat_iv_ogm.c | 3 --- net/batman-adv/packet.h | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-)
net/batman-adv/bat_iv_ogm.c +0 -3
@@ -361,7 +361,6 @@ batadv_iv_ogm_primary_iface_set(struct batadv_hard_iface *hard_iface)unsigned char *ogm_buff = hard_iface->bat_iv.ogm_buff; batadv_ogm_packet = (struct batadv_ogm_packet *)ogm_buff; - batadv_ogm_packet->flags =BATADV_PRIMARIES_FIRST_HOP ; batadv_ogm_packet->ttl =BATADV_TTL ; }
@@ -842,8 +841,6 @@ static void batadv_iv_ogm_forward(struct batadv_orig_node *orig_node,"Forwarding packet: tq: %i, ttl: %i\n" , batadv_ogm_packet->tq, batadv_ogm_packet->ttl); -/* switch of primaries first hop flag when forwarding */ - batadv_ogm_packet->flags &= ~BATADV_PRIMARIES_FIRST_HOP ;if (is_single_hop_neigh) batadv_ogm_packet->flags |=BATADV_DIRECTLINK ;else
net/batman-adv/packet.h +1 -2
@@ -72,8 +72,7 @@ enum batadv_subtype {* enum batadv_iv_flags - flags used in B.A.T.M.A.N. IV OGM packets * @BATADV_NOT_BEST_NEXT_HOP: flag is set when ogm packet is forwarded and was * previously received from someone else than the best neighbor. -* @BATADV_PRIMARIES_FIRST_HOP: flag is set when the primary interface address -* is used, and the packet travels its first hop. +* @BATADV_PRIMARIES_FIRST_HOP: flag unused. * @BATADV_DIRECTLINK: flag is for the first hop or if rebroadcasted from a * one hop neighbor on the interface where it was originally received. */
Signature · 1 line
2.7.0
PATCH 4/16 batman-adv: purge bridge loop avoidance when its disabled
In reply to Antonio QuartulliFrom: Simon Wunderlich <[email protected]>
When bridge loop avoidance is disabled through sysfs, the internal datastructures are not disabled, but only BLA operations are disabled. To be sure that they are removed, purge the data immediately. That is especially useful if a firmwares network state is changed, and the BLA wait periods should restart on the new network.
--- net/batman-adv/bridge_loop_avoidance.c | 20 ++++++++++++++++++++ net/batman-adv/bridge_loop_avoidance.h | 2 ++ net/batman-adv/sysfs.c | 4 +++- 3 files changed, 25 insertions(+), 1 deletion(-)
net/batman-adv/bridge_loop_avoidance.c +20 -0
@@ -1168,6 +1168,26 @@ void batadv_bla_update_orig_address(struct batadv_priv *bat_priv, } } +/** +* batadv_bla_status_update - purge bla interfaces if necessary +* @net_dev: the soft interface net device +*/ +void batadv_bla_status_update (struct net_device *net_dev) +{ +struct batadv_priv *bat_priv =netdev_priv (net_dev); +struct batadv_hard_iface *primary_if; + + primary_if =batadv_primary_if_get_selected (bat_priv); +if (!primary_if) +return ; + +/* this function already purges everything when bla is disabled, +* so just call that one. +*/ +batadv_bla_update_orig_address (bat_priv, primary_if, primary_if); +batadv_hardif_free_ref (primary_if); +} +/* periodic work to do: * * purge structures when they are too old * * send announcements
net/batman-adv/bridge_loop_avoidance.h +2 -0
@@ -22,6 +22,7 @@#include <linux/types.h> +struct net_device ;struct seq_file ;struct sk_buff ;
@@ -42,6 +43,7 @@ int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,void batadv_bla_update_orig_address (struct batadv_priv *bat_priv,struct batadv_hard_iface *primary_if,struct batadv_hard_iface *oldif); +void batadv_bla_status_update (struct net_device *net_dev);int batadv_bla_init (struct batadv_priv *bat_priv);void batadv_bla_free (struct batadv_priv *bat_priv);
net/batman-adv/sysfs.c +3 -1
@@ -40,6 +40,7 @@#include "distributed-arp-table.h" #include "gateway_client.h" #include "gateway_common.h" +#include "bridge_loop_avoidance.h" #include "hard-interface.h" #include "network-coding.h" #include "packet.h"
@@ -549,7 +550,8 @@ static ssize_t batadv_store_isolation_mark(struct kobject *kobj,BATADV_ATTR_SIF_BOOL (aggregated_ogms,S_IRUGO |S_IWUSR ,NULL );BATADV_ATTR_SIF_BOOL (bonding,S_IRUGO |S_IWUSR ,NULL );#ifdef CONFIG_BATMAN_ADV_BLA -BATADV_ATTR_SIF_BOOL (bridge_loop_avoidance,S_IRUGO |S_IWUSR ,NULL ); +BATADV_ATTR_SIF_BOOL (bridge_loop_avoidance,S_IRUGO |S_IWUSR , + batadv_bla_status_update);#endif #ifdef CONFIG_BATMAN_ADV_DAT BATADV_ATTR_SIF_BOOL(distributed_arp_table, S_IRUGO | S_IWUSR,
Signature · 1 line
2.7.0
PATCH 5/16 batman-adv: increase BLA wait periods to 6
In reply to Antonio QuartulliFrom: Simon Wunderlich <[email protected]>
If networks take a long time to come up, e.g. due to lossy links, then the bridge loop avoidance wait time to suppress broadcasts may not wait long enough and detect a backbone before the mesh is brought up. Increasing the wait period further to 60 seconds makes this scenario less likely.
--- net/batman-adv/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/main.h +1 -1
@@ -109,7 +109,7 @@#define BATADV_MAX_AGGREGATION_MS 100#define BATADV_BLA_PERIOD_LENGTH 10000/* 10 seconds */ -#define BATADV_BLA_BACKBONE_TIMEOUT (BATADV_BLA_PERIOD_LENGTH * 3) +#define BATADV_BLA_BACKBONE_TIMEOUT (BATADV_BLA_PERIOD_LENGTH * 6)#define BATADV_BLA_CLAIM_TIMEOUT (BATADV_BLA_PERIOD_LENGTH * 10)#define BATADV_BLA_WAIT_PERIODS 3
Signature · 1 line
2.7.0
PATCH 6/16 batman-adv: only call post function if something changed
In reply to Antonio QuartulliFrom: Simon Wunderlich <[email protected]>
Currently, the post function is also called on errors or if there were no changes, which is redundant for the functions currently using these facilities.
--- net/batman-adv/sysfs.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
net/batman-adv/sysfs.c +9 -3
@@ -242,10 +242,13 @@ ssize_t batadv_show_vlan_##_name(struct kobject *kobj, \static int batadv_store_bool_attr (char *buff,size_t count,struct net_device *net_dev, -const char *attr_name,atomic_t *attr) +const char *attr_name,atomic_t *attr, +bool *changed) {int enabled =-1 ; + *changed = false; +if (buff[count -1 ] =='\n' ) buff[count -1 ] ='\0' ;
@@ -272,6 +275,8 @@ static int batadv_store_bool_attr(char *buff, size_t count,atomic_read (attr) ==1 ?"enabled" :"disabled" , enabled == 1 ? "enabled" : "disabled"); + *changed = true; +atomic_set (attr, (unsigned int )enabled);return count; }
@@ -282,11 +287,12 @@ __batadv_store_bool_attr(char *buff, size_t count,struct attribute *attr, atomic_t *attr_store, struct net_device *net_dev) { + bool changed;int ret; ret =batadv_store_bool_attr (buff, count, net_dev, attr->name, - attr_store); -if (post_func && ret) + attr_store, &changed); +if (post_func && changed)post_func (net_dev);return ret;
Signature · 1 line
2.7.0
PATCH 7/16 batman-adv: Add function to convert string to batadv throughput
In reply to Antonio QuartulliFrom: Sven Eckelmann <[email protected]>
The code to convert the throughput information from a string to the batman-adv internal (100Kibit/s) representation is duplicated in batadv_parse_gw_bandwidth. Move this functionality to its own function batadv_parse_throughput to reduce the code complexity.
--- net/batman-adv/gateway_common.c | 121 +++++++++++++++++----------------------- 1 file changed, 51 insertions(+), 70 deletions(-)
net/batman-adv/gateway_common.c +51 -70
@@ -31,27 +31,23 @@#include "packet.h" /** -* batadv_parse_gw_bandwidth - parse supplied string buffer to extract download -* and upload bandwidth information +* batadv_parse_throughput - parse supplied string buffer to extract throughput +* information * @net_dev: the soft interface net device * @buff: string buffer to parse -* @down: pointer holding the returned download bandwidth information -* @up: pointer holding the returned upload bandwidth information +* @description: text shown when throughput string cannot be parsed +* @throughput: pointer holding the returned throughput information * * Returns false on parse error and true otherwise. */ -static bool batadv_parse_gw_bandwidth (struct net_device *net_dev,char *buff, -u32 *down,u32 *up) +static bool batadv_parse_throughput (struct net_device *net_dev,char *buff, +const char *description,u32 *throughput) {enum batadv_bandwidth_units bw_unit_type =BATADV_BW_UNIT_KBIT ; -char *slash_ptr, *tmp_ptr; -u64 ldown, lup; +u64 lthroughput; +char *tmp_ptr;int ret; - slash_ptr =strchr (buff,'/' ); -if (slash_ptr) - *slash_ptr =0 ; -if (strlen (buff) >4 ) { tmp_ptr = buff +strlen (buff) -4 ;
@@ -63,90 +59,75 @@ static bool batadv_parse_gw_bandwidth(struct net_device *net_dev, char *buff, *tmp_ptr ='\0' ; } - ret =kstrtou64 (buff,10 , &ldown); + ret =kstrtou64 (buff,10 , <hroughput);if (ret) {batadv_err (net_dev, -"Download speed of gateway mode invalid: %s\n" , - buff); +"Invalid throughput speed for %s: %s\n" , + description, buff);return false; }switch (bw_unit_type) {case BATADV_BW_UNIT_MBIT :/* prevent overflow */ -if (U64_MAX /10 < ldown) { +if (U64_MAX /10 < lthroughput) {batadv_err (net_dev, -"Download speed of gateway mode too large: %s\n" , - buff); +"Throughput speed for %s too large: %s\n" , + description, buff);return false; } - ldown *=10 ; + lthroughput *=10 ;break ;case BATADV_BW_UNIT_KBIT :default : - ldown =div_u64 (ldown,100 ); + lthroughput =div_u64 (lthroughput,100 );break ; } -if (U32_MAX < ldown) { +if (lthroughput >U32_MAX ) {batadv_err (net_dev, -"Download speed of gateway mode too large: %s\n" , - buff); +"Throughput speed for %s too large: %s\n" , + description, buff);return false; } - *down = ldown; + *throughput = lthroughput; + +return true; +} + +/** +* batadv_parse_gw_bandwidth - parse supplied string buffer to extract download +* and upload bandwidth information +* @net_dev: the soft interface net device +* @buff: string buffer to parse +* @down: pointer holding the returned download bandwidth information +* @up: pointer holding the returned upload bandwidth information +* +* Return: false on parse error and true otherwise. +*/ +static bool batadv_parse_gw_bandwidth (struct net_device *net_dev,char *buff, +u32 *down,u32 *up) +{ +char *slash_ptr; +bool ret; + + slash_ptr =strchr (buff,'/' ); +if (slash_ptr) + *slash_ptr =0 ; + + ret =batadv_parse_throughput (net_dev, buff,"download gateway speed" , + down); +if (!ret) +return false;/* we also got some upload info */ if (slash_ptr) { - bw_unit_type =BATADV_BW_UNIT_KBIT ; - -if (strlen (slash_ptr +1 ) >4 ) { - tmp_ptr = slash_ptr +1 -4 +strlen (slash_ptr +1 ); - -if (strncasecmp (tmp_ptr,"mbit" ,4 ) ==0 ) - bw_unit_type =BATADV_BW_UNIT_MBIT ; - -if ((strncasecmp (tmp_ptr,"kbit" ,4 ) ==0 ) || - (bw_unit_type ==BATADV_BW_UNIT_MBIT )) - *tmp_ptr ='\0' ; - } - - ret =kstrtou64 (slash_ptr +1 ,10 , &lup); -if (ret) { -batadv_err (net_dev, -"Upload speed of gateway mode invalid: %s\n" , - slash_ptr +1 ); + ret =batadv_parse_throughput (net_dev, slash_ptr +1 , +"upload gateway speed" , up); +if (!ret)return false; - } - -switch (bw_unit_type) { -case BATADV_BW_UNIT_MBIT : -/* prevent overflow */ -if (U64_MAX /10 < lup) { -batadv_err (net_dev, -"Upload speed of gateway mode too large: %s\n" , - slash_ptr +1 ); -return false; - } - - lup *=10 ; -break ; -case BATADV_BW_UNIT_KBIT : -default : - lup =div_u64 (lup,100 ); -break ; - } - -if (U32_MAX < lup) { -batadv_err (net_dev, -"Upload speed of gateway mode too large: %s\n" , - slash_ptr +1 ); -return false; - } - - *up = lup; }return true;
Signature · 1 line
2.7.0
PATCH 8/16 batman-adv: Delete unnecessary checks before the function call "kfree_skb"
In reply to Antonio QuartulliFrom: Markus Elfring <[email protected]>
The kfree_skb() function tests whether its argument is NULL and then returns immediately. Thus the test around the calls is not needed.
This issue was detected by using the Coccinelle software.
--- net/batman-adv/main.c | 2 +- net/batman-adv/network-coding.c | 4 +--- net/batman-adv/send.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-)
net/batman-adv/main.c +1 -1
@@ -1184,7 +1184,7 @@ void batadv_tvlv_unicast_send(struct batadv_priv *bat_priv, u8 *src, ret = true; out: -if (skb && !ret) +if (!ret)kfree_skb (skb);if (orig_node)batadv_orig_node_free_ref (orig_node);
net/batman-adv/network-coding.c +1 -3
@@ -244,9 +244,7 @@ static void batadv_nc_path_free_ref(struct batadv_nc_path *nc_path)*/ static void batadv_nc_packet_free (struct batadv_nc_packet *nc_packet) { -if (nc_packet->skb) -kfree_skb (nc_packet->skb); - +kfree_skb (nc_packet->skb);batadv_nc_path_free_ref (nc_packet->nc_path);kfree (nc_packet); }
net/batman-adv/send.c +1 -2
@@ -407,8 +407,7 @@ void batadv_schedule_bat_ogm(struct batadv_hard_iface *hard_iface)static void batadv_forw_packet_free (struct batadv_forw_packet *forw_packet) { -if (forw_packet->skb) -kfree_skb (forw_packet->skb); +kfree_skb (forw_packet->skb);if (forw_packet->if_incoming)batadv_hardif_free_ref (forw_packet->if_incoming);if (forw_packet->if_outgoing)
Signature · 1 line
2.7.0
PATCH 9/16 batman-adv: Less checks in batadv_tvlv_unicast_send()
In reply to Antonio QuartulliFrom: Markus Elfring <[email protected]>
* Let us return directly if a call of the batadv_orig_hash_find() function returned a null pointer.
* Omit the initialisation for the variable "skb" at the beginning.
* Replace an assignment by a call of the kfree_skb() function and delete the affected variable "ret" then.
--- net/batman-adv/main.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
net/batman-adv/main.c +5 -10
@@ -1143,15 +1143,14 @@ void batadv_tvlv_unicast_send(struct batadv_priv *bat_priv, u8 *src,struct batadv_unicast_tvlv_packet *unicast_tvlv_packet;struct batadv_tvlv_hdr *tvlv_hdr;struct batadv_orig_node *orig_node; -struct sk_buff *skb =NULL ; +struct sk_buff *skb;unsigned char *tvlv_buff;unsigned int tvlv_len;ssize_t hdr_len =sizeof (*unicast_tvlv_packet); -bool ret = false; orig_node =batadv_orig_hash_find (bat_priv, dst);if (!orig_node) - goto out; +return ; tvlv_len =sizeof (*tvlv_hdr) + tvlv_value_len;
@@ -1180,14 +1179,10 @@ void batadv_tvlv_unicast_send(struct batadv_priv *bat_priv, u8 *src, tvlv_buff +=sizeof (*tvlv_hdr);memcpy (tvlv_buff, tvlv_value, tvlv_value_len); -if (batadv_send_skb_to_orig (skb, orig_node,NULL ) !=NET_XMIT_DROP ) - ret = true; - -out: -if (!ret) +if (batadv_send_skb_to_orig (skb, orig_node,NULL ) ==NET_XMIT_DROP )kfree_skb (skb); -if (orig_node) -batadv_orig_node_free_ref (orig_node); +out: +batadv_orig_node_free_ref (orig_node); }/**
Signature · 1 line
2.7.0
PATCH 10/16 batman-adv: Delete an unnecessary check before the function call "batadv_softif_vlan_free_ref"
In reply to Antonio QuartulliFrom: Markus Elfring <[email protected]>
The batadv_softif_vlan_free_ref() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
--- net/batman-adv/translation-table.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/batman-adv/translation-table.c +1 -2
@@ -3356,8 +3356,7 @@ bool batadv_is_ap_isolated(struct batadv_priv *bat_priv, u8 *src, u8 *dst, ret = true; out: -if (vlan) -batadv_softif_vlan_free_ref (vlan); +batadv_softif_vlan_free_ref (vlan);if (tt_global_entry)batadv_tt_global_entry_free_ref (tt_global_entry);if (tt_local_entry)
Signature · 1 line
2.7.0
PATCH 11/16 batman-adv: Split a condition check
In reply to Antonio QuartulliFrom: Markus Elfring <[email protected]>
Let us split a check for a condition at the beginning of the batadv_is_ap_isolated() function so that a direct return can be performed in this function if the variable "vlan" contained a null pointer.
--- net/batman-adv/translation-table.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/batman-adv/translation-table.c +4 -1
@@ -3339,7 +3339,10 @@ bool batadv_is_ap_isolated(struct batadv_priv *bat_priv, u8 *src, u8 *dst,bool ret = false; vlan =batadv_softif_vlan_get (bat_priv, vid); -if (!vlan || !atomic_read (&vlan->ap_isolation)) +if (!vlan) +return false; + +if (!atomic_read (&vlan->ap_isolation)) goto out; tt_local_entry =batadv_tt_local_hash_find (bat_priv, dst, vid);
Signature · 1 line
2.7.0
PATCH 12/16 batman-adv: Change ifconfig examples to iproute2
In reply to Antonio QuartulliFrom: Sven Eckelmann <[email protected]>
--- Documentation/networking/batman-adv.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Documentation/networking/batman-adv.txt +6 -3
@@ -115,14 +115,17 @@ The "bat0" interface can be used like any other regular inter- face. It needs an IP address which can be either statically con- figured or dynamically (by using DHCP or similar services): -# NodeA: ifconfig bat0 192.168.0.1 -# NodeB: ifconfig bat0 192.168.0.2 +# NodeA: ip link set up dev bat0 +# NodeA: ip addr add 192.168.0.1/24 dev bat0 + +# NodeB: ip link set up dev bat0 +# NodeB: ip addr add 192.168.0.2/24 dev bat0 # NodeB: ping 192.168.0.1 Note: In order to avoid problems remove all IP addresses previ- ously assigned to interfaces now used by batman advanced, e.g. -# ifconfig eth0 0.0.0.0 +# ip addr flush dev eth0 LOGGING/DEBUGGING
Signature · 1 line
2.7.0
PATCH 13/16 batman-adv: Fix kernel-doc parsing of main structs
In reply to Antonio QuartulliFrom: Sven Eckelmann <[email protected]>
kernel-doc is not able to skip an #ifdef between the kernel documentation block and the start of the struct. Moving the #ifdef before the kernel doc block avoids this problem
--- net/batman-adv/types.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
net/batman-adv/types.h +10 -5
@@ -423,13 +423,14 @@ struct batadv_neigh_ifinfo {struct rcu_head rcu; }; +#ifdef CONFIG_BATMAN_ADV_BLA + /** * struct batadv_bcast_duplist_entry - structure for LAN broadcast suppression * @orig[ETH_ALEN]: mac address of orig node orginating the broadcast * @crc: crc32 checksum of broadcast payload * @entrytime: time when the broadcast packet was received */ -#ifdef CONFIG_BATMAN_ADV_BLA struct batadv_bcast_duplist_entry { u8 orig[ETH_ALEN]; __be32 crc;
@@ -571,6 +572,8 @@ struct batadv_priv_tt {struct delayed_work work; }; +#ifdef CONFIG_BATMAN_ADV_BLA +/** * struct batadv_priv_bla - per mesh interface bridge loope avoidance data * @num_requests; number of bla requests in flight
@@ -583,7 +586,6 @@ struct batadv_priv_tt {* @claim_dest: local claim data (e.g. claim group) * @work: work queue callback item for cleanups & bla announcements */ -#ifdef CONFIG_BATMAN_ADV_BLAstruct batadv_priv_bla {atomic_t num_requests;struct batadv_hashtable *claim_hash;
@@ -597,6 +599,8 @@ struct batadv_priv_bla { };#endif +#ifdef CONFIG_BATMAN_ADV_DEBUG +/** * struct batadv_priv_debug_log - debug logging data * @log_buff: buffer holding the logs (ring bufer)
@@ -605,7 +609,6 @@ struct batadv_priv_bla {* @lock: lock protecting log_buff, log_start & log_end * @queue_wait: log reader's wait queue */ -#ifdef CONFIG_BATMAN_ADV_DEBUGstruct batadv_priv_debug_log {char log_buff[BATADV_LOG_BUF_LEN ];unsigned long log_start;
@@ -647,13 +650,14 @@ struct batadv_priv_tvlv {spinlock_t handler_list_lock;/* protects handler_list */ }; +#ifdef CONFIG_BATMAN_ADV_DAT + /** * struct batadv_priv_dat - per mesh interface DAT private data * @addr: node DAT address * @hash: hashtable representing the local ARP cache * @work: work queue callback item for cache purging */ -#ifdef CONFIG_BATMAN_ADV_DAT struct batadv_priv_dat { batadv_dat_addr_t addr; struct batadv_hashtable *hash;
@@ -893,6 +897,8 @@ struct batadv_socket_packet {u8 icmp_packet[BATADV_ICMP_MAX_PACKET_SIZE ]; }; +#ifdef CONFIG_BATMAN_ADV_BLA +/** * struct batadv_bla_backbone_gw - batman-adv gateway bridged into the LAN * @orig: originator address of backbone node (mac address of primary iface)
@@ -910,7 +916,6 @@ struct batadv_socket_packet {* @refcount: number of contexts the object is used * @rcu: struct used for freeing in an RCU-safe manner */ -#ifdef CONFIG_BATMAN_ADV_BLAstruct batadv_bla_backbone_gw {u8 orig[ETH_ALEN ];unsigned short vid;
Signature · 1 line
2.7.0
PATCH 14/16 batman-adv: Fix kerneldoc member names in for main structs
In reply to Antonio QuartulliFrom: Sven Eckelmann <[email protected]>
--- net/batman-adv/types.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
net/batman-adv/types.h +6 -6
@@ -223,12 +223,12 @@ struct batadv_orig_bat_iv {* @orig: originator ethernet address * @ifinfo_list: list for routers per outgoing interface * @last_bonding_candidate: pointer to last ifinfo of last used router -* @batadv_dat_addr_t: address of the orig node in the distributed hash +* @dat_addr: address of the orig node in the distributed hash * @last_seen: time when last packet from this node was received * @bcast_seqno_reset: time when the broadcast seqno window was reset * @mcast_handler_lock: synchronizes mcast-capability and -flag changes * @mcast_flags: multicast flags announced by the orig node -* @mcast_want_all_unsnoop_node: a list node for the +* @mcast_want_all_unsnoopables_node: a list node for the * mcast.want_all_unsnoopables list * @mcast_want_all_ipv4_node: a list node for the mcast.want_all_ipv4 list * @mcast_want_all_ipv6_node: a list node for the mcast.want_all_ipv6 list
@@ -427,7 +427,7 @@ struct batadv_neigh_ifinfo {/** * struct batadv_bcast_duplist_entry - structure for LAN broadcast suppression -* @orig[ETH_ALEN]: mac address of orig node orginating the broadcast +* @orig: mac address of orig node orginating the broadcast * @crc: crc32 checksum of broadcast payload * @entrytime: time when the broadcast packet was received */
@@ -576,7 +576,7 @@ struct batadv_priv_tt {/** * struct batadv_priv_bla - per mesh interface bridge loope avoidance data -* @num_requests; number of bla requests in flight +* @num_requests: number of bla requests in flight * @claim_hash: hash table containing mesh nodes this host has claimed * @backbone_hash: hash table containing all detected backbone gateways * @bcast_duplist: recently received broadcast packets array (for broadcast
@@ -799,7 +799,7 @@ struct batadv_softif_vlan {* @dat: distributed arp table data * @mcast: multicast data * @network_coding: bool indicating whether network coding is enabled -* @batadv_priv_nc: network coding data +* @nc: network coding data */ struct batadv_priv {atomic_t mesh_state;
@@ -934,7 +934,7 @@ struct batadv_bla_backbone_gw {* struct batadv_bla_claim - claimed non-mesh client structure * @addr: mac address of claimed non-mesh client * @vid: vlan id this client was detected on -* @batadv_bla_backbone_gw: pointer to backbone gw claiming this client +* @backbone_gw: pointer to backbone gw claiming this client * @lasttime: last time we heard of claim (locals only) * @hash_entry: hlist node for batadv_priv_bla::claim_hash * @refcount: number of contexts the object is used
Signature · 1 line
2.7.0
PATCH 15/16 batman-adv: Remove kerneldoc for missing struct members
In reply to Antonio QuartulliFrom: Sven Eckelmann <[email protected]>
--- net/batman-adv/types.h | 4 ---- 1 file changed, 4 deletions(-)
net/batman-adv/types.h +0 -4
@@ -371,9 +371,7 @@ struct batadv_hardif_neigh_node {* @ifinfo_lock: lock protecting private ifinfo members and list * @if_incoming: pointer to incoming hard interface * @last_seen: when last packet via this neighbor was received -* @last_ttl: last received ttl from this neigh node * @rcu: struct used for freeing in an RCU-safe manner -* @bat_iv: B.A.T.M.A.N. IV private structure */ struct batadv_neigh_node {struct hlist_node list;
@@ -1257,8 +1255,6 @@ struct batadv_dat_candidate {* struct batadv_tvlv_container - container for tvlv appended to OGMs * @list: hlist node for batadv_priv_tvlv::container_list * @tvlv_hdr: tvlv header information needed to construct the tvlv -* @value_len: length of the buffer following this struct which contains -* the actual tvlv payload * @refcount: number of contexts the object is used */ struct batadv_tvlv_container {
Signature · 1 line
2.7.0
PATCH 16/16 batman-adv: Add kerneldoc for batadv_neigh_node::refcount
In reply to Antonio QuartulliFrom: Sven Eckelmann <[email protected]>
--- net/batman-adv/types.h | 1 + 1 file changed, 1 insertion(+)
net/batman-adv/types.h +1 -0
@@ -371,6 +371,7 @@ struct batadv_hardif_neigh_node {* @ifinfo_lock: lock protecting private ifinfo members and list * @if_incoming: pointer to incoming hard interface * @last_seen: when last packet via this neighbor was received +* @refcount: number of contexts the object is used * @rcu: struct used for freeing in an RCU-safe manner */ struct batadv_neigh_node {
Signature · 1 line
2.7.0
PATCH 1/16 batman-adv: Start new development cycle
In reply to Antonio QuartulliFrom: Simon Wunderlich <[email protected]>
--- net/batman-adv/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/main.h +1 -1
@@ -24,7 +24,7 @@#define BATADV_DRIVER_DEVICE "batman-adv"#ifndef BATADV_SOURCE_VERSION -#define BATADV_SOURCE_VERSION "2015.2" +#define BATADV_SOURCE_VERSION "2016.0"#endif /* B.A.T.M.A.N. parameters */
Signature · 1 line
2.7.0
PATCH 2/16 batman-adv: Fix lockdep annotation of batadv_tlv_container_remove
In reply to Antonio QuartulliFrom: Sven Eckelmann <[email protected]>
The function handles tlv containers and not tlv handlers. Thus the lockdep_assert_held has to check for the container_list lock.
--- net/batman-adv/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/main.c +1 -1
@@ -747,7 +747,7 @@ static u16 batadv_tvlv_container_list_size(struct batadv_priv *bat_priv)static void batadv_tvlv_container_remove (struct batadv_priv *bat_priv,struct batadv_tvlv_container *tvlv) { -lockdep_assert_held (&bat_priv->tvlv.handler_list_lock); +lockdep_assert_held (&bat_priv->tvlv.container_list_lock);if (!tvlv)return ;
Signature · 1 line
2.7.0
PATCH 14/16 batman-adv: Fix kerneldoc member names in for main structs
In reply to Antonio QuartulliFrom: Sven Eckelmann <[email protected]>
--- net/batman-adv/types.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
net/batman-adv/types.h +6 -6
@@ -223,12 +223,12 @@ struct batadv_orig_bat_iv {* @orig: originator ethernet address * @ifinfo_list: list for routers per outgoing interface * @last_bonding_candidate: pointer to last ifinfo of last used router -* @batadv_dat_addr_t: address of the orig node in the distributed hash +* @dat_addr: address of the orig node in the distributed hash * @last_seen: time when last packet from this node was received * @bcast_seqno_reset: time when the broadcast seqno window was reset * @mcast_handler_lock: synchronizes mcast-capability and -flag changes * @mcast_flags: multicast flags announced by the orig node -* @mcast_want_all_unsnoop_node: a list node for the +* @mcast_want_all_unsnoopables_node: a list node for the * mcast.want_all_unsnoopables list * @mcast_want_all_ipv4_node: a list node for the mcast.want_all_ipv4 list * @mcast_want_all_ipv6_node: a list node for the mcast.want_all_ipv6 list
@@ -427,7 +427,7 @@ struct batadv_neigh_ifinfo {/** * struct batadv_bcast_duplist_entry - structure for LAN broadcast suppression -* @orig[ETH_ALEN]: mac address of orig node orginating the broadcast +* @orig: mac address of orig node orginating the broadcast * @crc: crc32 checksum of broadcast payload * @entrytime: time when the broadcast packet was received */
@@ -576,7 +576,7 @@ struct batadv_priv_tt {/** * struct batadv_priv_bla - per mesh interface bridge loope avoidance data -* @num_requests; number of bla requests in flight +* @num_requests: number of bla requests in flight * @claim_hash: hash table containing mesh nodes this host has claimed * @backbone_hash: hash table containing all detected backbone gateways * @bcast_duplist: recently received broadcast packets array (for broadcast
@@ -799,7 +799,7 @@ struct batadv_softif_vlan {* @dat: distributed arp table data * @mcast: multicast data * @network_coding: bool indicating whether network coding is enabled -* @batadv_priv_nc: network coding data +* @nc: network coding data */ struct batadv_priv {atomic_t mesh_state;
@@ -934,7 +934,7 @@ struct batadv_bla_backbone_gw {* struct batadv_bla_claim - claimed non-mesh client structure * @addr: mac address of claimed non-mesh client * @vid: vlan id this client was detected on -* @batadv_bla_backbone_gw: pointer to backbone gw claiming this client +* @backbone_gw: pointer to backbone gw claiming this client * @lasttime: last time we heard of claim (locals only) * @hash_entry: hlist node for batadv_priv_bla::claim_hash * @refcount: number of contexts the object is used
Signature · 1 line
2.7.0
PATCH 12/16 batman-adv: Change ifconfig examples to iproute2
In reply to Antonio QuartulliFrom: Sven Eckelmann <[email protected]>
--- Documentation/networking/batman-adv.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Documentation/networking/batman-adv.txt +6 -3
@@ -115,14 +115,17 @@ The "bat0" interface can be used like any other regular inter- face. It needs an IP address which can be either statically con- figured or dynamically (by using DHCP or similar services): -# NodeA: ifconfig bat0 192.168.0.1 -# NodeB: ifconfig bat0 192.168.0.2 +# NodeA: ip link set up dev bat0 +# NodeA: ip addr add 192.168.0.1/24 dev bat0 + +# NodeB: ip link set up dev bat0 +# NodeB: ip addr add 192.168.0.2/24 dev bat0 # NodeB: ping 192.168.0.1 Note: In order to avoid problems remove all IP addresses previ- ously assigned to interfaces now used by batman advanced, e.g. -# ifconfig eth0 0.0.0.0 +# ip addr flush dev eth0 LOGGING/DEBUGGING
Signature · 1 line
2.7.0
PATCH 10/16 batman-adv: Delete an unnecessary check before the function call "batadv_softif_vlan_free_ref"
In reply to Antonio QuartulliFrom: Markus Elfring <[email protected]>
The batadv_softif_vlan_free_ref() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
--- net/batman-adv/translation-table.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/batman-adv/translation-table.c +1 -2
@@ -3356,8 +3356,7 @@ bool batadv_is_ap_isolated(struct batadv_priv *bat_priv, u8 *src, u8 *dst, ret = true; out: -if (vlan) -batadv_softif_vlan_free_ref (vlan); +batadv_softif_vlan_free_ref (vlan);if (tt_global_entry)batadv_tt_global_entry_free_ref (tt_global_entry);if (tt_local_entry)
Signature · 1 line
2.7.0
PATCH 15/16 batman-adv: Remove kerneldoc for missing struct members
In reply to Antonio QuartulliFrom: Sven Eckelmann <[email protected]>
--- net/batman-adv/types.h | 4 ---- 1 file changed, 4 deletions(-)
net/batman-adv/types.h +0 -4
@@ -371,9 +371,7 @@ struct batadv_hardif_neigh_node {* @ifinfo_lock: lock protecting private ifinfo members and list * @if_incoming: pointer to incoming hard interface * @last_seen: when last packet via this neighbor was received -* @last_ttl: last received ttl from this neigh node * @rcu: struct used for freeing in an RCU-safe manner -* @bat_iv: B.A.T.M.A.N. IV private structure */ struct batadv_neigh_node {struct hlist_node list;
@@ -1257,8 +1255,6 @@ struct batadv_dat_candidate {* struct batadv_tvlv_container - container for tvlv appended to OGMs * @list: hlist node for batadv_priv_tvlv::container_list * @tvlv_hdr: tvlv header information needed to construct the tvlv -* @value_len: length of the buffer following this struct which contains -* the actual tvlv payload * @refcount: number of contexts the object is used */ struct batadv_tvlv_container {
Signature · 1 line
2.7.0
PATCH 13/16 batman-adv: Fix kernel-doc parsing of main structs
In reply to Antonio QuartulliFrom: Sven Eckelmann <[email protected]>
kernel-doc is not able to skip an #ifdef between the kernel documentation block and the start of the struct. Moving the #ifdef before the kernel doc block avoids this problem
--- net/batman-adv/types.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
net/batman-adv/types.h +10 -5
@@ -423,13 +423,14 @@ struct batadv_neigh_ifinfo {struct rcu_head rcu; }; +#ifdef CONFIG_BATMAN_ADV_BLA + /** * struct batadv_bcast_duplist_entry - structure for LAN broadcast suppression * @orig[ETH_ALEN]: mac address of orig node orginating the broadcast * @crc: crc32 checksum of broadcast payload * @entrytime: time when the broadcast packet was received */ -#ifdef CONFIG_BATMAN_ADV_BLA struct batadv_bcast_duplist_entry { u8 orig[ETH_ALEN]; __be32 crc;
@@ -571,6 +572,8 @@ struct batadv_priv_tt {struct delayed_work work; }; +#ifdef CONFIG_BATMAN_ADV_BLA +/** * struct batadv_priv_bla - per mesh interface bridge loope avoidance data * @num_requests; number of bla requests in flight
@@ -583,7 +586,6 @@ struct batadv_priv_tt {* @claim_dest: local claim data (e.g. claim group) * @work: work queue callback item for cleanups & bla announcements */ -#ifdef CONFIG_BATMAN_ADV_BLAstruct batadv_priv_bla {atomic_t num_requests;struct batadv_hashtable *claim_hash;
@@ -597,6 +599,8 @@ struct batadv_priv_bla { };#endif +#ifdef CONFIG_BATMAN_ADV_DEBUG +/** * struct batadv_priv_debug_log - debug logging data * @log_buff: buffer holding the logs (ring bufer)
@@ -605,7 +609,6 @@ struct batadv_priv_bla {* @lock: lock protecting log_buff, log_start & log_end * @queue_wait: log reader's wait queue */ -#ifdef CONFIG_BATMAN_ADV_DEBUGstruct batadv_priv_debug_log {char log_buff[BATADV_LOG_BUF_LEN ];unsigned long log_start;
@@ -647,13 +650,14 @@ struct batadv_priv_tvlv {spinlock_t handler_list_lock;/* protects handler_list */ }; +#ifdef CONFIG_BATMAN_ADV_DAT + /** * struct batadv_priv_dat - per mesh interface DAT private data * @addr: node DAT address * @hash: hashtable representing the local ARP cache * @work: work queue callback item for cache purging */ -#ifdef CONFIG_BATMAN_ADV_DAT struct batadv_priv_dat { batadv_dat_addr_t addr; struct batadv_hashtable *hash;
@@ -893,6 +897,8 @@ struct batadv_socket_packet {u8 icmp_packet[BATADV_ICMP_MAX_PACKET_SIZE ]; }; +#ifdef CONFIG_BATMAN_ADV_BLA +/** * struct batadv_bla_backbone_gw - batman-adv gateway bridged into the LAN * @orig: originator address of backbone node (mac address of primary iface)
@@ -910,7 +916,6 @@ struct batadv_socket_packet {* @refcount: number of contexts the object is used * @rcu: struct used for freeing in an RCU-safe manner */ -#ifdef CONFIG_BATMAN_ADV_BLAstruct batadv_bla_backbone_gw {u8 orig[ETH_ALEN ];unsigned short vid;
Signature · 1 line
2.7.0
PATCH 16/16 batman-adv: Add kerneldoc for batadv_neigh_node::refcount
In reply to Antonio QuartulliFrom: Sven Eckelmann <[email protected]>
--- net/batman-adv/types.h | 1 + 1 file changed, 1 insertion(+)
net/batman-adv/types.h +1 -0
@@ -371,6 +371,7 @@ struct batadv_hardif_neigh_node {* @ifinfo_lock: lock protecting private ifinfo members and list * @if_incoming: pointer to incoming hard interface * @last_seen: when last packet via this neighbor was received +* @refcount: number of contexts the object is used * @rcu: struct used for freeing in an RCU-safe manner */ struct batadv_neigh_node {
Signature · 1 line
2.7.0
From: Antonio Quartulli <[email protected]>
Date: Sat, 9 Jan 2016 21:20:05 +0800
Quoted 1 line
here you have a late batch of patches intended for net-next.
Pulled, thanks Antonio.