Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Sep 2013 20:40:53 +0400
From:      Oleg Bulyzhin <oleg@FreeBSD.org>
To:        Rumen Telbizov <telbizov@gmail.com>
Cc:        "freebsd-stable@freebsd.org" <freebsd-stable@freebsd.org>, Jack Vogel <jack.vogel@intel.com>
Subject:   Re: FreeBSD 9.1 ix driver vlan problem
Message-ID:  <20130925164053.GB76403@lath.rinet.ru>
In-Reply-To: <CAENR%2B_VmdCcdfdqUz8%2BRdtnsuWDRokteAyMtLZN3BF%2BH%2BX8MjQ@mail.gmail.com>
References:  <CAENR%2B_VmdCcdfdqUz8%2BRdtnsuWDRokteAyMtLZN3BF%2BH%2BX8MjQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--mxv5cy4qt+RJ9ypb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline


I'm running my ixgbe servers with attached patch.
It does solve this problem for me.

-- 
Oleg.

================================================================
=== Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- oleg@rinet.ru ===
================================================================


--mxv5cy4qt+RJ9ypb
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="ixgbe.diff"

Index: sys/dev/ixgbe/ixgbe.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ixgbe/ixgbe.c,v
retrieving revision 1.53.2.6.2.2
diff -u -r1.53.2.6.2.2 ixgbe.c
--- sys/dev/ixgbe/ixgbe.c	17 Nov 2012 08:47:49 -0000	1.53.2.6.2.2
+++ sys/dev/ixgbe/ixgbe.c	20 Sep 2013 12:39:27 -0000
@@ -1198,9 +1198,6 @@
 		IXGBE_WRITE_REG(hw, IXGBE_RDT(i), adapter->num_rx_desc - 1);
 	}
 
-	/* Set up VLAN support and filter */
-	ixgbe_setup_vlan_hw_support(adapter);
-
 	/* Enable Receive engine */
 	rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL);
 	if (hw->mac.type == ixgbe_mac_82598EB)
@@ -1284,6 +1281,9 @@
 	/* Initialize the FC settings */
 	ixgbe_start_hw(hw);
 
+	/* Set up VLAN support and filter */
+	ixgbe_setup_vlan_hw_support(adapter);
+
 	/* And now turn on interrupts */
 	ixgbe_enable_intr(adapter);
 
@@ -4736,7 +4736,8 @@
 	bit = vtag & 0x1F;
 	adapter->shadow_vfta[index] |= (1 << bit);
 	++adapter->num_vlans;
-	ixgbe_init_locked(adapter);
+	//ixgbe_init_locked(adapter);
+	ixgbe_setup_vlan_hw_support(adapter);
 	IXGBE_CORE_UNLOCK(adapter);
 }
 
@@ -4763,7 +4764,8 @@
 	adapter->shadow_vfta[index] &= ~(1 << bit);
 	--adapter->num_vlans;
 	/* Re-init to load the changes */
-	ixgbe_init_locked(adapter);
+	//ixgbe_init_locked(adapter);
+	ixgbe_setup_vlan_hw_support(adapter);
 	IXGBE_CORE_UNLOCK(adapter);
 }
 
@@ -4785,6 +4787,20 @@
 	if (adapter->num_vlans == 0)
 		return;
 
+	/* Setup the queues for vlans */
+	for (int i = 0; i < adapter->num_queues; i++) {
+		rxr = &adapter->rx_rings[i];
+		/* On 82599 the VLAN enable is per/queue in RXDCTL */
+		if (hw->mac.type != ixgbe_mac_82598EB) {
+			ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i));
+			ctrl |= IXGBE_RXDCTL_VME;
+			IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), ctrl);
+		}
+		rxr->vtag_strip = TRUE;
+	}
+
+	if ((ifp->if_capenable & IFCAP_VLAN_HWFILTER) == 0)
+		return;
 	/*
 	** A soft reset zero's out the VFTA, so
 	** we need to repopulate it now.
@@ -4803,18 +4819,6 @@
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		ctrl |= IXGBE_VLNCTRL_VME;
 	IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, ctrl);
-
-	/* Setup the queues for vlans */
-	for (int i = 0; i < adapter->num_queues; i++) {
-		rxr = &adapter->rx_rings[i];
-		/* On 82599 the VLAN enable is per/queue in RXDCTL */
-		if (hw->mac.type != ixgbe_mac_82598EB) {
-			ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i));
-			ctrl |= IXGBE_RXDCTL_VME;
-			IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), ctrl);
-		}
-		rxr->vtag_strip = TRUE;
-	}
 }
 
 static void

--mxv5cy4qt+RJ9ypb--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130925164053.GB76403>