datapath: Fix comment style.
[cascardo/ovs.git] / datapath / vport-internal_dev.c
index 637d712..a1c4949 100644 (file)
@@ -59,7 +59,8 @@ static struct net_device_stats *internal_dev_sys_stats(struct net_device *netdev
        ovs_vport_get_stats(vport, &vport_stats);
 
        /* The tx and rx stats need to be swapped because the
-        * switch and host OS have opposite perspectives. */
+        * switch and host OS have opposite perspectives.
+        */
        stats->rx_packets       = vport_stats.tx_packets;
        stats->tx_packets       = vport_stats.rx_packets;
        stats->rx_bytes         = vport_stats.tx_bytes;
@@ -151,11 +152,12 @@ static void do_setup(struct net_device *netdev)
        netdev->priv_flags &= ~IFF_TX_SKB_SHARING;
        netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
        netdev->destructor = internal_dev_destructor;
-       SET_ETHTOOL_OPS(netdev, &internal_dev_ethtool_ops);
+       netdev->ethtool_ops = &internal_dev_ethtool_ops;
        netdev->tx_queue_len = 0;
 
        netdev->features = NETIF_F_LLTX | NETIF_F_SG | NETIF_F_FRAGLIST |
-                          NETIF_F_HIGHDMA | NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE;
+                          NETIF_F_HIGHDMA | NETIF_F_HW_CSUM |
+                          NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL;
 
        netdev->vlan_features = netdev->features;
        netdev->features |= NETIF_F_HW_VLAN_CTAG_TX;
@@ -163,6 +165,11 @@ static void do_setup(struct net_device *netdev)
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
        netdev->hw_features = netdev->features & ~NETIF_F_LLTX;
 #endif
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
+       netdev->hw_enc_features = netdev->features;
+#endif
+
        eth_hw_addr_random(netdev);
 }
 
@@ -183,7 +190,7 @@ static struct vport *internal_dev_create(const struct vport_parms *parms)
        netdev_vport = netdev_vport_priv(vport);
 
        netdev_vport->dev = alloc_netdev(sizeof(struct internal_dev),
-                                        parms->name, do_setup);
+                                        parms->name, NET_NAME_UNKNOWN, do_setup);
        if (!netdev_vport->dev) {
                err = -ENOMEM;
                goto error_free_vport;
@@ -236,6 +243,11 @@ static int internal_dev_recv(struct vport *vport, struct sk_buff *skb)
        struct net_device *netdev = netdev_vport_priv(vport)->dev;
        int len;
 
+       if (unlikely(!(netdev->flags & IFF_UP))) {
+               kfree_skb(skb);
+               return 0;
+       }
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
        if (vlan_tx_tag_present(skb)) {
                if (unlikely(!__vlan_put_tag(skb,