diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2013-03-17 20:47:24 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2013-03-17 20:47:24 +0000 |
commit | 1dc74b3aac09e36454820491ba30bc3e34b49bb6 (patch) | |
tree | 5b240a959fab9fef6bab28942323736abe588d4b /sys/dev/ic | |
parent | 76d9e2eb7899db30dda140e7120e1a807a653409 (diff) |
- Remove the reserved number of TX descriptors. No limitation is mentioned in
the 8139C+/8169/8110/8168/8101/8111 datasheets and it seems to work ok
without reserving the descriptors.
- Change allowable number of TX DMA segments to 32.
From FreeBSD
ok chris@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/re.c | 13 | ||||
-rw-r--r-- | sys/dev/ic/rtl81x9reg.h | 4 |
2 files changed, 6 insertions, 11 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c index 0f14dda7510..e55712637be 100644 --- a/sys/dev/ic/re.c +++ b/sys/dev/ic/re.c @@ -1,4 +1,4 @@ -/* $OpenBSD: re.c,v 1.141 2013/03/11 23:42:19 brad Exp $ */ +/* $OpenBSD: re.c,v 1.142 2013/03/17 20:47:23 brad Exp $ */ /* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */ /* * Copyright (c) 1997, 1998-2003 @@ -1067,8 +1067,7 @@ re_attach(struct rl_softc *sc, const char *intrstr) /* Create DMA maps for TX buffers */ for (i = 0; i < RL_TX_QLEN; i++) { error = bus_dmamap_create(sc->sc_dmat, - RL_JUMBO_FRAMELEN, - RL_TX_DESC_CNT(sc) - RL_NTXDESC_RSVD, RL_TDESC_CMD_FRAGLEN, + RL_JUMBO_FRAMELEN, RL_NTXSEGS, RL_JUMBO_FRAMELEN, 0, 0, &sc->rl_ldata.rl_txq[i].txq_dmamap); if (error) { printf("%s: can't create DMA map for TX\n", @@ -1592,8 +1591,7 @@ re_txeof(struct rl_softc *sc) sc->rl_ldata.rl_txq_considx = idx; - if (sc->rl_ldata.rl_tx_free > RL_NTXDESC_RSVD) - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_flags &= ~IFF_OACTIVE; /* * Some chips will ignore a second TX request issued while an @@ -1731,9 +1729,6 @@ re_encap(struct rl_softc *sc, struct mbuf *m, int *idx) u_int32_t cmdstat, vlanctl = 0, csum_flags = 0; struct rl_txq *txq; - if (sc->rl_ldata.rl_tx_free <= RL_NTXDESC_RSVD) - return (EFBIG); - /* * Set up checksum offload. Note: checksum offload bits must * appear in all descriptors of a multi-descriptor transmit @@ -1784,7 +1779,7 @@ re_encap(struct rl_softc *sc, struct mbuf *m, int *idx) nsegs++; } - if (nsegs > sc->rl_ldata.rl_tx_free - RL_NTXDESC_RSVD) { + if (sc->rl_ldata.rl_tx_free - nsegs <= 1) { error = EFBIG; goto fail_unload; } diff --git a/sys/dev/ic/rtl81x9reg.h b/sys/dev/ic/rtl81x9reg.h index 8f2f44b9279..cf7b658d904 100644 --- a/sys/dev/ic/rtl81x9reg.h +++ b/sys/dev/ic/rtl81x9reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rtl81x9reg.h,v 1.75 2012/04/08 08:34:55 jsg Exp $ */ +/* $OpenBSD: rtl81x9reg.h,v 1.76 2013/03/17 20:47:23 brad Exp $ */ /* * Copyright (c) 1997, 1998 @@ -685,7 +685,7 @@ struct rl_stats { #define RL_TX_QLEN 64 -#define RL_NTXDESC_RSVD 4 +#define RL_NTXSEGS 32 #define RL_RX_LIST_SZ (RL_RX_DESC_CNT * sizeof(struct rl_desc)) #define RL_RING_ALIGN 256 |