From owner-svn-src-head@freebsd.org Thu Jan 12 14:18:53 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 8B6ECCACEEB; Thu, 12 Jan 2017 14:18:53 +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 5AF99191C; Thu, 12 Jan 2017 14:18:53 +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 v0CEIqIH095433; Thu, 12 Jan 2017 14:18:52 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0CEIq2N095432; Thu, 12 Jan 2017 14:18:52 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701121418.v0CEIq2N095432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 12 Jan 2017 14:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311978 - head/sys/dev/e1000 X-SVN-Group: head 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: Thu, 12 Jan 2017 14:18:53 -0000 Author: sbruno Date: Thu Jan 12 14:18:52 2017 New Revision: 311978 URL: https://svnweb.freebsd.org/changeset/base/311978 Log: Attempt to use the "new" BAR address for newer igb(4) devices. This code was dropped during the IFLIB migration. Reported by: olivier Reviewed by: mmacy@nextbsd.org Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jan 12 13:00:17 2017 (r311977) +++ head/sys/dev/e1000/if_em.c Thu Jan 12 14:18:52 2017 (r311978) @@ -770,6 +770,8 @@ em_if_attach_pre(if_ctx_t ctx) if (adapter->hw.mac.type >= igb_mac_min) { + int try_second_bar; + scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] * sizeof(union e1000_adv_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_adv_rx_desc), EM_DBA_ALIGN); scctx->isc_txrx = &igb_txrx; @@ -779,6 +781,15 @@ em_if_attach_pre(if_ctx_t ctx) if (adapter->hw.mac.type != e1000_82575) scctx->isc_tx_csum_flags |= CSUM_SCTP | CSUM_IP6_SCTP; + /* + ** Some new devices, as with ixgbe, now may + ** use a different BAR, so we need to keep + ** track of which is used. + */ + try_second_bar = pci_read_config(dev, scctx->isc_msix_bar, 4); + if (try_second_bar == 0) + scctx->isc_msix_bar += 4; + } else if (adapter->hw.mac.type >= em_mac_min) { scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0]* sizeof(struct e1000_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_rx_desc_extended), EM_DBA_ALIGN);