diff options
author | Can Erkin Acar <canacar@cvs.openbsd.org> | 2005-09-14 05:08:06 +0000 |
---|---|---|
committer | Can Erkin Acar <canacar@cvs.openbsd.org> | 2005-09-14 05:08:06 +0000 |
commit | 348cd0234c33da28f9ec82ef5bb54857e04f9aee (patch) | |
tree | e675fd1247a6b110e294dedd44ff3b7e35443e07 /sys | |
parent | f7ed8afaa32cf14a3921e1a6629a45030d317578 (diff) |
decrease RX copy treshold to MHLEN to prevent
unnecessary copying if already allocating a cluster.
fix a comment and remove a bogus check while there.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_san_common.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_san_xilinx.c | 10 |
2 files changed, 5 insertions, 11 deletions
diff --git a/sys/dev/pci/if_san_common.c b/sys/dev/pci/if_san_common.c index dbbff25a4a4..bbdf75d0c3c 100644 --- a/sys/dev/pci/if_san_common.c +++ b/sys/dev/pci/if_san_common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_san_common.c,v 1.9 2005/09/01 23:35:42 canacar Exp $ */ +/* $OpenBSD: if_san_common.c,v 1.10 2005/09/14 05:08:05 canacar Exp $ */ /*- * Copyright (c) 2001-2004 Sangoma Technologies (SAN) @@ -394,7 +394,7 @@ wan_mbuf_alloc(int len) MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == NULL || len < MHLEN) + if (m == NULL || len <= MHLEN) return (m); m->m_pkthdr.len = 0; @@ -446,7 +446,7 @@ wan_mbuf_to_buffer(struct mbuf **m_org) len -= 16; buffer += 16; - /* make sure the buffer is aligned to an 8-byte boundary */ + /* make sure the buffer is aligned to a 4-byte boundary */ if (mtod(m, u_int32_t) & 0x03) { unsigned int inc = 4 - (mtod(m, u_int32_t) & 0x03); buffer += inc; diff --git a/sys/dev/pci/if_san_xilinx.c b/sys/dev/pci/if_san_xilinx.c index e79936cc480..f0ee028ef88 100644 --- a/sys/dev/pci/if_san_xilinx.c +++ b/sys/dev/pci/if_san_xilinx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_san_xilinx.c,v 1.12 2005/09/04 18:27:28 brad Exp $ */ +/* $OpenBSD: if_san_xilinx.c,v 1.13 2005/09/14 05:08:05 canacar Exp $ */ /*- * Copyright (c) 2001-2004 Sangoma Technologies (SAN) @@ -94,7 +94,7 @@ enum { # define HARD_FIFO_CODE 0x01 #endif -static int aft_rx_copyback = 1000; +static int aft_rx_copyback = MHLEN; /* @@ -1696,12 +1696,6 @@ static int xilinx_dma_rx(sdla_t *card, xilinx_softc_t *sc) bus_addr = kvtop(mtod(sc->rx_dma_mbuf, caddr_t) + sc->rx_dma_mbuf->m_len); - if (!bus_addr) { - log(LOG_INFO, "%s: %s Critical error pci_map_single() " - "failed!\n", sc->if_name, __FUNCTION__); - return EINVAL; - } - rx_el->dma_addr = bus_addr; /* Write the pointer of the data packet to the |