From owner-svn-src-head@freebsd.org Mon Nov 6 18:09:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 283B6E64150; Mon, 6 Nov 2017 18:09:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC3947D5FB; Mon, 6 Nov 2017 18:09:00 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6I90vt006176; Mon, 6 Nov 2017 18:09:00 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6I8x5C006174; Mon, 6 Nov 2017 18:09:00 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201711061809.vA6I8x5C006174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 6 Nov 2017 18:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325492 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 325492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 18:09:01 -0000 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 Reported by: Charles Goncalves 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)