Re: [patch] de(4) has not worked on 8-current since Feb 13

From: John Baldwin <jhb_at_freebsd.org>
Date: Wed, 10 Dec 2008 15:39:25 -0500
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)
_at__at_ -4491,7 +4491,8 _at__at_
 /* 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;
_at__at_ -4527,7 +4528,7 _at__at_
     }
 
     /* 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) {
_at__at_ -4586,8 +4587,8 _at__at_
     /*
      * 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);
 
_at__at_ -4598,7 +4599,7 _at__at_
      * 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
Received on Wed Dec 10 2008 - 19:45:31 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:38 UTC