Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe Don't call bus_dmamap_sync with rx_mbuf_sz...



details:   https://anonhg.NetBSD.org/src/rev/ef6b40cad885
branches:  trunk
changeset: 1022998:ef6b40cad885
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Aug 19 04:47:12 2021 +0000

description:
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.

diffstat:

 sys/dev/pci/ixgbe/ix_txrx.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r aad0243f8ab1 -r ef6b40cad885 sys/dev/pci/ixgbe/ix_txrx.c
--- a/sys/dev/pci/ixgbe/ix_txrx.c       Thu Aug 19 04:34:57 2021 +0000
+++ b/sys/dev/pci/ixgbe/ix_txrx.c       Thu Aug 19 04:47:12 2021 +0000
@@ -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 @@
                         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);



Home | Main Index | Thread Index | Old Index