Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Nov 2017 18:08:59 +0000 (UTC)
From:      Sean Bruno <sbruno@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r325492 - head/sys/dev/ixgbe
Message-ID:  <201711061809.vA6I8x5C006174@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sbruno
Date: Mon Nov  6 18:08:59 2017
New Revision: 325492
URL: https://svnweb.freebsd.org/changeset/base/325492

Log:
  Fix ixgbe(4) support for ifconfig's vlanhwtag flag.  Disabling this flag
  will now prevent the driver from stripping vlan tags from packets.
  
  PR:		219390
  Submitted by:	Piotr Pietruszewski <piotr.pietruszewski@intel.com>
  Reported by:	Charles Goncalves <halfling@halfling.com.br>
  Obtained from:	1 week
  Sponsored by:	Intel Corporation
  Differential Revision:	https://reviews.freebsd.org/D12795

Modified:
  head/sys/dev/ixgbe/if_ix.c

Modified: head/sys/dev/ixgbe/if_ix.c
==============================================================================
--- head/sys/dev/ixgbe/if_ix.c	Mon Nov  6 18:07:23 2017	(r325491)
+++ head/sys/dev/ixgbe/if_ix.c	Mon Nov  6 18:08:59 2017	(r325492)
@@ -1754,15 +1754,17 @@ ixgbe_setup_vlan_hw_support(struct adapter *adapter)
 		return;
 
 	/* Setup the queues for vlans */
-	for (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(rxr->me));
-			ctrl |= IXGBE_RXDCTL_VME;
-			IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), ctrl);
+	if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) {
+		for (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(rxr->me));
+				ctrl |= IXGBE_RXDCTL_VME;
+				IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), ctrl);
+			}
+			rxr->vtag_strip = TRUE;
 		}
-		rxr->vtag_strip = TRUE;
 	}
 
 	if ((ifp->if_capenable & IFCAP_VLAN_HWFILTER) == 0)



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