From: Jesse Gross Date: Fri, 4 Mar 2011 23:52:43 +0000 (-0800) Subject: datapath: Enable vlan offload on internal devices. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=926ea16ea3b38df0f34cdccdea92aa4933ca9dd4;p=openvswitch 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 --- 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); }