Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Aug 2020 19:15:09 +0000 (UTC)
From:      Vincenzo Maffione <vmaffione@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r364879 - stable/11/sys/dev/e1000
Message-ID:  <202008271915.07RJF9do067859@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vmaffione
Date: Thu Aug 27 19:15:09 2020
New Revision: 364879
URL: https://svnweb.freebsd.org/changeset/base/364879

Log:
  MFC r363995
  
  em(4): honor vlanhwtag offload
  
  The FreeBSD em driver fails to properly reset the VME flag
  in the e1000 CTRL register oneg the following ifconfig command
  
      ifconfig em1 -vlanhwtag
  
  Tested on the e1000 device emulated by QEMU, and on a real
  NIC (chip=0x10d38086).
  
  PR:     236584
  Submitted by:    murat@sunnyvalley.io
  Reported by:     murat@sunnyvalley.io
  Differential Revision:  https://reviews.freebsd.org/D25286

Modified:
  stable/11/sys/dev/e1000/if_em.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/e1000/if_em.c
==============================================================================
--- stable/11/sys/dev/e1000/if_em.c	Thu Aug 27 19:12:39 2020	(r364878)
+++ stable/11/sys/dev/e1000/if_em.c	Thu Aug 27 19:15:09 2020	(r364879)
@@ -1451,6 +1451,11 @@ em_init_locked(struct adapter *adapter)
 			ctrl |= E1000_CTRL_VME;
 			E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl);
 		}
+	} else {
+		u32 ctrl;
+		ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL);
+		ctrl &= ~E1000_CTRL_VME;
+		E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl);
 	}
 
 	/* Don't lose promiscuous settings */



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