Date: Wed, 10 Dec 2008 15:39:25 -0500 From: John Baldwin <jhb@freebsd.org> To: freebsd-current@freebsd.org Cc: WATANABE Kazuhiro <CQG00620@nifty.ne.jp> Subject: Re: [patch] de(4) has not worked on 8-current since Feb 13 Message-ID: <200812101539.26031.jhb@freebsd.org> In-Reply-To: <20081210125627.25732615CD@mail.asahi-net.or.jp> References: <20081210125627.25732615CD@mail.asahi-net.or.jp>
index | next in thread | previous in thread | raw e-mail
On Wednesday 10 December 2008 07:56:25 am WATANABE Kazuhiro wrote:
> Hi, all.
>
> My de(4) NICs has not worked on 8-current since Feb 13.
Try this patch to de(4) instead. It removes the alignment requirement for TX
buffers since the 4-byte alignment is only required for RX.
Index: if_de.c
===================================================================
--- if_de.c (revision 185867)
+++ if_de.c (working copy)
@@ -4491,7 +4491,8 @@
/* Allocate memory for a single descriptor ring. */
static int
tulip_busdma_allocring(device_t dev, tulip_softc_t * const sc, size_t count,
- bus_size_t maxsize, int nsegs, tulip_ringinfo_t *ri, const char *name)
+ bus_size_t alignment, bus_size_t maxsize, int nsegs, tulip_ringinfo_t *ri,
+ const char *name)
{
size_t size;
int error, i;
@@ -4527,7 +4528,7 @@
}
/* Allocate a tag for the data buffers. */
- error = bus_dma_tag_create(NULL, 4, 0,
+ error = bus_dma_tag_create(NULL, alignment, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
maxsize, nsegs, TULIP_DATA_PER_DESC, 0, NULL, NULL, &ri->ri_data_tag);
if (error) {
@@ -4586,8 +4587,8 @@
/*
* Allocate space and dmamap for transmit ring.
*/
- error = tulip_busdma_allocring(dev, sc, TULIP_TXDESCS, TULIP_DATA_PER_DESC,
- TULIP_MAX_TXSEG, &sc->tulip_txinfo, "transmit");
+ error = tulip_busdma_allocring(dev, sc, 1, TULIP_TXDESCS,
+ TULIP_DATA_PER_DESC, TULIP_MAX_TXSEG, &sc->tulip_txinfo, "transmit");
if (error)
return (error);
@@ -4598,7 +4599,7 @@
* a waste in practice though as an ethernet frame can easily fit
* in TULIP_RX_BUFLEN bytes.
*/
- error = tulip_busdma_allocring(dev, sc, TULIP_RXDESCS, MCLBYTES, 1,
+ error = tulip_busdma_allocring(dev, sc, 4, TULIP_RXDESCS, MCLBYTES, 1,
&sc->tulip_rxinfo, "receive");
if (error)
return (error);
--
John Baldwin
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812101539.26031.jhb>
