]> git.karo-electronics.de Git - linux-beck.git/commitdiff
igb: enable VLAN stripping for VMs with i350
authorStefan Assmann <sassmann@kpanic.de>
Wed, 11 Dec 2013 22:10:12 +0000 (22:10 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 20 Mar 2014 04:38:54 +0000 (21:38 -0700)
For i350 VLAN stripping for VMs is not enabled in the VMOLR register but in
the DVMOLR register. Making the changes accordingly. It's not necessary to
unset the E1000_VMOLR_STRVLAN bit on i350 as the hardware will simply ignore
it.

Without this change if a VLAN is configured for a VF assigned to a guest
via (i.e.)
ip link set p1p1 vf 0 vlan 10
the VLAN tag will not be stripped from packets going into the VM. Which they
should be because the VM itself is not aware of the VLAN at all.

Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igb/e1000_82575.h
drivers/net/ethernet/intel/igb/e1000_regs.h
drivers/net/ethernet/intel/igb/igb_main.c

index 2a721a15afc16dd83bf829c9faf8bf94fc394824..09d78be72416563beeda5e3cb72a7338b2aa7060 100644 (file)
@@ -230,6 +230,10 @@ struct e1000_adv_tx_context_desc {
 #define E1000_VMOLR_STRVLAN    0x40000000 /* Vlan stripping enable */
 #define E1000_VMOLR_STRCRC     0x80000000 /* CRC stripping enable */
 
+#define E1000_DVMOLR_HIDEVLAN  0x20000000 /* Hide vlan enable */
+#define E1000_DVMOLR_STRVLAN   0x40000000 /* Vlan stripping enable */
+#define E1000_DVMOLR_STRCRC    0x80000000 /* CRC stripping enable */
+
 #define E1000_VLVF_ARRAY_SIZE     32
 #define E1000_VLVF_VLANID_MASK    0x00000FFF
 #define E1000_VLVF_POOLSEL_SHIFT  12
index e9c5fdd60f5462a923f3b91aff35c246e3851028..d0f14be3d94ffeff5e75d384e4d8fd167c9fb6c8 100644 (file)
 #define E1000_P2VMAILBOX(_n)   (0x00C00 + (4 * (_n)))
 #define E1000_VMBMEM(_n)       (0x00800 + (64 * (_n)))
 #define E1000_VMOLR(_n)        (0x05AD0 + (4 * (_n)))
+#define E1000_DVMOLR(_n)       (0x0C038 + (64 * (_n)))
 #define E1000_VLVF(_n)         (0x05D00 + (4 * (_n))) /* VLAN Virtual Machine
                                                        * Filter - RW */
 #define E1000_VMVIR(_n)        (0x03700 + (4 * (_n)))
index ac06492fb8163c950d476c0980b108f990b08ee4..313e1a87ea9f8657077520bc14ce25794efdd844 100644 (file)
@@ -3542,6 +3542,13 @@ static inline void igb_set_vmolr(struct igb_adapter *adapter,
 
        vmolr = rd32(E1000_VMOLR(vfn));
        vmolr |= E1000_VMOLR_STRVLAN; /* Strip vlan tags */
+       if (hw->mac.type == e1000_i350) {
+               u32 dvmolr;
+
+               dvmolr = rd32(E1000_DVMOLR(vfn));
+               dvmolr |= E1000_DVMOLR_STRVLAN;
+               wr32(E1000_DVMOLR(vfn), dvmolr);
+       }
        if (aupe)
                vmolr |= E1000_VMOLR_AUPE; /* Accept untagged packets */
        else