From 7a371a9d766d61717aeae4c3be89d84c0ee673ac Mon Sep 17 00:00:00 2001 From: bluhm Date: Wed, 28 Aug 2024 18:21:15 +0000 Subject: [PATCH] If bounce buffers do not fit, defragment mbuf. Some packets were dropped by vio_encap() when using bounce buffers. These mbufs are too fragmented for the pre allocated bounce buffer pages. By returing EFBIG the network driver will call m_defrag() and try again. This fixes the problem. OK sf@ hshoexer@ --- sys/arch/amd64/amd64/bus_dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arch/amd64/amd64/bus_dma.c b/sys/arch/amd64/amd64/bus_dma.c index 070c3429b05..56c750ec88e 100644 --- a/sys/arch/amd64/amd64/bus_dma.c +++ b/sys/arch/amd64/amd64/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.57 2024/08/22 11:36:24 bluhm Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.58 2024/08/28 18:21:15 bluhm Exp $ */ /* $NetBSD: bus_dma.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */ /*- @@ -726,7 +726,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t, bus_dmamap_t map, void *buf, if (use_bounce_buffer) { if (page >= map->_dm_npages) - return (ENOMEM); + return (EFBIG); off = vaddr & PAGE_MASK; pg = map->_dm_pages[page]; -- 2.20.1