/** * ovs_vport_exit - shutdown vport subsystem * * Called at module exit time to shutdown the vport subsystem. */ void ovs_vport_exit(void) { ovs_stt_cleanup_module(); vxlan_cleanup_module(); geneve_cleanup_module(); ipgre_fini(); lisp_cleanup_module(); kfree(dev_table); }
/** * ovs_vport_exit - shutdown vport subsystem * * Called at module exit time to shutdown the vport subsystem. */ void ovs_vport_exit(void) { if (compat_gre_loaded) { gre_exit(); ipgre_fini(); } ovs_stt_cleanup_module(); vxlan_cleanup_module(); geneve_cleanup_module(); if (compat_ip6_tunnel_loaded) ip6_tunnel_cleanup(); ip6gre_fini(); lisp_cleanup_module(); kfree(dev_table); }
/** * ovs_vport_init - initialize vport subsystem * * Called at module load time to initialize the vport subsystem. */ int ovs_vport_init(void) { int err; dev_table = kzalloc(VPORT_HASH_BUCKETS * sizeof(struct hlist_head), GFP_KERNEL); if (!dev_table) return -ENOMEM; err = lisp_init_module(); if (err) goto err_lisp; err = ipgre_init(); if (err) goto err_gre; err = geneve_init_module(); if (err) goto err_geneve; err = vxlan_init_module(); if (err) goto err_vxlan; err = ovs_stt_init_module(); if (err) goto err_stt; return 0; err_stt: vxlan_cleanup_module(); err_vxlan: geneve_cleanup_module(); err_geneve: ipgre_fini(); err_gre: lisp_cleanup_module(); err_lisp: kfree(dev_table); return err; }
/** * ovs_vport_init - initialize vport subsystem * * Called at module load time to initialize the vport subsystem. */ int ovs_vport_init(void) { int err; dev_table = kcalloc(VPORT_HASH_BUCKETS, sizeof(struct hlist_head), GFP_KERNEL); if (!dev_table) return -ENOMEM; err = lisp_init_module(); if (err) goto err_lisp; err = gre_init(); if (err && err != -EEXIST) { goto err_gre; } else { if (err == -EEXIST) { pr_warn("Cannot take GRE protocol rx entry"\ "- The GRE/ERSPAN rx feature not supported\n"); /* continue GRE tx */ } err = ipgre_init(); if (err && err != -EEXIST) goto err_ipgre; compat_gre_loaded = true; } err = ip6gre_init(); if (err && err != -EEXIST) { goto err_ip6gre; } else { if (err == -EEXIST) { pr_warn("IPv6 GRE/ERSPAN Rx mode is not supported\n"); goto skip_ip6_tunnel_init; } } err = ip6_tunnel_init(); if (err) goto err_ip6_tunnel; else compat_ip6_tunnel_loaded = true; skip_ip6_tunnel_init: err = geneve_init_module(); if (err) goto err_geneve; err = vxlan_init_module(); if (err) goto err_vxlan; err = ovs_stt_init_module(); if (err) goto err_stt; return 0; ovs_stt_cleanup_module(); err_stt: vxlan_cleanup_module(); err_vxlan: geneve_cleanup_module(); err_geneve: ip6_tunnel_cleanup(); err_ip6_tunnel: ip6gre_fini(); err_ip6gre: ipgre_fini(); err_ipgre: gre_exit(); err_gre: lisp_cleanup_module(); err_lisp: kfree(dev_table); return err; }