-/* $OpenBSD: re.c,v 1.163 2014/11/24 10:33:37 brad Exp $ */
+/* $OpenBSD: re.c,v 1.164 2014/12/19 04:53:58 brad Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
txq = &sc->rl_ldata.rl_txq[*idx];
map = txq->txq_dmamap;
+
error = bus_dmamap_load_mbuf(sc->sc_dmat, map, m,
BUS_DMA_WRITE|BUS_DMA_NOWAIT);
- if (error) {
- /* XXX try to defrag if EFBIG? */
- printf("%s: can't map mbuf (error %d)\n",
- sc->sc_dev.dv_xname, error);
+ switch (error) {
+ case 0:
+ break;
+
+ case EFBIG:
+ if ((error = m_defrag(m, M_DONTWAIT)) == 0 &&
+ (error = bus_dmamap_load_mbuf(sc->sc_dmat, map, m,
+ BUS_DMA_WRITE|BUS_DMA_NOWAIT)) == 0)
+ break;
+
+ /* FALLTHROUGH */
+ default:
return (error);
}