From dc62a2d58330396000ab5f09b91f9a8cd472d01e Mon Sep 17 00:00:00 2001 From: jan Date: Fri, 20 Oct 2023 13:21:15 +0000 Subject: [PATCH] Add missing tcps_outpkttso counter to ixl(4) TSO setup. ok bluhm@ --- sys/dev/pci/if_ixl.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/dev/pci/if_ixl.c b/sys/dev/pci/if_ixl.c index f928cec2413..0f8b6d8b74e 100644 --- a/sys/dev/pci/if_ixl.c +++ b/sys/dev/pci/if_ixl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ixl.c,v 1.91 2023/10/20 07:31:12 jan Exp $ */ +/* $OpenBSD: if_ixl.c,v 1.92 2023/10/20 13:21:15 jan Exp $ */ /* * Copyright (c) 2013-2015, Intel Corporation @@ -2853,21 +2853,26 @@ ixl_tx_setup_offload(struct mbuf *m0, struct ixl_tx_ring *txr, if (ISSET(m0->m_pkthdr.csum_flags, M_TCP_TSO)) { if (ext.tcp) { struct ixl_tx_desc *ring, *txd; - uint64_t cmd = 0; + uint64_t cmd = 0, paylen, outlen; hlen += ext.tcp->th_off << 2; + + outlen = m0->m_pkthdr.ph_mss; + paylen = m0->m_pkthdr.len - ETHER_HDR_LEN - hlen; + ring = IXL_DMA_KVA(&txr->txr_mem); txd = &ring[prod]; cmd |= IXL_TX_DESC_DTYPE_CONTEXT; cmd |= IXL_TX_CTX_DESC_CMD_TSO; - cmd |= (uint64_t)(m0->m_pkthdr.len - ETHER_HDR_LEN - - hlen) << IXL_TX_CTX_DESC_TLEN_SHIFT; - cmd |= (uint64_t)(m0->m_pkthdr.ph_mss) - << IXL_TX_CTX_DESC_MSS_SHIFT; + cmd |= paylen << IXL_TX_CTX_DESC_TLEN_SHIFT; + cmd |= outlen << IXL_TX_CTX_DESC_MSS_SHIFT; htolem64(&txd->addr, 0); htolem64(&txd->cmd, cmd); + + tcpstat_add(tcps_outpkttso, + (paylen + outlen - 1) / outlen); } else tcpstat_inc(tcps_outbadtso); } -- 2.20.1