diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2008-07-18 13:38:41 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2008-07-18 13:38:41 +0000 |
commit | 0877d8ae029e73aa871ca80221ab5d4d5e4ae40a (patch) | |
tree | e48e650401599afe985e5ff294ecd1ae4f2d1f80 /sys/dev/pci/if_vrreg.h | |
parent | 6acacc3943a6dc8908ac6b973f4378ee0acf3332 (diff) |
o Use mbufs, for the RX ring, instead of malloc()'ing an MCLBYTES sized buffer.
o On non-strict alignment archs, dont copy the mbuf, every time, unload it, and send
it up the stack and just get a new one for the rx ring. We still do the copy on
strict alignment archs though...
o create a function to handle mbuf allocation for the rx ring, vr_mbuf_alloc(),
use it to allocate the mbufs and shuffle the bus dma setup around.
ideas/code from vic(4) and sis(4);
ok reyk@, brad@, dlg@
tested by many, been in snapshots for a while.
Diffstat (limited to 'sys/dev/pci/if_vrreg.h')
-rw-r--r-- | sys/dev/pci/if_vrreg.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/pci/if_vrreg.h b/sys/dev/pci/if_vrreg.h index a9fb9ad47e0..588b53a5d6b 100644 --- a/sys/dev/pci/if_vrreg.h +++ b/sys/dev/pci/if_vrreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vrreg.h,v 1.20 2007/10/04 01:29:39 brad Exp $ */ +/* $OpenBSD: if_vrreg.h,v 1.21 2008/07/18 13:38:40 thib Exp $ */ /* * Copyright (c) 1997, 1998 @@ -409,7 +409,7 @@ struct vr_chain { struct vr_chain_onefrag { struct vr_desc *vr_ptr; struct vr_chain_onefrag *vr_nextdesc; - u_int8_t *vr_buf; + struct mbuf *vr_mbuf; bus_addr_t vr_paddr; bus_dmamap_t vr_map; }; @@ -468,6 +468,7 @@ struct vr_softc { bus_dmamap_t sc_listmap; /* descriptor list map */ bus_dma_segment_t sc_listseg; int sc_if_flags; + int sc_rxbufs; }; #define VR_F_RESTART 0x01 /* Restart unit on next tick */ |