]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Disable VLAN 0 tagging for none VLAN traffic
authorBrian Maly <brian.maly@oracle.com>
Wed, 28 Oct 2015 23:03:09 +0000 (19:03 -0400)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Tue, 10 Nov 2015 22:25:28 +0000 (14:25 -0800)
Orabug: 22074114

Cisco enic driver on UCS blades tags a None VLAN traffic with VLAN 0, this causes VMs
that do not have the kernel patch " VLAN 0 should be treated as no vlan tag" to drop all
receive traffic as these VMs do not know how to deal with the VLAN 0 tag.
This is also a problem for older VMs that can not take the mentioned patch.

This fix disables the enic driver from tagging a None VLAN traffic with VLAN 0.This
fix is controlled by a driver parameters " disable_vlan0". the default value is disable_vlan0=1
which to disable the driver from tagging traffic with VLAN 0. To revert to original behavior
add "options enic disable_vlan0=0" to /etc/modprobe.con

Signed-off-by: Adnan Misherfi <adnan.misherfi@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/cisco/enic/enic_main.c

index eadae1b412c652974dde24a9a76c5d74a8c3fa29..5d21499823c2ce16884716e5fb20639163ef01b9 100644 (file)
@@ -83,6 +83,11 @@ MODULE_LICENSE("GPL");
 MODULE_VERSION(DRV_VERSION);
 MODULE_DEVICE_TABLE(pci, enic_id_table);
 
+static int disable_vlan0 = 1;
+module_param(disable_vlan0, bool, 0644);
+MODULE_PARM_DESC(disable_vlan0, "Disable VLAN 0");
+
+
 #define ENIC_LARGE_PKT_THRESHOLD               1000
 #define ENIC_MAX_COALESCE_TIMERS               10
 /*  Interrupt moderation table, which will be used to decide the
@@ -1113,9 +1118,10 @@ static void enic_rq_indicate_buf(struct vnic_rq *rq,
                    ipv4_csum_ok)
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
 
-               if (vlan_stripped)
-                       __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tci);
-
+                if ((vlan_stripped) && (!(disable_vlan0) || 
+                        (vlan_tci & CQ_ENET_RQ_DESC_VLAN_TCI_VLAN_MASK)))
+                        __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tci); 
                skb_mark_napi_id(skb, &enic->napi[rq->index]);
                if (enic_poll_busy_polling(rq) ||
                    !(netdev->features & NETIF_F_GRO))