summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2014-06-11 04:28:44 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2014-06-11 04:28:44 +0000
commit4e23a601c5f649c0e1441318f6cc15eb27d2a914 (patch)
treed537195a98ebee765f203dd8c5485c6b6bfe4ef0
parentc1d92a61b0a34f143c67dfd663f697d77cde6c33 (diff)
em(4) receives jumbos by chaining its MCLBYTES sized descriptors
together, so to receive a full 9000 byte frame, it needs 5 descriptors. its current mclgeti low watermark is 4. it appears that the chip will block if it has rxed a packet into its internal buffers waiting for descriptors. if you're at the lwm, that means you're DoSed. this raises the lwm so we can get at least two jumbos, ie, 10 descriptors. ok deraadt@
-rw-r--r--sys/dev/pci/if_em.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 5b2b4f256d5..d60a2386aaf 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.279 2014/03/10 04:09:53 jsg Exp $ */
+/* $OpenBSD: if_em.c,v 1.280 2014/06/11 04:28:43 dlg Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -1859,7 +1859,8 @@ em_setup_interface(struct em_softc *sc)
IFQ_SET_MAXLEN(&ifp->if_snd, sc->num_tx_desc - 1);
IFQ_SET_READY(&ifp->if_snd);
- m_clsetwms(ifp, MCLBYTES, 4, sc->num_rx_desc);
+ m_clsetwms(ifp, MCLBYTES, 2 * ((ifp->if_hardmtu / MCLBYTES) + 1),
+ sc->num_rx_desc);
ifp->if_capabilities = IFCAP_VLAN_MTU;