From: "fortitude.zhang" <[email protected]> Under linux < 3.17, b0ab2fabb5b91da99c189db02e91ae10bc8355c5 is not introduced, which allow internal-dev created by openvswitch datapath deleted by using rtnl interface, this causes data related to internal-dev not freed and stops datapath working correctly.
Signed-off-by: fortitude.zhang <[email protected]> --- datapath/vport-internal_dev.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c index 482af37..7650561 100644 --- a/datapath/vport-internal_dev.c +++ b/datapath/vport-internal_dev.c @@ -157,9 +157,11 @@ static const struct net_device_ops internal_dev_netdev_ops = { #endif }; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) static struct rtnl_link_ops internal_dev_link_ops __read_mostly = { .kind = "openvswitch", }; +#endif static void do_setup(struct net_device *netdev) { @@ -172,7 +174,9 @@ static void do_setup(struct net_device *netdev) IFF_PHONY_HEADROOM | IFF_NO_QUEUE; netdev->destructor = internal_dev_destructor; netdev->ethtool_ops = &internal_dev_ethtool_ops; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) netdev->rtnl_link_ops = &internal_dev_link_ops; +#endif #ifndef HAVE_IFF_NO_QUEUE netdev->tx_queue_len = 0; @@ -312,13 +316,17 @@ int ovs_internal_dev_rtnl_link_register(void) { int err; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) err = rtnl_link_register(&internal_dev_link_ops); if (err < 0) return err; +#endif err = ovs_vport_ops_register(&ovs_internal_vport_ops); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) if (err < 0) rtnl_link_unregister(&internal_dev_link_ops); +#endif return err; } @@ -326,5 +334,7 @@ int ovs_internal_dev_rtnl_link_register(void) void ovs_internal_dev_rtnl_link_unregister(void) { ovs_vport_ops_unregister(&ovs_internal_vport_ops); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) rtnl_link_unregister(&internal_dev_link_ops); +#endif } -- 2.10.2 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
