All of lore.kernel.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH-next 1/3] net: propagate upper priv via netdev_master_upper_dev_link
@ 2015-12-08 20:35 Sven Eckelmann
  2015-12-08 20:35 ` [B.A.T.M.A.N.] [PATCH-next 2/3] net: add possibility to pass information about upper device via notifier Sven Eckelmann
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Sven Eckelmann @ 2015-12-08 20:35 UTC (permalink / raw)
  To: b.a.t.m.a.n

From: Jiri Pirko <jiri@mellanox.com>

Eliminate netdev_master_upper_dev_link_private and pass priv directly as
a parameter of netdev_master_upper_dev_link.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 compat-include/linux/netdevice.h | 7 +++++++
 net/batman-adv/hard-interface.c  | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/compat-include/linux/netdevice.h b/compat-include/linux/netdevice.h
index f19f624..a8da7bf 100644
--- a/compat-include/linux/netdevice.h
+++ b/compat-include/linux/netdevice.h
@@ -117,4 +117,11 @@ static inline int batadv_netdev_set_master(struct net_device *slave,
 
 #endif /* < KERNEL_VERSION(3, 19, 0) */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
+
+#define netdev_master_upper_dev_link(dev, upper_dev, upper_priv) \
+	netdev_master_upper_dev_link(dev, upper_dev)
+
+#endif /* < KERNEL_VERSION(4, 5, 0) */
+
 #endif	/* _NET_BATMAN_ADV_COMPAT_LINUX_NETDEVICE_H_ */
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index bef9147..484c50e 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -466,7 +466,8 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
 	hard_iface->soft_iface = soft_iface;
 	bat_priv = netdev_priv(hard_iface->soft_iface);
 
-	ret = netdev_master_upper_dev_link(hard_iface->net_dev, soft_iface);
+	ret = netdev_master_upper_dev_link(hard_iface->net_dev,
+					   soft_iface, NULL);
 	if (ret)
 		goto err_dev;
 
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [B.A.T.M.A.N.] [PATCH-next 2/3] net: add possibility to pass information about upper device via notifier
  2015-12-08 20:35 [B.A.T.M.A.N.] [PATCH-next 1/3] net: propagate upper priv via netdev_master_upper_dev_link Sven Eckelmann
@ 2015-12-08 20:35 ` Sven Eckelmann
  2015-12-13  6:04   ` Marek Lindner
  2015-12-08 20:35 ` [B.A.T.M.A.N.] [PATCH-next 3/3] batman-adv: Act on NETDEV_*_TYPE_CHANGE events Sven Eckelmann
  2015-12-13  6:01 ` [B.A.T.M.A.N.] [PATCH-next 1/3] net: propagate upper priv via netdev_master_upper_dev_link Marek Lindner
  2 siblings, 1 reply; 6+ messages in thread
From: Sven Eckelmann @ 2015-12-08 20:35 UTC (permalink / raw)
  To: b.a.t.m.a.n

From: Jiri Pirko <jiri@mellanox.com>

Sometimes the drivers and other code would find it handy to know some
internal information about upper device being changed. So allow upper-code
to pass information down to notifier listeners during linking.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 compat-include/linux/netdevice.h | 2 +-
 net/batman-adv/hard-interface.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compat-include/linux/netdevice.h b/compat-include/linux/netdevice.h
index a8da7bf..34e5ac7 100644
--- a/compat-include/linux/netdevice.h
+++ b/compat-include/linux/netdevice.h
@@ -119,7 +119,7 @@ static inline int batadv_netdev_set_master(struct net_device *slave,
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
 
-#define netdev_master_upper_dev_link(dev, upper_dev, upper_priv) \
+#define netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info) \
 	netdev_master_upper_dev_link(dev, upper_dev)
 
 #endif /* < KERNEL_VERSION(4, 5, 0) */
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 484c50e..2d1470f 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -467,7 +467,7 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
 	bat_priv = netdev_priv(hard_iface->soft_iface);
 
 	ret = netdev_master_upper_dev_link(hard_iface->net_dev,
-					   soft_iface, NULL);
+					   soft_iface, NULL, NULL);
 	if (ret)
 		goto err_dev;
 
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [B.A.T.M.A.N.] [PATCH-next 3/3] batman-adv: Act on NETDEV_*_TYPE_CHANGE events
  2015-12-08 20:35 [B.A.T.M.A.N.] [PATCH-next 1/3] net: propagate upper priv via netdev_master_upper_dev_link Sven Eckelmann
  2015-12-08 20:35 ` [B.A.T.M.A.N.] [PATCH-next 2/3] net: add possibility to pass information about upper device via notifier Sven Eckelmann
