svn commit: r311978 - head/sys/dev/e1000
Sean Bruno
sbruno at FreeBSD.org
Thu Jan 12 14:18:53 UTC 2017
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 at 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);
More information about the svn-src-all
mailing list