summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2010-03-22 17:09:28 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2010-03-22 17:09:28 +0000
commitef0de377f6363da69b32f1bcffe3b7a06c12b4bd (patch)
treead5774d1c2559407de994f58ce334bece5d04f8a /sys/dev
parent7c1cfcb5053598a05715c2e280388306bf1ca859 (diff)
Use the correct number of max scatter gather segments for 82599,
adapted from FreeBSD.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_ix.c10
-rw-r--r--sys/dev/pci/if_ix.h5
2 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c
index 0662906bb79..388ab41cf87 100644
--- a/sys/dev/pci/if_ix.c
+++ b/sys/dev/pci/if_ix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ix.c,v 1.39 2010/03/19 13:08:56 jsg Exp $ */
+/* $OpenBSD: if_ix.c,v 1.40 2010/03/22 17:09:27 jsg Exp $ */
/******************************************************************************
@@ -1713,11 +1713,17 @@ ixgbe_allocate_transmit_buffers(struct tx_ring *txr)
struct ifnet *ifp;
struct ixgbe_tx_buf *txbuf;
int error, i;
+ int max_segs;
sc = txr->sc;
os = &sc->osdep;
ifp = &sc->arpcom.ac_if;
+ if (sc->hw.mac.type == ixgbe_mac_82598EB)
+ max_segs = IXGBE_82598_SCATTER;
+ else
+ max_segs = IXGBE_82599_SCATTER;
+
if (!(txr->tx_buffers =
(struct ixgbe_tx_buf *) malloc(sizeof(struct ixgbe_tx_buf) *
sc->num_tx_desc, M_DEVBUF, M_NOWAIT | M_ZERO))) {
@@ -1732,7 +1738,7 @@ ixgbe_allocate_transmit_buffers(struct tx_ring *txr)
for (i = 0; i < sc->num_tx_desc; i++) {
txbuf = &txr->tx_buffers[i];
error = bus_dmamap_create(txr->txdma.dma_tag, IXGBE_TSO_SIZE,
- IXGBE_MAX_SCATTER, PAGE_SIZE, 0,
+ max_segs, PAGE_SIZE, 0,
BUS_DMA_NOWAIT, &txbuf->map);
if (error != 0) {
diff --git a/sys/dev/pci/if_ix.h b/sys/dev/pci/if_ix.h
index 09b98dbd38a..816c2258155 100644
--- a/sys/dev/pci/if_ix.h
+++ b/sys/dev/pci/if_ix.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ix.h,v 1.9 2010/02/23 18:43:15 jsg Exp $ */
+/* $OpenBSD: if_ix.h,v 1.10 2010/03/22 17:09:27 jsg Exp $ */
/******************************************************************************
@@ -116,7 +116,8 @@
#define HW_DEBUGOUT2(S, A, B) if (DEBUG_HW) printf(S "\n", A, B)
#define MAX_NUM_MULTICAST_ADDRESSES 128
-#define IXGBE_MAX_SCATTER 100
+#define IXGBE_82598_SCATTER 100
+#define IXGBE_82599_SCATTER 32
#define IXGBE_MSIX_BAR 3
#if 0
#define IXGBE_TSO_SIZE 65535