From 4e196c5605384684fba9645e77691aebceee1f56 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Mon, 8 Aug 2011 01:30:26 +0000 Subject: 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@ --- sys/dev/pci/if_myx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sys/dev') 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 @@ -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; } -- cgit v1.2.3