Module Name: src Committed By: msaitoh Date: Thu Aug 19 04:47:12 UTC 2021
Modified Files: src/sys/dev/pci/ixgbe: ix_txrx.c Log Message: Don't call bus_dmamap_sync with rx_mbuf_sz(== MCLBYTES) to prevent panic. If an mbuf is ETHER_ALIGNed, the packet size may be shorter than MCLBYTES. For example, if the max frame size is 2048 by changing the interface's MTU, an mbuf's max length is 2046. So, don't use rx_mbuf_sz for bus_dmamap_sync. To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/sys/dev/pci/ixgbe/ix_txrx.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/ixgbe/ix_txrx.c diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.82 src/sys/dev/pci/ixgbe/ix_txrx.c:1.83 --- src/sys/dev/pci/ixgbe/ix_txrx.c:1.82 Wed Aug 18 09:17:17 2021 +++ src/sys/dev/pci/ixgbe/ix_txrx.c Thu Aug 19 04:47:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ix_txrx.c,v 1.82 2021/08/18 09:17:17 msaitoh Exp $ */ +/* $NetBSD: ix_txrx.c,v 1.83 2021/08/19 04:47:12 msaitoh Exp $ */ /****************************************************************************** @@ -64,7 +64,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.82 2021/08/18 09:17:17 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.83 2021/08/19 04:47:12 msaitoh Exp $"); #include "opt_inet.h" #include "opt_inet6.h" @@ -1567,7 +1567,7 @@ ixgbe_setup_receive_ring(struct rx_ring goto fail; } bus_dmamap_sync(rxr->ptag->dt_dmat, rxbuf->pmap, - 0, adapter->rx_mbuf_sz, BUS_DMASYNC_PREREAD); + 0, mp->m_pkthdr.len, BUS_DMASYNC_PREREAD); /* Update the descriptor and the cached value */ rxr->rx_base[j].read.pkt_addr = htole64(rxbuf->pmap->dm_segs[0].ds_addr);