@ 2015-12-08 20:35 ` Sven Eckelmann
  2015-12-13  6:30   ` Marek Lindner
  2015-12-13  6:01 ` [B.A.T.M.A.N.] [PATCH-next 1/3] net: propagate upper priv via netdev_master_upper_dev_link Marek Lindner
  2 siblings, 1 reply; 6+ messages in thread
From: Sven Eckelmann @ 2015-12-08 20:35 UTC (permalink / raw)
  To: b.a.t.m.a.n

From: Andrew Lunn <andrew@lunn.ch>

A network interface can change type. It may change from a type which
batman does not support, e.g. hdlc, to one it does, e.g. hdlc-eth.
When an interface changes type, it sends two notifications. Handle
these notifications.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 compat-include/linux/netdevice.h | 3 +++
 net/batman-adv/hard-interface.c  | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/compat-include/linux/netdevice.h b/compat-include/linux/netdevice.h
index 34e5ac7..10253e0 100644
--- a/compat-include/linux/netdevice.h
+++ b/compat-include/linux/netdevice.h
@@ -58,6 +58,9 @@ struct batadv_dev_addr_list {
 	int da_gusers;
 };
 
+#define NETDEV_PRE_TYPE_CHANGE	0x000E
+#define NETDEV_POST_TYPE_CHANGE	0x000F
+
 #endif /* < KERNEL_VERSION(2, 6, 35) */
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 2d1470f..49e05d2 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -714,7 +714,8 @@ static int batadv_hard_if_event(struct notifier_block *this,
 	}
 
 	hard_iface = batadv_hardif_get_by_netdev(net_dev);
-	if (!hard_iface && event == NETDEV_REGISTER)
+	if (!hard_iface && (event == NETDEV_REGISTER ||
+			    event == NETDEV_POST_TYPE_CHANGE))
 		hard_iface = batadv_hardif_add_interface(net_dev);
 
 	if (!hard_iface)
@@ -729,6 +730,7 @@ static int batadv_hard_if_event(struct notifier_block *this,
 		batadv_hardif_deactivate_interface(hard_iface);
 		break;
 	case NETDEV_UNREGISTER:
+	case NETDEV_PRE_TYPE_CHANGE:
 		list_del_rcu(&hard_iface->list);
 
 		batadv_hardif_remove_interface(hard_iface);
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH-next 1/3] net: propagate upper priv via netdev_master_upper_dev_link
  2015-12-08 20:35 [B.A.T.M.A.N.] [PATCH-next 1/3] net: propagate upper priv via netdev_master_upper_dev_link Sven Eckelmann
  2015-12-08 20:35 ` [B.A.T.M.A.N.] [PATCH-next 2/3] net: add possibility to pass information about upper device via notifier Sven Eckelmann
  2015-12-08 20:35 ` [B.A.T.M.A.N.] [PATCH-next 3/3] batman-adv: Act on NETDEV_*_TYPE_CHANGE events Sven Eckelmann
@ 2015-12-13  6:01 ` Marek Lindner
  2 siblings, 0 replies; 6+ messages in thread
From: Marek Lindner @ 2015-12-13  6:01 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

On Tuesday, December 08, 2015 21:35:13 Sven Eckelmann wrote:
> From: Jiri Pirko <jiri@mellanox.com>
> 
> Eliminate netdev_master_upper_dev_link_private and pass priv directly as
> a parameter of netdev_master_upper_dev_link.
> 
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
>  compat-include/linux/netdevice.h | 7 +++++++
>  net/batman-adv/hard-interface.c  | 3 ++-
>  2 files changed, 9 insertions(+), 1 deletion(-)

Applied in revision d794c1c.

Thanks,
Marek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH-next 2/3] net: add possibility to pass information about upper device via notifier
  2015-12-08 20:35 ` [B.A.T.M.A.N.] [PATCH-next 2/3] net: add possibility to pass information about upper device via notifier Sven Eckelmann
@ 2015-12-13  6:04   ` Marek Lindner
  0 siblings, 0 replies; 6+ messages in thread
From: Marek Lindner @ 2015-12-13  6:04 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 612 bytes --]

On Tuesday, December 08, 2015 21:35:14 Sven Eckelmann wrote:
> From: Jiri Pirko <jiri@mellanox.com>
> 
> Sometimes the drivers and other code would find it handy to know some
> internal information about upper device being changed. So allow upper-code
> to pass information down to notifier listeners during linking.
> 
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
>  compat-include/linux/netdevice.h | 2 +-
>  net/batman-adv/hard-interface.c  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Applied in revision 4291a5b.

Thanks,
Marek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH-next 3/3] batman-adv: Act on NETDEV_*_TYPE_CHANGE events
  2015-12-08 20:35 ` [B.A.T.M.A.N.] [PATCH-next 3/3] batman-adv: Act on NETDEV_*_TYPE_CHANGE events Sven Eckelmann
@ 2015-12-13  6:30   ` Marek Lindner
  0 siblings, 0 replies; 6+ messages in thread
From: Marek Lindner @ 2015-12-13  6:30 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 630 bytes --]

On Tuesday, December 08, 2015 21:35:58 Sven Eckelmann wrote:
> From: Andrew Lunn <andrew@lunn.ch>
> 
> A network interface can change type. It may change from a type which
> batman does not support, e.g. hdlc, to one it does, e.g. hdlc-eth.
> When an interface changes type, it sends two notifications. Handle
> these notifications.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
>  compat-include/linux/netdevice.h | 3 +++
>  net/batman-adv/hard-interface.c  | 4 +++-
>  2 files changed, 6 insertions(+), 1 deletion(-)

Applied in revision 399bf29.

Thanks,
Marek



[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-12-13  6:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-08 20:35 [B.A.T.M.A.N.] [PATCH-next 1/3] net: propagate upper priv via netdev_master_upper_dev_link Sven Eckelmann
2015-12-08 20:35 ` [B.A.T.M.A.N.] [PATCH-next 2/3] net: add possibility to pass information about upper device via notifier Sven Eckelmann
2015-12-13  6:04   ` Marek Lindner
2015-12-08 20:35 ` [B.A.T.M.A.N.] [PATCH-next 3/3] batman-adv: Act on NETDEV_*_TYPE_CHANGE events Sven Eckelmann
2015-12-13  6:30   ` Marek Lindner
2015-12-13  6:01 ` [B.A.T.M.A.N.] [PATCH-next 1/3] net: propagate upper priv via netdev_master_upper_dev_link Marek Lindner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.