summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2011-08-08 01:30:26 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2011-08-08 01:30:26 +0000
commit4e196c5605384684fba9645e77691aebceee1f56 (patch)
tree9614b2dca3d3b322686f2460ca7b7d047d148f3b
parent529a8d9b926cbb89a03affe7ffa00d67eaff6747 (diff)
myx requires the driver pad short ethernet frames to 60 bytes by
adding a descriptor pointing at zeroed bytes onto the end of transmit chains. i was accounting for this extra descriptor when i was completing the chain, but not when i was setting this up. this meant the number of free descriptors kept growing until it overflowed. at this point the check for space in the ring failed and packets no longer flowed. this counts the pad descriptor in the tx chain setup too. ok deraadt@
-rw-r--r--sys/dev/pci/if_myx.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c
index 8a1186d4221..f15fe82af59 100644
--- a/sys/dev/pci/if_myx.c
+++ b/sys/dev/pci/if_myx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_myx.c,v 1.28 2011/06/23 04:09:08 dlg Exp $ */
+/* $OpenBSD: if_myx.c,v 1.29 2011/08/08 01:30:25 dlg Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org>
@@ -1426,8 +1426,6 @@ myx_start(struct ifnet *ifp)
bus_dmamap_sync(sc->sc_dmat, map, 0,
map->dm_mapsize, BUS_DMASYNC_POSTWRITE);
- sc->sc_tx_free -= map->dm_nsegs;
-
myx_buf_put(&sc->sc_tx_buf_list, mb);
flags = MYXTXD_FLAGS_NO_TSO;
@@ -1470,6 +1468,7 @@ myx_start(struct ifnet *ifp)
myx_write(sc, offset + idx * sizeof(txd),
&txd, sizeof(txd));
+ sc->sc_tx_free -= i;
idx += i;
idx %= sc->sc_tx_ring_count;
}