From owner-svn-src-stable-10@freebsd.org Thu Apr 6 19:13:41 2017 Return-Path: Delivered-To: svn-src-stable-10@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 E609CD32F95; Thu, 6 Apr 2017 19:13:41 +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 A23048CD; Thu, 6 Apr 2017 19:13:41 +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 v36JDemj013334; Thu, 6 Apr 2017 19:13:40 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v36JDe8S013331; Thu, 6 Apr 2017 19:13:40 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201704061913.v36JDe8S013331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 6 Apr 2017 19:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316588 - stable/10/sys/dev/e1000 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Apr 2017 19:13:42 -0000 Author: sbruno Date: Thu Apr 6 19:13:40 2017 New Revision: 316588 URL: https://svnweb.freebsd.org/changeset/base/316588 Log: Direct commit of fixes to stable/10, resolving PCI passthrough and initialization issues when trying to passthrough a i340 (igb) to VMware. While here, cleanup some bits of em(4) to DTRT as well. PR: 218113 Submitted by: Kaho Toshikazu Modified: stable/10/sys/dev/e1000/if_em.c stable/10/sys/dev/e1000/if_em.h stable/10/sys/dev/e1000/if_igb.c Modified: stable/10/sys/dev/e1000/if_em.c ============================================================================== --- stable/10/sys/dev/e1000/if_em.c Thu Apr 6 19:10:16 2017 (r316587) +++ stable/10/sys/dev/e1000/if_em.c Thu Apr 6 19:13:40 2017 (r316588) @@ -2846,7 +2846,7 @@ em_free_pci_resources(struct adapter *ad if (adapter->msix_mem != NULL) bus_release_resource(dev, SYS_RES_MEMORY, - PCIR_BAR(EM_MSIX_BAR), adapter->msix_mem); + adapter->memrid, adapter->msix_mem); if (adapter->memory != NULL) bus_release_resource(dev, SYS_RES_MEMORY, @@ -2880,9 +2880,9 @@ em_setup_msix(struct adapter *adapter) em_enable_vectors_82574(adapter); #endif /* Map the MSIX BAR */ - int rid = PCIR_BAR(EM_MSIX_BAR); + adapter->memrid = PCIR_BAR(EM_MSIX_BAR); adapter->msix_mem = bus_alloc_resource_any(dev, - SYS_RES_MEMORY, &rid, RF_ACTIVE); + SYS_RES_MEMORY, &adapter->memrid, RF_ACTIVE); if (adapter->msix_mem == NULL) { /* May not be enabled */ device_printf(adapter->dev, @@ -2933,7 +2933,7 @@ msix_one: msi: if (adapter->msix_mem != NULL) { bus_release_resource(dev, SYS_RES_MEMORY, - PCIR_BAR(EM_MSIX_BAR), adapter->msix_mem); + adapter->memrid, adapter->msix_mem); adapter->msix_mem = NULL; } val = 1; Modified: stable/10/sys/dev/e1000/if_em.h ============================================================================== --- stable/10/sys/dev/e1000/if_em.h Thu Apr 6 19:10:16 2017 (r316587) +++ stable/10/sys/dev/e1000/if_em.h Thu Apr 6 19:13:40 2017 (r316588) @@ -400,6 +400,7 @@ struct adapter { struct resource *memory; struct resource *flash; struct resource *msix_mem; + int memrid; struct resource *res; void *tag; Modified: stable/10/sys/dev/e1000/if_igb.c ============================================================================== --- stable/10/sys/dev/e1000/if_igb.c Thu Apr 6 19:10:16 2017 (r316587) +++ stable/10/sys/dev/e1000/if_igb.c Thu Apr 6 19:13:40 2017 (r316588) @@ -2806,7 +2806,7 @@ igb_setup_msix(struct adapter *adapter) msi: if (adapter->msix_mem != NULL) { bus_release_resource(dev, SYS_RES_MEMORY, - PCIR_BAR(IGB_MSIX_BAR), adapter->msix_mem); + adapter->memrid, adapter->msix_mem); adapter->msix_mem = NULL; } msgs = 1;