The following commit has been merged in the merge/master branch: commit 64382bc56ee9452ad01701eed1b5a4525b6c4d7b Merge: 817b244043be34c1f1d334befa36c327d42b97ec 8ce897a4794bccf6a66b92f63cbb5cce040e8465 Author: Marek Lindner mareklindner@neomailbox.ch Date: Sat Aug 8 03:07:19 2015 +0800
Merge branch 'next'
diff --combined net/batman-adv/hard-interface.c index b7146ac,f11345e..5c2df84 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@@ -252,6 -252,44 +252,44 @@@ static void batadv_check_known_mac_addr rcu_read_unlock(); }
+ /** + * batadv_hardif_recalc_extra_skbroom() - Recalculate skbuff extra head/tailroom + * @soft_iface: netdev struct of the mesh interface + */ + static void batadv_hardif_recalc_extra_skbroom(struct net_device *soft_iface) + { + const struct batadv_hard_iface *hard_iface; + unsigned short lower_header_len = ETH_HLEN; + unsigned short lower_headroom = 0; + unsigned short lower_tailroom = 0; + unsigned short needed_headroom; + + rcu_read_lock(); + list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { + if (hard_iface->if_status == BATADV_IF_NOT_IN_USE) + continue; + + if (hard_iface->soft_iface != soft_iface) + continue; + + lower_header_len = max_t(unsigned short, lower_header_len, + hard_iface->net_dev->hard_header_len); + + lower_headroom = max_t(unsigned short, lower_headroom, + hard_iface->net_dev->needed_headroom); + + lower_tailroom = max_t(unsigned short, lower_tailroom, + hard_iface->net_dev->needed_tailroom); + } + rcu_read_unlock(); + + needed_headroom = lower_headroom + (lower_header_len - ETH_HLEN); + needed_headroom += batadv_max_header_len(); + + soft_iface->needed_headroom = needed_headroom; + soft_iface->needed_tailroom = lower_tailroom; + } + int batadv_hardif_min_mtu(struct net_device *soft_iface) { struct batadv_priv *bat_priv = netdev_priv(soft_iface); @@@ -474,6 -512,8 +512,8 @@@ int batadv_hardif_enable_interface(stru "Not using interface %s (retrying later): interface not active\n", hard_iface->net_dev->name);
+ batadv_hardif_recalc_extra_skbroom(soft_iface); + /* begin scheduling originator messages on that interface */ batadv_schedule_bat_ogm(hard_iface);
@@@ -529,6 -569,7 +569,7 @@@ void batadv_hardif_disable_interface(st dev_put(hard_iface->soft_iface);
netdev_upper_dev_unlink(hard_iface->net_dev, hard_iface->soft_iface); + batadv_hardif_recalc_extra_skbroom(hard_iface->soft_iface);
/* nobody uses this interface anymore */ if (!bat_priv->num_ifaces) { @@@ -597,12 -638,9 +638,12 @@@ batadv_hardif_add_interface(struct net_ goto free_sysfs;
INIT_LIST_HEAD(&hard_iface->list); + INIT_HLIST_HEAD(&hard_iface->neigh_list); INIT_WORK(&hard_iface->cleanup_work, batadv_hardif_remove_interface_finish);
+ spin_lock_init(&hard_iface->neigh_list_lock); + hard_iface->num_bcasts = BATADV_NUM_BCASTS_DEFAULT; if (batadv_is_wifi_netdev(net_dev)) hard_iface->num_bcasts = BATADV_NUM_BCASTS_WIRELESS;