summaryrefslogtreecommitdiff
path: root/datapath/vport-internal_dev.c
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2011-03-04 15:52:43 -0800
committerJesse Gross <jesse@nicira.com>2011-03-09 16:27:55 -0800
commit926ea16ea3b38df0f34cdccdea92aa4933ca9dd4 (patch)
tree8e2853d056ae3b3d60f753d9dfb77e8a1948fc7c /datapath/vport-internal_dev.c
parent70315176de81b49b7dcd4d65f09991f3217813af (diff)
downloadopenvswitch-926ea16ea3b38df0f34cdccdea92aa4933ca9dd4.tar.gz
datapath: Enable vlan offload on internal devices.
Although it is generally best to configure vlans directly though Open vSwitch, enabling vlan acceleration on internal devices can avoid some issues and hardware limitations if Linux vlan devices are used. It is only used on kernels that support modern vlan data structures, which are 2.6.27 and later. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath/vport-internal_dev.c')
-rw-r--r--datapath/vport-internal_dev.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c
index 63f3f69ce..fff4f4e59 100644
--- a/datapath/vport-internal_dev.c
+++ b/datapath/vport-internal_dev.c
@@ -176,6 +176,11 @@ static void do_setup(struct net_device *netdev)
netdev->features = NETIF_F_LLTX | NETIF_F_SG | NETIF_F_FRAGLIST |
NETIF_F_HIGHDMA | NETIF_F_HW_CSUM | NETIF_F_TSO;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+ netdev->vlan_features = netdev->features;
+ netdev->features |= NETIF_F_HW_VLAN_TX;
+#endif
+
vport_gen_rand_ether_addr(netdev->dev_addr);
}