From 40336254e8d345d7c915f9161674e61646a68517 Mon Sep 17 00:00:00 2001 From: jan Date: Mon, 10 Jul 2023 19:36:54 +0000 Subject: [PATCH] ix(4): allocate less memory for tx buffers TSO packets are limited to MAXMCLBYTES (64k). Thus, we don't need to allocate IXGBE_TSO_SIZE (256k) per packet for the transmit buffers. tested by bluhm ok bluhm@ --- sys/dev/pci/if_ix.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c index 195b5d63895..92b384bb7e0 100644 --- a/sys/dev/pci/if_ix.c +++ b/sys/dev/pci/if_ix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ix.c,v 1.198 2023/07/08 09:01:30 jmatthew Exp $ */ +/* $OpenBSD: if_ix.c,v 1.199 2023/07/10 19:36:54 jan Exp $ */ /****************************************************************************** @@ -37,6 +37,12 @@ #include #include +/* + * Our TCP/IP Stack could not handle packets greater than MAXMCLBYTES. + * This interface could not handle packets greater than IXGBE_TSO_SIZE. + */ +CTASSERT(MAXMCLBYTES <= IXGBE_TSO_SIZE); + /********************************************************************* * Driver version *********************************************************************/ @@ -2263,7 +2269,7 @@ ixgbe_allocate_transmit_buffers(struct tx_ring *txr) /* Create the descriptor buffer dma maps */ for (i = 0; i < sc->num_tx_desc; i++) { txbuf = &txr->tx_buffers[i]; - error = bus_dmamap_create(txr->txdma.dma_tag, IXGBE_TSO_SIZE, + error = bus_dmamap_create(txr->txdma.dma_tag, MAXMCLBYTES, sc->num_segs, PAGE_SIZE, 0, BUS_DMA_NOWAIT, &txbuf->map); -- 2.20.1