From b07d32b002419610734d6537a06bf8f3e8550208 Mon Sep 17 00:00:00 2001 From: jan Date: Thu, 8 Aug 2024 14:58:49 +0000 Subject: [PATCH] igc(4): Use same size for DMA mapping and allocation for rx bufs Also remove the ETHER_ALIGN which leads to corruped mbufs. ok bluhm@ --- sys/dev/pci/if_igc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/if_igc.c b/sys/dev/pci/if_igc.c index 450f6a5f912..3d3df852585 100644 --- a/sys/dev/pci/if_igc.c +++ b/sys/dev/pci/if_igc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_igc.c,v 1.25 2024/05/24 06:02:53 jsg Exp $ */ +/* $OpenBSD: if_igc.c,v 1.26 2024/08/08 14:58:49 jan Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause * @@ -881,7 +881,7 @@ igc_init(void *arg) } igc_initialize_transmit_unit(sc); - sc->rx_mbuf_sz = MCLBYTES + ETHER_ALIGN; + sc->rx_mbuf_sz = MCLBYTES; /* Prepare receive descriptors and buffers. */ if (igc_setup_receive_structures(sc)) { printf("%s: Could not setup receive structures\n", @@ -2159,7 +2159,7 @@ igc_allocate_receive_buffers(struct igc_rxring *rxr) rxbuf = rxr->rx_buffers; for (i = 0; i < sc->num_rx_desc; i++, rxbuf++) { error = bus_dmamap_create(rxr->rxdma.dma_tag, - MAX_JUMBO_FRAME_SIZE, 1, MAX_JUMBO_FRAME_SIZE, 0, + MAX_JUMBO_FRAME_SIZE, IGC_MAX_SCATTER, MCLBYTES, 0, BUS_DMA_NOWAIT, &rxbuf->map); if (error) { printf("%s: Unable to create RX DMA map\n", -- 2.20.1