Date: Thu, 12 Jan 2017 14:18:52 +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: r311978 - head/sys/dev/e1000 Message-ID: <201701121418.v0CEIq2N095432@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701121418.v0CEIq2N095432>