diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2014-07-18 07:11:05 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2014-07-18 07:11:05 +0000 |
commit | 48e19b4ede8c18739b75ff3d89815d2a1e416d50 (patch) | |
tree | d3ee64bd7d30c146fe2b9cb11e9420a17af7609a /sys | |
parent | 20912370bbeb299194c5ffa99d789be88872a3eb (diff) |
implement EFBIG handling for heavily fragmented packets on the tx path.
ok claudio@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_bnx.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c index 0ed224d8de8..ce035556ef4 100644 --- a/sys/dev/pci/if_bnx.c +++ b/sys/dev/pci/if_bnx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bnx.c,v 1.106 2014/07/12 18:48:51 tedu Exp $ */ +/* $OpenBSD: if_bnx.c,v 1.107 2014/07/18 07:11:04 dlg Exp $ */ /*- * Copyright (c) 2006 Broadcom Corporation @@ -4882,9 +4882,18 @@ bnx_tx_encap(struct bnx_softc *sc, struct mbuf *m) /* Map the mbuf into our DMA address space. */ error = bus_dmamap_load_mbuf(sc->bnx_dmatag, map, m, BUS_DMA_NOWAIT); - if (error != 0) { - printf("%s: Error mapping mbuf into TX chain!\n", - sc->bnx_dev.dv_xname); + switch (error) { + case 0: + break; + + case EFBIG: + if ((error = m_defrag(m, M_DONTWAIT)) == 0 && + (error = bus_dmamap_load_mbuf(sc->bnx_dmatag, map, m, + BUS_DMA_NOWAIT)) == 0) + break; + + /* FALLTHROUGH */ + default: sc->tx_dma_map_failures++; goto maperr; } |