alignment fault in vx driver on 5.4

Joe Smit noemail4535 at yahoo.com
Thu Dec 29 00:37:21 PST 2005


Hello, I've put together an alpha PC164 500mhz system
with a 3Com 3C590
etherlink 3, running Freebsd 5.4.  I use the vx driver
for the 3c590, but this
results in a unaligned panic on the first ifconfig. 
The driver is attempting to
write from an unaligned character array, 32 bits at a
time.  So here's a simple
patch that only writes 1 byte at a time.

  This driver doesn't seem to do dma and is very
inefficient as a
result - about 30% cpu overhead for 10 mbits/s.  I
don't think the
original code using write_multi_4 was any faster.  I
guess I'll 
have to get a newer nic. 


--- if_vx.c.original	Thu Dec  1 01:21:31 2005
+++ if_vx.c	Sat Dec 24 13:33:50 2005
@@ -454,13 +454,8 @@
     CSR_WRITE_4(sc,  VX_W1_TX_PIO_WR_1, len |
TX_INDICATE);
 
     while (m) {
-        if (m->m_len > 3)
-	    bus_space_write_multi_4(sc->bst, sc->bsh,
-		VX_W1_TX_PIO_WR_1, (u_int32_t *)mtod(m, caddr_t),
m->m_len / 4);
-        if (m->m_len & 3)
-	    bus_space_write_multi_1(sc->bst, sc->bsh,
-		VX_W1_TX_PIO_WR_1,
-		mtod(m, caddr_t) + (m->m_len & ~3) , m->m_len & 3);
+	bus_space_write_multi_1(sc->bst, sc->bsh,
VX_W1_TX_PIO_WR_1,
+		mtod(m, caddr_t), m->m_len);
 	m = m_free(m);
     }
     while (pad--)



		
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 



More information about the freebsd-alpha mailing list