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=b... * https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=b... * https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a...
Patches which are in batman-adv master but should be in this release:
* http://git.open-mesh.org/batman-adv.git/commit/3f74f359cb7e96bbc68d62e1fc48b...
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/b53915310227cc9b029ba0fa5aae...
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/31f391475cc08724e96ab060ef4aa... (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
From: Marek Lindner mareklindner@neomailbox.ch
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.
Reported-by: Andreas Pape APape@phoenixcontact.com Signed-off-by: Marek Lindner mareklindner@neomailbox.ch Signed-off-by: Sven Eckelmann sven@narfation.org --- compat.h | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/compat.h b/compat.h index 835c6ea..45412b0 100644 --- a/compat.h +++ b/compat.h @@ -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.
From: Rasmus Villemoes linux@rasmusvillemoes.dk
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 linux@rasmusvillemoes.dk Cc: Marek Lindner mareklindner@neomailbox.ch Acked-by: Antonio Quartulli antonio@meshcoding.com Signed-off-by: Andrew Morton akpm@linux-foundation.org Signed-off-by: Linus Torvalds torvalds@linux-foundation.org Signed-off-by: Sven Eckelmann sven@narfation.org --- gateway_common.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gateway_common.c b/gateway_common.c index 6f5e621..88a1bc3 100644 --- a/gateway_common.c +++ b/gateway_common.c @@ -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'; }
On Friday, April 17, 2015 18:34:17 Sven Eckelmann wrote:
From: Rasmus Villemoes linux@rasmusvillemoes.dk
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 linux@rasmusvillemoes.dk Cc: Marek Lindner mareklindner@neomailbox.ch Acked-by: Antonio Quartulli antonio@meshcoding.com Signed-off-by: Andrew Morton akpm@linux-foundation.org Signed-off-by: Linus Torvalds torvalds@linux-foundation.org Signed-off-by: Sven Eckelmann sven@narfation.org
gateway_common.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Applied in revision 5ba0a63.
Thanks, Marek
From: Himangi Saraogi himangi774@gmail.com
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>
Signed-off-by: Himangi Saraogi himangi774@gmail.com Acked-by: Julia Lawall julia.lawall@lip6.fr Signed-off-by: David S. Miller davem@davemloft.net Signed-off-by: Sven Eckelmann sven@narfation.org --- sysfs.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/sysfs.c b/sysfs.c index a63c3eb..a75dc12 100644 --- a/sysfs.c +++ b/sysfs.c @@ -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);
On Friday, April 17, 2015 18:34:18 Sven Eckelmann wrote:
From: Himangi Saraogi himangi774@gmail.com
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>
Signed-off-by: Himangi Saraogi himangi774@gmail.com Acked-by: Julia Lawall julia.lawall@lip6.fr Signed-off-by: David S. Miller davem@davemloft.net Signed-off-by: Sven Eckelmann sven@narfation.org
sysfs.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-)
Applied in revision aeb0f1d.
Thanks, Marek
From: Nicolas Dichtel nicolas.dichtel@6wind.com
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 nicolas.dichtel@6wind.com Signed-off-by: David S. Miller davem@davemloft.net [sven@narfation.org: added compat code] Signed-off-by: Sven Eckelmann sven@narfation.org --- 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(-)
diff --git a/compat.h b/compat.h index 45412b0..0332296 100644 --- a/compat.h +++ b/compat.h @@ -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_ */ diff --git a/hard-interface.c b/hard-interface.c index fbda6b5..baf1f98 100644 --- a/hard-interface.c +++ b/hard-interface.c @@ -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;
From: Nicolas Dichtel nicolas.dichtel@6wind.com
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 nicolas.dichtel@6wind.com Signed-off-by: David S. Miller davem@davemloft.net [sven@narfation.org: added compat code] Signed-off-by: Sven Eckelmann sven@narfation.org --- 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(-)
diff --git a/compat.h b/compat.h index 45412b0..0332296 100644 --- a/compat.h +++ b/compat.h @@ -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_ */ diff --git a/hard-interface.c b/hard-interface.c index fbda6b5..baf1f98 100644 --- a/hard-interface.c +++ b/hard-interface.c @@ -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;
From: Nicolas Dichtel nicolas.dichtel@6wind.com
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 nicolas.dichtel@6wind.com Signed-off-by: David S. Miller davem@davemloft.net [sven@narfation.org: added compat code] Signed-off-by: Sven Eckelmann sven@narfation.org --- 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(-)
diff --git a/compat.h b/compat.h index 45412b0..0332296 100644 --- a/compat.h +++ b/compat.h @@ -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_ */ diff --git a/hard-interface.c b/hard-interface.c index fbda6b5..baf1f98 100644 --- a/hard-interface.c +++ b/hard-interface.c @@ -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;
On Friday, April 17, 2015 19:15:10 Sven Eckelmann wrote:
From: Nicolas Dichtel nicolas.dichtel@6wind.com
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 nicolas.dichtel@6wind.com Signed-off-by: David S. Miller davem@davemloft.net [sven@narfation.org: added compat code] Signed-off-by: Sven Eckelmann sven@narfation.org
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(-)
Applied in revision f8a8f60.
Thanks, Marek
The original patch b53915310227cc9b029ba0fa5aae44e50a461f80 should not be submitted to net-next. So just remove it and replace it with compat code.
Signed-off-by: Sven Eckelmann sven@narfation.org --- 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(-)
diff --git a/compat.c b/compat.c index 3dbf9d2..516d06c 100644 --- a/compat.c +++ b/compat.c @@ -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; diff --git a/compat.h b/compat.h index 0332296..e55c1d6 100644 --- a/compat.h +++ b/compat.h @@ -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) { diff --git a/soft-interface.c b/soft-interface.c index 8748987..70edc41 100644 --- a/soft-interface.c +++ b/soft-interface.c @@ -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); } }
The original patch b53915310227cc9b029ba0fa5aae44e50a461f80 should not be submitted to net-next. It can be better implemented using compat code.
Signed-off-by: Sven Eckelmann sven@narfation.org --- 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(-)
diff --git a/compat.c b/compat.c index 3dbf9d2..516d06c 100644 --- a/compat.c +++ b/compat.c @@ -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; diff --git a/compat.h b/compat.h index 0332296..e55c1d6 100644 --- a/compat.h +++ b/compat.h @@ -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) { diff --git a/soft-interface.c b/soft-interface.c index 8748987..70edc41 100644 --- a/soft-interface.c +++ b/soft-interface.c @@ -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); } }
On 17/04/15 19:18, Sven Eckelmann wrote:
The original patch b53915310227cc9b029ba0fa5aae44e50a461f80 should not be submitted to net-next. It can be better implemented using compat code.
Signed-off-by: Sven Eckelmann sven@narfation.org
Acked-by: Antonio Quartulli antonio@meshcoding.com
Cheers,
On Monday, April 20, 2015 16:06:41 Antonio Quartulli wrote:
On 17/04/15 19:18, Sven Eckelmann wrote:
The original patch b53915310227cc9b029ba0fa5aae44e50a461f80 should not be submitted to net-next. It can be better implemented using compat code.
Signed-off-by: Sven Eckelmann sven@narfation.org
Acked-by: Antonio Quartulli antonio@meshcoding.com
Applied in revision e78c16c.
Thanks, Marek
The 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.
Signed-off-by: Sven Eckelmann sven@narfation.org --- send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/send.c b/send.c index d27161e..3d64ed2 100644 --- a/send.c +++ b/send.c @@ -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)
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_unicast than 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
On Monday 20 April 2015 23:27:00 Marek Lindner wrote:
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_unicast than 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
On 20/04/15 18:05, Sven Eckelmann wrote:
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,
On Friday, April 17, 2015 18:34:16 Sven Eckelmann wrote:
From: Marek Lindner mareklindner@neomailbox.ch
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.
Reported-by: Andreas Pape APape@phoenixcontact.com Signed-off-by: Marek Lindner mareklindner@neomailbox.ch Signed-off-by: Sven Eckelmann sven@narfation.org
compat.h | 9 +++++++++ 1 file changed, 9 insertions(+)
I have already cherry-picked that patch myself.
Thanks, Marek
On Monday 20 April 2015 11:32:23 Marek Lindner wrote:
On Friday, April 17, 2015 18:34:16 Sven Eckelmann wrote:
From: Marek Lindner mareklindner@neomailbox.ch
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.
Reported-by: Andreas Pape APape@phoenixcontact.com Signed-off-by: Marek Lindner mareklindner@neomailbox.ch Signed-off-by: Sven Eckelmann sven@narfation.org
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
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: [...]
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
On Friday 17 April 2015 20:03:06 Sven Eckelmann wrote:
On Friday 17 April 2015 18:32:45 Sven Eckelmann wrote: [...]
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.
Patches which are in batman-adv master but should be in this release:
http://git.open-mesh.org/batman-adv.git/commit/3f74f359cb7e96bbc68d62e1fc48 b04b6efb4ca7
I moved the patch to main (not strictly necessary as maint will be replaced soon) and merge my way up to master.
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/b53915310227cc9b029ba0fa5aa e44e50a461f80
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);
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/31f391475cc08724e96ab060ef4a a6503d11da8e (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: [...]
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 a e44e50a461f80
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);
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
On Monday, April 20, 2015 08:05:20 Sven Eckelmann wrote:
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);
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.
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
On 20/04/15 08:30, Marek Lindner wrote:
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,
On Monday 20 April 2015 14:05:18 Antonio Quartulli wrote:
On 20/04/15 08:30, Marek Lindner wrote:
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.
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/31f391475cc08724e96ab060ef4aa...
Thanks, Sven
On 20/04/15 14:12, Sven Eckelmann wrote:
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/31f391475cc08724e96ab060ef4aa...
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,
b.a.t.m.a.n@lists.open-mesh.org