[Devel] venet: remove SS hook

Submitted by Stanislav Kinsburskiy on April 10, 2017, 2:05 p.m.

Details

Message ID 20170410140455.459.79680.stgit@localhost.localdomain
State New
Series "venet: remove SS hook"
Headers show

Commit Message

Stanislav Kinsburskiy April 10, 2017, 2:05 p.m.
Finally, this silly hook can and has to be removed.
It was added, because venet was created in a automated way on container start.
Now, venet is created by vzctl via netlink (as it should).
And it's destroyed automatilly on network namespace shutdown in cleanup_net().

https://jira.sw.ru/browse/PSBM-64015

Notes: this patch obsoletes the following commits:

455d5ba9506998f589b9929266c12627c9baf589
3e48f57a452b597b23039c3278e67788ac48f8d4
ed93afb07e58beb447556adbb25af11b9da1b62c

Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
---
 drivers/net/venetdev.c |   32 --------------------------------
 1 file changed, 32 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/net/venetdev.c b/drivers/net/venetdev.c
index 6853154..4a7876f 100644
--- a/drivers/net/venetdev.c
+++ b/drivers/net/venetdev.c
@@ -1110,37 +1110,6 @@  static struct cftype venet_cftypes[] = {
 	{ }
 };
 
-/*
- * VE context dropping is happening earlier than
- * pernet_operations::exit method so we can't
- * rely on it and do the cleanup earlier.
- */
-static void venet_stop_notifier(void *data)
-{
-	struct ve_struct *env = data;
-
-	if (env->ve_netns) {
-		struct net_device *dev = env->_venet_dev;
-
-		venet_ext_clean(env);
-		veip_stop(env);
-
-		if (dev) {
-			env->_venet_dev = NULL;
-			rtnl_lock();
-			unregister_netdevice(dev);
-			rtnl_unlock();
-			free_netdev(dev);
-		}
-	}
-}
-
-static struct ve_hook venet_stop_hook = {
-	.fini		= venet_stop_notifier,
-	.priority	= HOOK_PRIO_FINISHING,
-	.owner		= THIS_MODULE,
-};
-
 static int venet_changelink(struct net_device *dev, struct nlattr *tb[],
 			    struct nlattr *data[])
 {
@@ -1220,7 +1189,6 @@  __init int venet_init(void)
 
 	vzioctl_register(&venetcalls);
 	vzmon_register_veaddr_print_cb(veaddr_seq_print);
-	ve_hook_register(VE_SS_CHAIN, &venet_stop_hook);
 
 	return rtnl_link_register(&venet_link_ops);
 

Comments

Kirill Tkhai April 11, 2017, 8:55 a.m.
On 10.04.2017 17:05, Stanislav Kinsburskiy wrote:
> Finally, this silly hook can and has to be removed.
> It was added, because venet was created in a automated way on container start.
> Now, venet is created by vzctl via netlink (as it should).
> And it's destroyed automatilly on network namespace shutdown in cleanup_net().
> 
> https://jira.sw.ru/browse/PSBM-64015
> 
> Notes: this patch obsoletes the following commits:
> 
> 455d5ba9506998f589b9929266c12627c9baf589
> 3e48f57a452b597b23039c3278e67788ac48f8d4
> ed93afb07e58beb447556adbb25af11b9da1b62c
> 
> Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>

Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>

> ---
>  drivers/net/venetdev.c |   32 --------------------------------
>  1 file changed, 32 deletions(-)
> 
> diff --git a/drivers/net/venetdev.c b/drivers/net/venetdev.c
> index 6853154..4a7876f 100644
> --- a/drivers/net/venetdev.c
> +++ b/drivers/net/venetdev.c
> @@ -1110,37 +1110,6 @@ static struct cftype venet_cftypes[] = {
>  	{ }
>  };
>  
> -/*
> - * VE context dropping is happening earlier than
> - * pernet_operations::exit method so we can't
> - * rely on it and do the cleanup earlier.
> - */
> -static void venet_stop_notifier(void *data)
> -{
> -	struct ve_struct *env = data;
> -
> -	if (env->ve_netns) {
> -		struct net_device *dev = env->_venet_dev;
> -
> -		venet_ext_clean(env);
> -		veip_stop(env);
> -
> -		if (dev) {
> -			env->_venet_dev = NULL;
> -			rtnl_lock();
> -			unregister_netdevice(dev);
> -			rtnl_unlock();
> -			free_netdev(dev);
> -		}
> -	}
> -}
> -
> -static struct ve_hook venet_stop_hook = {
> -	.fini		= venet_stop_notifier,
> -	.priority	= HOOK_PRIO_FINISHING,
> -	.owner		= THIS_MODULE,
> -};
> -
>  static int venet_changelink(struct net_device *dev, struct nlattr *tb[],
>  			    struct nlattr *data[])
>  {
> @@ -1220,7 +1189,6 @@ __init int venet_init(void)
>  
>  	vzioctl_register(&venetcalls);
>  	vzmon_register_veaddr_print_cb(veaddr_seq_print);
> -	ve_hook_register(VE_SS_CHAIN, &venet_stop_hook);
>  
>  	return rtnl_link_register(&venet_link_ops);
>  
>