Patches for batman-adv 2015.0 release
cover Patches for batman-adv 2015.0 release
Hi,
I was told that batman-adv 2015.0 should be released based on patches which are currently in Linux 4.1. I've checked the current state and it seems that there are even patches in Linux 4.0 which aren't yet merged into the out-of-tree module. And also patches of the Linux 4.1 kernel tree aren't applied. The net-next merge window for Linux 4.1 is closed for this kernel but Linus still gathers patches for it. This is also the reason why there are some patches for batman-adv not yet in Linus tree but in David's net.git. Interestingly, some of these patches were already merged in the out-of-tree module - but not all.
This patchset is just to cleanup the current state of net.git. Sorry for all the merge conflicts which may now happen with master and some patches on the mailing list.
Included patches
~~~~~~~~~~~~~~~~
Patches which were missing:
* https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=b7a8d756fb8080ab6ba9f4a9d4056a1056245fbc
* https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=b98fe24ca7d0effdd4c47a9f681d9e4f10442827
* https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a54acb3a6f853e8394c4cb7b6a4d93c88f13eefd
Patches which are in batman-adv master but should be in this release:
* http://git.open-mesh.org/batman-adv.git/commit/3f74f359cb7e96bbc68d62e1fc48b04b6efb4ca7
A patch which should never ever have existed in the first place (please correct me when I've missed the actual problem):
* http://git.open-mesh.org/linux-merge.git/commit/b53915310227cc9b029ba0fa5aae44e50a461f80
The weirdest commit is one which is in batman-adv next but can nowhere be found in the kernel trees. It is already part of the release v2014.2.0:
* http://git.open-mesh.org/batman-adv.git/commit/31f391475cc08724e96ab060ef4aa6503d11da8e
(havent touched this commit because this is just too weird)
Releases
~~~~~~~~
I was also under the impression that no one really knew what will be released and what version of the kernel tree it will be based on. How about changing the Release-todo (see attached image)
* maint branch is released as feature release 2015.a after linux 4.x is tagged
* 2015.a.y branches are released on demand... most likely never
* content of master becomes new maint after release
It is basically an old idea [1] with the branches renamed to keep "master" as the main development branch (submission to David's net-next.git) and "maint" as the branch which gathers bugfixes for net.git.
Kind regards,
Sven
[1] https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2012-December/008719.html
PATCH 1/6 batman-adv: ignore netdev_set_master() calls on kernels older than 2.6.39
From: Marek Lindner <[email protected]>
batman-adv calls netdev_master_upper_dev_link() which is replaced with with netdev_set_master() for kernels older than 3.9 via compat.h. Prior to 2.6.39 netdev_set_master() contained Linux bonding calls needed to setup bonding devices. Calling this function from batman-adv leads to unexpected behavior when current batman-adv versions are used on these older kernels.
To fix the situation compat.h now ships its own implementation of netdev_set_master() which does not change the net_dev->master state on kernels older than 2.6.39.
--- compat.h | 9 +++++++++ 1 file changed, 9 insertions(+)
compat.h +9 -0
@@ -191,6 +191,15 @@ static inline int batadv_param_set_copystring(const char *val,#define kstrtoul strict_strtoul#define kstrtol strict_strtol +/* On older kernels net_dev->master is reserved for iface bonding. */ +static inline int batadv_netdev_set_master (struct net_device *slave, +struct net_device *master) +{ +return 0 ; +} + +#define netdev_set_master batadv_netdev_set_master +/* Hack for removing ndo_add/del_slave at the end of net_device_ops. * This is somewhat ugly because it requires that ndo_validate_addr * is at the end of this struct in soft-interface.c.
Signature · 1 line
2.1.4
PATCH 2/6 batman-adv: replace strnicmp with strncasecmp
From: Rasmus Villemoes <[email protected]>
The kernel used to contain two functions for length-delimited, case-insensitive string comparison, strnicmp with correct semantics and a slightly buggy strncasecmp. The latter is the POSIX name, so strnicmp was renamed to strncasecmp, and strnicmp made into a wrapper for the new strncasecmp to avoid breaking existing users.
To allow the compat wrapper strnicmp to be removed at some point in the future, and to avoid the extra indirection cost, do s/strnicmp/strncasecmp/g.
--- gateway_common.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
gateway_common.c +4 -4
@@ -44,10 +44,10 @@ static bool batadv_parse_gw_bandwidth(struct net_device *net_dev, char *buff,if (strlen (buff) >4 ) { tmp_ptr = buff +strlen (buff) -4 ; -if (strnicmp (tmp_ptr,"mbit" ,4 ) ==0 ) +if (strncasecmp (tmp_ptr,"mbit" ,4 ) ==0 ) bw_unit_type =BATADV_BW_UNIT_MBIT ; -if ((strnicmp (tmp_ptr,"kbit" ,4 ) ==0 ) || +if ((strncasecmp (tmp_ptr,"kbit" ,4 ) ==0 ) || (bw_unit_type ==BATADV_BW_UNIT_MBIT )) *tmp_ptr ='\0' ; }
@@ -77,10 +77,10 @@ static bool batadv_parse_gw_bandwidth(struct net_device *net_dev, char *buff,if (strlen (slash_ptr +1 ) >4 ) { tmp_ptr = slash_ptr +1 -4 +strlen (slash_ptr +1 ); -if (strnicmp (tmp_ptr,"mbit" ,4 ) ==0 ) +if (strncasecmp (tmp_ptr,"mbit" ,4 ) ==0 ) bw_unit_type =BATADV_BW_UNIT_MBIT ; -if ((strnicmp (tmp_ptr,"kbit" ,4 ) ==0 ) || +if ((strncasecmp (tmp_ptr,"kbit" ,4 ) ==0 ) || (bw_unit_type ==BATADV_BW_UNIT_MBIT )) *tmp_ptr ='\0' ; }
Signature · 1 line
2.1.4
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH-next 2/6] batman-adv: replace strnicmp with strncasecmp
Quoted 18 lines · On Friday, April 17, 2015 18:34:17 Sven Eckelmann wrote:
From: Rasmus Villemoes <[email protected]>
The kernel used to contain two functions for length-delimited, case-insensitive string comparison, strnicmp with correct semantics and a slightly buggy strncasecmp. The latter is the POSIX name, so strnicmp was renamed to strncasecmp, and strnicmp made into a wrapper for the new strncasecmp to avoid breaking existing users.
To allow the compat wrapper strnicmp to be removed at some point in the future, and to avoid the extra indirection cost, do s/strnicmp/strncasecmp/g.
Signed-off-by Rasmus Villemoes <[email protected]>Cc Marek Lindner <[email protected]>Signed-off-by Andrew Morton <[email protected]>Signed-off-by Linus Torvalds <[email protected]>Signed-off-by Sven Eckelmann <[email protected]>
Quoted 3 lines
--- gateway_common.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Applied in revision 5ba0a63.
Thanks,
Marek
PATCH 3/6 batman-adv: Use kasprintf
In reply to Sven EckelmannFrom: Himangi Saraogi <[email protected]>
kasprintf combines kmalloc and sprintf, and takes care of the size calculation itself.
The semantic patch that makes this change is as follows:
// <smpl>
@@
expression a,flag;
expression list args;
statement S;
@@
a =
- \(kmalloc\|kzalloc\)(...,flag)
+ kasprintf(flag,args)
<... when != a
if (a == NULL || ...) S
...>
- sprintf(a,args);
// </smpl>
--- sysfs.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-)
sysfs.c +8 -16
@@ -899,32 +899,24 @@ int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type, bat_kobj = &bat_priv->soft_iface->dev.kobj; - uevent_env[0 ] =kmalloc (strlen (BATADV_UEV_TYPE_VAR ) + -strlen (batadv_uev_type_str[type]) +1 , -GFP_ATOMIC ); + uevent_env[0 ] =kasprintf (GFP_ATOMIC , +"%s%s" ,BATADV_UEV_TYPE_VAR , + batadv_uev_type_str[type]);if (!uevent_env[0 ]) goto out; -sprintf (uevent_env[0 ],"%s%s" ,BATADV_UEV_TYPE_VAR , - batadv_uev_type_str[type]); - - uevent_env[1 ] =kmalloc (strlen (BATADV_UEV_ACTION_VAR ) + -strlen (batadv_uev_action_str[action]) +1 , -GFP_ATOMIC ); + uevent_env[1 ] =kasprintf (GFP_ATOMIC , +"%s%s" ,BATADV_UEV_ACTION_VAR , + batadv_uev_action_str[action]);if (!uevent_env[1 ]) goto out; -sprintf (uevent_env[1 ],"%s%s" ,BATADV_UEV_ACTION_VAR , - batadv_uev_action_str[action]); -/* If the event is DEL, ignore the data field */ if (action !=BATADV_UEV_DEL ) { - uevent_env[2 ] =kmalloc (strlen (BATADV_UEV_DATA_VAR ) + -strlen (data) +1 ,GFP_ATOMIC ); + uevent_env[2 ] =kasprintf (GFP_ATOMIC , +"%s%s" ,BATADV_UEV_DATA_VAR , data);if (!uevent_env[2 ]) goto out; - -sprintf (uevent_env[2 ],"%s%s" ,BATADV_UEV_DATA_VAR , data); } ret =kobject_uevent_env (bat_kobj,KOBJ_CHANGE , uevent_env);
Signature · 1 line
2.1.4
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH-next 3/6] batman-adv: Use kasprintf
Quoted 23 lines · On Friday, April 17, 2015 18:34:18 Sven Eckelmann wrote:
From: Himangi Saraogi <[email protected]>
kasprintf combines kmalloc and sprintf, and takes care of the size calculation itself.
The semantic patch that makes this change is as follows:
// <smpl>
@@
expression a,flag;
expression list args;
statement S;
@@a =
(quoted diff) +1
-2- \(kmalloc\|kzalloc\)(...,flag) + kasprintf(flag,args) <... when != a if (a == NULL || ...) S ...> - sprintf(a,args);// </smpl>
Quoted 7 lines
Signed-off-by Himangi Saraogi <[email protected]>Acked-by Julia Lawall <[email protected]>Signed-off-by David S. Miller <[email protected]>Signed-off-by Sven Eckelmann <[email protected]>--- sysfs.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-)
Applied in revision aeb0f1d.
Thanks,
Marek
PATCH 4/6 dev: introduce dev_get_iflink()
In reply to Sven EckelmannFrom: Nicolas Dichtel <[email protected]>
The goal of this patch is to prepare the removal of the iflink field. It introduces a new ndo function, which will be implemented by virtual interfaces.
There is no functional change into this patch. All readers of iflink field now call dev_get_iflink().
---
This has to be moved to linux/netdevice.h for
https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-April/012960.html
compat.h | 6 ++++++ hard-interface.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-)
compat.h +6 -0
@@ -482,4 +482,10 @@ static inline bool seq_has_overflowed(struct seq_file *m)#endif /* < KERNEL_VERSION(3, 19, 0) */ +#if LINUX_VERSION_CODE <KERNEL_VERSION (4 ,1 ,0 ) + +#define dev_get_iflink (_net_dev) ((_net_dev)->iflink) + +#endif /* < KERNEL_VERSION(3, 19, 0) */ +#endif /* _NET_BATMAN_ADV_COMPAT_H_ */
hard-interface.c +3 -2
@@ -83,11 +83,12 @@ static bool batadv_is_on_batman_iface(const struct net_device *net_dev)return true;/* no more parents..stop recursion */ -if (net_dev->iflink ==0 || net_dev->iflink == net_dev->ifindex) +if (dev_get_iflink (net_dev) ==0 || +dev_get_iflink (net_dev) == net_dev->ifindex)return false;/* recurse over the parent device */ - parent_dev =__dev_get_by_index (&init_net, net_dev->iflink); + parent_dev =__dev_get_by_index (&init_net,dev_get_iflink (net_dev));/* if we got a NULL parent_dev there is something broken.. */ if (WARN (!parent_dev,"Cannot find parent device" ))return false;
Signature · 1 line
2.1.4
PATCH 4/6 dev: introduce dev_get_iflink()
From: Nicolas Dichtel <[email protected]>
The goal of this patch is to prepare the removal of the iflink field. It introduces a new ndo function, which will be implemented by virtual interfaces.
There is no functional change into this patch. All readers of iflink field now call dev_get_iflink().
---
This has to be moved to linux/netdevice.h for
https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-April/012960.html
v2:
- Fix the comment in the compat code which still said "3, 19, 0"
compat.h | 6 ++++++ hard-interface.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-)
compat.h +6 -0
@@ -482,4 +482,10 @@ static inline bool seq_has_overflowed(struct seq_file *m)#endif /* < KERNEL_VERSION(3, 19, 0) */ +#if LINUX_VERSION_CODE <KERNEL_VERSION (4 ,1 ,0 ) + +#define dev_get_iflink (_net_dev) ((_net_dev)->iflink) + +#endif /* < KERNEL_VERSION(4, 1, 0) */ +#endif /* _NET_BATMAN_ADV_COMPAT_H_ */
hard-interface.c +3 -2
@@ -83,11 +83,12 @@ static bool batadv_is_on_batman_iface(const struct net_device *net_dev)return true;/* no more parents..stop recursion */ -if (net_dev->iflink ==0 || net_dev->iflink == net_dev->ifindex) +if (dev_get_iflink (net_dev) ==0 || +dev_get_iflink (net_dev) == net_dev->ifindex)return false;/* recurse over the parent device */ - parent_dev =__dev_get_by_index (&init_net, net_dev->iflink); + parent_dev =__dev_get_by_index (&init_net,dev_get_iflink (net_dev));/* if we got a NULL parent_dev there is something broken.. */ if (WARN (!parent_dev,"Cannot find parent device" ))return false;
Signature · 1 line
2.1.4
PATCH 4/6 batman-adv: introduce dev_get_iflink()
In reply to Sven EckelmannFrom: Nicolas Dichtel <[email protected]>
The goal of this patch is to prepare the removal of the iflink field. It introduces a new ndo function, which will be implemented by virtual interfaces.
There is no functional change into this patch. All readers of iflink field now call dev_get_iflink().
---
This has to be moved to linux/netdevice.h for
https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-April/012960.html
v2:
- Fix the comment in the compat code which still said "3, 19, 0"
v3
- use batman-adv: prefix instead of dev:
compat.h | 6 ++++++ hard-interface.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-)
compat.h +6 -0
@@ -482,4 +482,10 @@ static inline bool seq_has_overflowed(struct seq_file *m)#endif /* < KERNEL_VERSION(3, 19, 0) */ +#if LINUX_VERSION_CODE <KERNEL_VERSION (4 ,1 ,0 ) + +#define dev_get_iflink (_net_dev) ((_net_dev)->iflink) + +#endif /* < KERNEL_VERSION(4, 1, 0) */ +#endif /* _NET_BATMAN_ADV_COMPAT_H_ */
hard-interface.c +3 -2
@@ -83,11 +83,12 @@ static bool batadv_is_on_batman_iface(const struct net_device *net_dev)return true;/* no more parents..stop recursion */ -if (net_dev->iflink ==0 || net_dev->iflink == net_dev->ifindex) +if (dev_get_iflink (net_dev) ==0 || +dev_get_iflink (net_dev) == net_dev->ifindex)return false;/* recurse over the parent device */ - parent_dev =__dev_get_by_index (&init_net, net_dev->iflink); + parent_dev =__dev_get_by_index (&init_net,dev_get_iflink (net_dev));/* if we got a NULL parent_dev there is something broken.. */ if (WARN (!parent_dev,"Cannot find parent device" ))return false;
Signature · 1 line
2.1.4
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH-nextv2 4/6] batman-adv: introduce dev_get_iflink()
Quoted 17 lines · On Friday, April 17, 2015 19:15:10 Sven Eckelmann wrote:
From: Nicolas Dichtel <[email protected]>
The goal of this patch is to prepare the removal of the iflink field. It introduces a new ndo function, which will be implemented by virtual interfaces.
There is no functional change into this patch. All readers of iflink field now call
dev_get_iflink().Signed-off-by Nicolas Dichtel <[email protected]>Signed-off-by David S. Miller <[email protected]>[[email protected]: added compat code]Signed-off-by Sven Eckelmann <[email protected]>---
This has to be moved tolinux/netdevice.hfor
https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-April/012960.html
Quoted 8 lines
v2:
- Fix the comment in the compat code which still said "3, 19, 0"
v3
- use batman-adv: prefix instead of dev:compat.h | 6 ++++++ hard-interface.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-)
Applied in revision f8a8f60.
Thanks,
Marek
PATCH 5/6 Revert "batman-adv: fix var name to keep compatibility with old kernels"
In reply to Sven EckelmannThe original patch b53915310227cc9b029ba0fa5aae44e50a461f80 should not be submitted to net-next. So just remove it and replace it with compat code.
---
This compat code must be removed again when applying
https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-April/012963.html
compat.c | 9 +++++++++ compat.h | 1 + soft-interface.c | 12 ++++++------ 3 files changed, 16 insertions(+), 6 deletions(-)
compat.c +9 -0
@@ -42,6 +42,15 @@ void batadv_free_rcu_softif_vlan(struct rcu_head *rcu)kfree (vlan); } +void batadv_free_rcu_vlan (struct rcu_head *rcu) +{ +struct batadv_softif_vlan *vlan; + + vlan = container_of(rcu, struct batadv_softif_vlan, rcu); + +kfree (vlan); +} +void batadv_free_rcu_tt_global_entry (struct rcu_head *rcu) {struct batadv_tt_global_entry *global;
compat.h +1 -0
@@ -234,6 +234,7 @@ void batadv_free_rcu_backbone_gw(struct rcu_head *rcu);void batadv_free_rcu_dat_entry (struct rcu_head *rcu);void batadv_free_rcu_nc_path (struct rcu_head *rcu);void batadv_free_rcu_tvlv_handler (struct rcu_head *rcu); +void batadv_free_rcu_vlan (struct rcu_head *rcu);static inline void skb_reset_mac_len (struct sk_buff *skb) {
soft-interface.c +6 -6
@@ -453,14 +453,14 @@ out:* possibly free it * @softif_vlan: the vlan object to release */ -void batadv_softif_vlan_free_ref (struct batadv_softif_vlan *softif_vlan) +void batadv_softif_vlan_free_ref (struct batadv_softif_vlan *vlan) { -if (atomic_dec_and_test (&softif_vlan->refcount)) { -spin_lock_bh (&softif_vlan->bat_priv->softif_vlan_list_lock); -hlist_del_rcu (&softif_vlan->list); -spin_unlock_bh (&softif_vlan->bat_priv->softif_vlan_list_lock); +if (atomic_dec_and_test (&vlan->refcount)) { +spin_lock_bh (&vlan->bat_priv->softif_vlan_list_lock); +hlist_del_rcu (&vlan->list); +spin_unlock_bh (&vlan->bat_priv->softif_vlan_list_lock); -kfree_rcu (softif_vlan, rcu); +kfree_rcu (vlan, rcu); } }
Signature · 1 line
2.1.4
PATCH 5/6 batman-adv: Revert "fix var name to keep compatibility with old kernels"
The original patch b53915310227cc9b029ba0fa5aae44e50a461f80 should not be submitted to net-next. It can be better implemented using compat code.
---
This compat code must be removed again when applying
https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-April/012963.html
v2:
swap Revert and batman-adv: prefix
compat.c | 9 +++++++++ compat.h | 1 + soft-interface.c | 12 ++++++------ 3 files changed, 16 insertions(+), 6 deletions(-)
compat.c +9 -0
@@ -42,6 +42,15 @@ void batadv_free_rcu_softif_vlan(struct rcu_head *rcu)kfree (vlan); } +void batadv_free_rcu_vlan (struct rcu_head *rcu) +{ +struct batadv_softif_vlan *vlan; + + vlan = container_of(rcu, struct batadv_softif_vlan, rcu); + +kfree (vlan); +} +void batadv_free_rcu_tt_global_entry (struct rcu_head *rcu) {struct batadv_tt_global_entry *global;
compat.h +1 -0
@@ -234,6 +234,7 @@ void batadv_free_rcu_backbone_gw(struct rcu_head *rcu);void batadv_free_rcu_dat_entry (struct rcu_head *rcu);void batadv_free_rcu_nc_path (struct rcu_head *rcu);void batadv_free_rcu_tvlv_handler (struct rcu_head *rcu); +void batadv_free_rcu_vlan (struct rcu_head *rcu);static inline void skb_reset_mac_len (struct sk_buff *skb) {
soft-interface.c +6 -6
@@ -453,14 +453,14 @@ out:* possibly free it * @softif_vlan: the vlan object to release */ -void batadv_softif_vlan_free_ref (struct batadv_softif_vlan *softif_vlan) +void batadv_softif_vlan_free_ref (struct batadv_softif_vlan *vlan) { -if (atomic_dec_and_test (&softif_vlan->refcount)) { -spin_lock_bh (&softif_vlan->bat_priv->softif_vlan_list_lock); -hlist_del_rcu (&softif_vlan->list); -spin_unlock_bh (&softif_vlan->bat_priv->softif_vlan_list_lock); +if (atomic_dec_and_test (&vlan->refcount)) { +spin_lock_bh (&vlan->bat_priv->softif_vlan_list_lock); +hlist_del_rcu (&vlan->list); +spin_unlock_bh (&vlan->bat_priv->softif_vlan_list_lock); -kfree_rcu (softif_vlan, rcu); +kfree_rcu (vlan, rcu); } }
Signature · 1 line
2.1.4
Re: [B.A.T.M.A.N.] [PATCH-nextv2 5/6] batman-adv: Revert "fix var name to keep compatibility with old kernels"
Quoted 4 lines · Sven Eckelmann
The original patch
b53915310227cc9b029ba0fa5aae44e50a461f80should not be submitted to net-next. It can be better implemented using compat code.Signed-off-by Sven Eckelmann <[email protected]>
Cheers,
Signature · 1 line
Antonio Quartulli
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH-nextv2 5/6] batman-adv: Revert "fix var name to keep compatibility with old kernels"
Quoted 9 lines · On Monday, April 20, 2015 16:06:41 Antonio Quartulli wrote:
Quoted 6 lines · Sven Eckelmann
The original patch
b53915310227cc9b029ba0fa5aae44e50a461f80should not be submitted to net-next. It can be better implemented using compat code.Signed-off-by Sven Eckelmann <[email protected]>
Applied in revision e78c16c.
Thanks,
Marek
PATCH 6/6 batman-adv: Use kernel variable declaration order in batadv_send_skb_unicast
In reply to Sven EckelmannThe patches currently in the kernel for Linux 4.1 have a different variable order in batadv_send_skb_unicast than the out-of-tree module. Fix the order in the out-of-tree module because it is easier to get merged.
--- send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
send.c +1 -1
@@ -255,8 +255,8 @@ int batadv_send_skb_unicast(struct batadv_priv *bat_priv, struct batadv_orig_node *orig_node, unsigned short vid) { -struct batadv_unicast_packet *unicast_packet;struct ethhdr *ethhdr; +struct batadv_unicast_packet *unicast_packet;int ret =NET_XMIT_DROP ;if (!orig_node)
Signature · 1 line
2.1.4
Re: [B.A.T.M.A.N.] [PATCH-next 6/6] batman-adv: Use kernel variable declaration order in batadv_send_skb_unicast
Quoted 3 lines · On Friday, April 17, 2015 18:34:21 Sven Eckelmann wrote:
The patches currently in the kernel for Linux 4.1 have a different variable order in
batadv_send_skb_unicastthan the out-of-tree module. Fix the order in the out-of-tree module because it is easier to get merged.
We know about this discrepancy but decided to live with it because we prefer the variable order you can find in the out-of-tree repos but can't imagine David is going to accept such a trivial patch ? In fact, we were hoping some other change would come along allowing us to get this into the kernel.
Cheers,
Marek
Re: [B.A.T.M.A.N.] [PATCH-next 6/6] batman-adv: Use kernel variable declaration order in batadv_send_skb_unicast
Quoted 10 lines · On Monday 20 April 2015 23:27:00 Marek Lindner wrote:
Quoted 4 lines · On Friday, April 17, 2015 18:34:21 Sven Eckelmann wrote:
The patches currently in the kernel for Linux 4.1 have a different variable
order inbatadv_send_skb_unicastthan the out-of-tree module. Fix the order in the out-of-tree module because it is easier to get merged.We know about this discrepancy but decided to live with it because we prefer the variable order you can find in the out-of-tree repos but can't imagine David is going to accept such a trivial patch ? In fact, we were hoping some other change would come along allowing us to get this into the kernel.
Ok, then maybe Antonio could try to put it in the same pull request as Markus Pargmann's stuff or his own cleanup patches. At least the patch would have some nice companions which don't look too different.
Kind regards,
Sven
Re: [B.A.T.M.A.N.] [PATCH-next 6/6] batman-adv: Use kernel variable declaration order in batadv_send_skb_unicast
Quoted 3 lines · Sven Eckelmann
Ok, then maybe Antonio could try to put it in the same pull request as Markus Pargmann's stuff or his own cleanup patches. At least the patch would have some nice companions which don't look too different.
Yeah, I will probably do that.
Thanks,
Signature · 1 line
Antonio Quartulli
Re: [B.A.T.M.A.N.] [PATCH-next 1/6] batman-adv: ignore netdev_set_master() calls on kernels older than 2.6.39
In reply to Sven EckelmannQuoted 13 lines · On Friday, April 17, 2015 18:34:16 Sven Eckelmann wrote:
From: Marek Lindner <[email protected]>
batman-adv calls
netdev_master_upper_dev_link()which is replaced with withnetdev_set_master()for kernels older than 3.9 viacompat.h. Prior to 2.6.39netdev_set_master()contained Linux bonding calls needed to setup bonding devices. Calling this function from batman-adv leads to unexpected behavior when current batman-adv versions are used on these older kernels.To fix the situation
compat.hnow ships its own implementation ofnetdev_set_master()which does not change thenet_dev->masterstate on kernels older than 2.6.39.
Quoted 6 lines
Reported-by Andreas Pape <[email protected]>Signed-off-by Marek Lindner <[email protected]>Signed-off-by Sven Eckelmann <[email protected]>--- compat.h | 9 +++++++++ 1 file changed, 9 insertions(+)
I have already cherry-picked that patch myself.
Thanks,
Marek
Re: [B.A.T.M.A.N.] [PATCH-next 1/6] batman-adv: ignore netdev_set_master() calls on kernels older than 2.6.39
Quoted 21 lines · On Monday 20 April 2015 11:32:23 Marek Lindner wrote:
Quoted 20 lines · On Friday, April 17, 2015 18:34:16 Sven Eckelmann wrote:
From: Marek Lindner <[email protected]>
batman-adv calls
netdev_master_upper_dev_link()which is replaced with withnetdev_set_master()for kernels older than 3.9 viacompat.h. Prior to 2.6.39netdev_set_master()contained Linux bonding calls needed to
setup bonding devices. Calling this function from batman-adv leads to unexpected behavior when current batman-adv versions are used on these older kernels.To fix the situation
compat.hnow ships its own implementation ofnetdev_set_master()which does not change thenet_dev->masterstate on kernels older than 2.6.39.Reported-by Andreas Pape <[email protected]>Signed-off-by Marek Lindner <[email protected]>Signed-off-by Sven Eckelmann <[email protected]>---
Quoted 4 lines
Quoted 2 lines
compat.h | 9 +++++++++ 1 file changed, 9 insertions(+)I have already cherry-picked that patch myself.
Depends on your definition of "already". It was not cherry-picked when I've sent this patch. The commit you are referring to was cherry-picked 25 minutes before you wrote this mail and my patch was send 5160 minutes before your mail.
Kind regard,s
Sven
Re: [B.A.T.M.A.N.] [PATCH-next 1/6] batman-adv: ignore netdev_set_master() calls on kernels older than 2.6.39
Quoted 4 lines · On Monday, April 20, 2015 08:11:05 Sven Eckelmann wrote:
Depends on your definition of "already". It was not cherry-picked when I've sent this patch. The commit you are referring to was cherry-picked 25 minutes before you wrote this mail and my patch was send 5160 minutes before your mail.
I was referring to the time between my cherry-pick and reading your patch mail.
Cheery,
Marek
On Friday 17 April 2015 18:32:45 Sven Eckelmann wrote:
[...]
Quoted 11 lines
Releases
~~~~~~~~I was also under the impression that no one really knew what will be released and what version of the kernel tree it will be based on. How about changing the Release-todo (see attached image)
* maint branch is released as feature release 2015.a after linux 4.x is tagged
* 2015.a.y branches are released on demand... most likely never
* content of master becomes new maint after release
Meant was "content of master becomes new maint after current maint was released".
It may also be important to understand that new features in master after the net-next.git merge window closed should not become part of the new maint because they cannot be pushed to David for the next 4.x version. But this is not a real technical problem because the maint must not really jump to the latest position of the master branch HEAD - it is possible to choose a slightly older position and still get a fast-forward merge in git.
Kind regards,
Sven
Quoted 10 lines · On Friday 17 April 2015 20:03:06 Sven Eckelmann wrote:
On Friday 17 April 2015 18:32:45 Sven Eckelmann wrote:
[...]Quoted 7 lines
Releases
~~~~~~~~I was also under the impression that no one really knew what will be released and what version of the kernel tree it will be based on. How about
changing the Release-todo (see attached image)
[...]
Attached is an updated version of this image. It now also includes the development of 3 Linux-Versions (4.x, 4.y, 4.z) like the version of the current development process which I've tried to update last weekend [1].
The solid part of a linux development line (final of 4.x to 4.y) is around 10 weeks (it is more like 9 weeks since some releases). A scale for the time is not shown anywhere because this might change in the future.
Kind regards,
Sven
[1] http://www.open-mesh.org/projects/batman-adv/wiki/Release-todo
Sven,
thanks for the thorough cleanup review.
Quoted 5 lines
Patches which are in batman-adv master but should be in this release:
*
http://git.open-mesh.org/batman-adv.git/commit/3f74f359cb7e96bbc68d62e1fc48b04b6efb4ca7
I moved the patch to main (not strictly necessary as maint will be replaced soon) and merge my way up to master.
Quoted 6 lines
A patch which should never ever have existed in the first place (please correct me when I've missed the actual problem):
*
http://git.open-mesh.org/linux-merge.git/commit/b53915310227cc9b029ba0fa5aae44e50a461f80
This (subtle) problem is about compat.h. Specifically, the kfree_rcu macro requires a pre-defined variable name:
#define kfree_rcu(ptr, rcu_head) call_rcu(&ptr->rcu_head, batadv_free_rcu_##ptr)
void batadv_free_rcu_softif_vlan(struct rcu_head *rcu);
Quoted 6 lines
The weirdest commit is one which is in batman-adv next but can nowhere be found in the kernel trees. It is already part of the release v2014.2.0:
*
http://git.open-mesh.org/batman-adv.git/commit/31f391475cc08724e96ab060ef4aa6503d11da8e(havent touched this commit because this is just too weird)
Antonio, can you comment ? Was it forgotten or was there a reason ?
Cheers,
Marek
On Monday 20 April 2015 11:23:15 Marek Lindner wrote:
[...]
Quoted 9 lines
Quoted 8 lines
A patch which should never ever have existed in the first place (please
correct me when I've missed the actual problem):
*http://git.open-mesh.org/linux-merge.git/commit/b53915310227cc9b029ba0fa5a
ae44e50a461f80
Quoted 6 lines
This (subtle) problem is about
compat.h. Specifically, thekfree_rcumacro requires a pre-defined variable name:
#definekfree_rcu(ptr, rcu_head)call_rcu(&ptr->rcu_head, batadv_free_rcu_##ptr)void
batadv_free_rcu_softif_vlan(struct rcu_head *rcu);
I still don't get it. I wrote the compat code for batadv_free_rcu_* and I was always under the impression that it is not a problem until we have two functions which call kfree_rcu with the same variable name and different types (something which I've now hopefully solved in my kfree_rcu patch for master). And the patch I gave should also show that for this works fine after adding batadv_free_rcu_softif_vlan.
Kind regards,
Sven
Quoted 7 lines · On Monday, April 20, 2015 08:05:20 Sven Eckelmann wrote:
Quoted 7 lines
This (subtle) problem is about
compat.h. Specifically, thekfree_rcumacro requires a pre-defined variable name:
#definekfree_rcu(ptr, rcu_head)call_rcu(&ptr->rcu_head, batadv_free_rcu_##ptr)
Quoted 8 lines
Quoted 1 line
void
batadv_free_rcu_softif_vlan(struct rcu_head *rcu);I still don't get it. I wrote the compat code for batadv_free_rcu_* and I was always under the impression that it is not a problem until we have two functions which call
kfree_rcuwith the same variable name and different types (something which I've now hopefully solved in mykfree_rcupatch for master). And the patch I gave should also show that for this works fine after addingbatadv_free_rcu_softif_vlan.
I hope Antonio is going to shed some light on the question whether that patch made it upstream or not. Depending on that question we can pick the appropriate solution.
Cheers,
Marek
Quoted 3 lines · Marek Lindner
I hope Antonio is going to shed some light on the question whether that patch made it upstream or not. Depending on that question we can pick the appropriate solution.
This patch was never sent upstream, probably because it looked like some change made for "compat.* only" and therefore it got accidentally discarded.
By the way, when I created this patch I thought that the name of the function was supposed to match the type of the object to free because I observed a compilation failure - this is why I created this change.
But if this is not really required then I am ok with Sven's patch.
Cheers,
Signature · 1 line
Antonio Quartulli
Quoted 5 lines · On Monday 20 April 2015 14:05:18 Antonio Quartulli wrote:
Quoted 3 lines · Marek Lindner
I hope Antonio is going to shed some light on the question whether that patch made it upstream or not. Depending on that question we can pick the appropriate solution.
Quoted 8 lines
This patch was never sent upstream, probably because it looked like some change made for "compat.* only" and therefore it got accidentally discarded.
By the way, when I created this patch I thought that the name of the function was supposed to match the type of the object to free because I observed a compilation failure - this is why I created this change.
But if this is not really required then I am ok with Sven's patch.
Ok, also thought that this was the reason why this patch was never sent upstream/should not be sent upstream.
Can you also check the "weird" patch which is in the release since 2014.2.0 but doesn't seem to be in net-next.git/linux.git?
http://git.open-mesh.org/batman-adv.git/commit/31f391475cc08724e96ab060ef4aa6503d11da8e
Thanks,
Sven
Quoted 4 lines · Sven Eckelmann
Can you also check the "weird" patch which is in the release since 2014.2.0 but doesn't seem to be in net-next.git/linux.git?
http://git.open-mesh.org/batman-adv.git/commit/31f391475cc08724e96ab060ef4aa6503d11da8e
Why this patch is not upstream I don't know - it made its way through my pipe to net-next, but probably was never sent.
However, after re-reading this patch and quickly testing the current behaviour with linux-4.0 I have some doubts about its usefulness.
The problem I tried to fix with this patch started by observing that when changing the MAC address of a soft-iface VLAN (e.g. bat0.2) ndo_set_mac_address() seemed not to be called.
Therefore with this patch I change the no-purge MAC addresses in the local translation table when the MAC address of bat0 got changed.
I think we would need to investigate a bit more if this is still true or not and then decide to revert or not this patch (in the latter case I will send it to net-next).
A test that could be done consists in checking if ndo_set_mac_address() gets invoked when changing the MAC address of any bat0.x interface.
Cheers,
Signature · 1 line
Antonio Quartulli