From ea84c751437e6dba1757fa6df5675f049553d7f4 Mon Sep 17 00:00:00 2001 From: Brian Maly Date: Wed, 28 Oct 2015 19:03:09 -0400 Subject: [PATCH] Disable VLAN 0 tagging for none VLAN traffic 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 Signed-off-by: Brian Maly --- drivers/net/ethernet/cisco/enic/enic_main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index eadae1b412c6..5d21499823c2 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c @@ -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)) -- 2.50.1