datapath: check for el6 kernels for per_cpu
[cascardo/ovs.git] / datapath / vport-netdev.c
index 9c0908a..de85087 100644 (file)
@@ -35,6 +35,7 @@
 #include "vport-internal_dev.h"
 #include "vport-netdev.h"
 
+static struct vport_ops ovs_netdev_vport_ops;
 static void netdev_port_receive(struct vport *vport, struct sk_buff *skb);
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
@@ -133,6 +134,7 @@ static struct vport *netdev_create(const struct vport_parms *parms)
        if (err)
                goto error_master_upper_dev_unlink;
 
+       dev_disable_lro(netdev_vport->dev);
        dev_set_promiscuity(netdev_vport->dev, 1);
        netdev_vport->dev->priv_flags |= IFF_OVS_DATAPATH;
        rtnl_unlock();
@@ -274,7 +276,7 @@ struct vport *ovs_netdev_get_vport(struct net_device *dev)
 #endif
 }
 
-const struct vport_ops ovs_netdev_vport_ops = {
+static struct vport_ops ovs_netdev_vport_ops = {
        .type           = OVS_VPORT_TYPE_NETDEV,
        .create         = netdev_create,
        .destroy        = netdev_destroy,
@@ -282,6 +284,16 @@ const struct vport_ops ovs_netdev_vport_ops = {
        .send           = netdev_send,
 };
 
+int __init ovs_netdev_init(void)
+{
+       return ovs_vport_ops_register(&ovs_netdev_vport_ops);
+}
+
+void ovs_netdev_exit(void)
+{
+       ovs_vport_ops_unregister(&ovs_netdev_vport_ops);
+}
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) && \
     !defined HAVE_RHEL_OVS_HOOK
 /*