From 926ea16ea3b38df0f34cdccdea92aa4933ca9dd4 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Fri, 4 Mar 2011 15:52:43 -0800 Subject: [PATCH] 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 Acked-by: Ben Pfaff --- datapath/vport-internal_dev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c index 63f3f69c..fff4f4e5 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); } -- 2.30.2