From nobody Fri Jul 21 03:44:40 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6b603LKfz4dVkS; Fri, 21 Jul 2023 03:44:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6b602pGxz3Jjf; Fri, 21 Jul 2023 03:44:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689911080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51EnNNOkUi4h0MTVVygw4S4m0muT8RKFgQ7+f3LfjVM=; b=PhmHAmayIo9AR2DKWeU+rQ3HsnlLtfQ7LKHO1RKFm6F/Qt8CTHpegHt9Nirw0fFtPjXUT8 buUbfPPupQRizoGyrK59OY9mJYXSoStzL8UCS8gchgVtO9toMEh7PNp7EY0o/Kf9DsEokl dN4Q5BElLxrRImdBzYfIthHeUWMIdhi69+zutwV7guXRa5RmxKOxLdOT2rtWJzvBojimC2 bBWcpeOgsGQOfQLxNk+nf7F3WEZh4d7rEfbVlCFxYX96MkNZ+fbEGybX/BN78lR20HgqxQ S2KyE7YmBtvkAydOIuEcIu0MgpMjcAJfZDqWpZ3lGN6/xv/2xWY5omH4BKaFnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689911080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51EnNNOkUi4h0MTVVygw4S4m0muT8RKFgQ7+f3LfjVM=; b=J2zBBD3vlA9H+YBE8/xlSQnsCpsyHf+w3U1E7I2BQyJmaAIhyMDzz0Js9Ncxc7uqdGxwVM yNUZPa7IofWIo2Uz894rgvNLeoxB7OWEXEp4+RkyrIzCY74QKky6xDR8aFxicM1JZja1zg 38XlnvqQQuVkNVtxd8hOWs+bCB7J1CNBXll0n/dF/FsC4++HCsrPgoNUYc6pEEYy9fxo1i 3nU8w2ZypBq7FP3iAexUk52UkobJ/gW4RBop7tnjQvIiHir07QNhuUkCS+OAPMxHPZjKQZ j4p8/qkY64SzgCR/02WzAt9I+iAIBo9XH2vTh02JXik/tdYJ2cAEjfXDs8DdLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689911080; a=rsa-sha256; cv=none; b=Kc1b5/mCGYHFKoSvd9uZBeZrC6C8SO0c4s9LxYT/YqUzcaA/mMkA2z6gXCGuD6egA+Y9E2 Og6KV0bbrO5Kw05iTBqdtf5+mHTzIhIcGtBJRxPWST4CP8ArYNs2y/A9Ui/QTmPE8NX8IG bZ0gstFO0vAmo1fVaVH34Mvt8ljHyIhHt781wvQHuZBym+hz1j49dc2SBsxDw3Lfl2tcqA lDWiMXJw8sUO9uKwofRF1TMGlg73mYGEhmnlMxFFfPyt+f/beYziVxV22sdsrFhgCxamOH srgFhS0hvifnFjqyeSYCYEL+sJbComff4CQywzIYoDy1OlhPe/dQ3rUT1ufAJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6b601tkxzxVm; Fri, 21 Jul 2023 03:44:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L3ieXm031611; Fri, 21 Jul 2023 03:44:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L3ieEP031610; Fri, 21 Jul 2023 03:44:40 GMT (envelope-from git) Date: Fri, 21 Jul 2023 03:44:40 GMT Message-Id: <202307210344.36L3ieEP031610@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 201c4b7c29da - main - e1000: Some fixes for em(4) TSO setup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 201c4b7c29da44500ccb9e47b854dc1207df8b0a Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=201c4b7c29da44500ccb9e47b854dc1207df8b0a commit 201c4b7c29da44500ccb9e47b854dc1207df8b0a Author: Kevin Bowling AuthorDate: 2023-07-21 01:51:02 +0000 Commit: Kevin Bowling CommitDate: 2023-07-21 01:52:53 +0000 e1000: Some fixes for em(4) TSO setup Always set TXD_CMD_IP for 82544 Otherwise set TXD_CMD_IP for IPv4, not IPv6 Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30072 --- sys/dev/e1000/em_txrx.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index 255aea6347d2..47f9b187aa14 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -141,8 +141,10 @@ em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, uint32_t *txd_upper, if_softc_ctx_t scctx = sc->shared; struct em_tx_queue *que = &sc->tx_queues[pi->ipi_qsidx]; struct tx_ring *txr = &que->txr; + struct e1000_hw *hw = &sc->hw; struct e1000_context_desc *TXD; int cur, hdr_len; + uint32_t cmd_type_len; hdr_len = pi->ipi_ehdrlen + pi->ipi_ip_hlen + pi->ipi_tcp_hlen; *txd_lower = (E1000_TXD_CMD_DEXT | /* Extended descr type */ @@ -183,12 +185,23 @@ em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, uint32_t *txd_upper, TXD->tcp_seg_setup.fields.mss = htole16(pi->ipi_tso_segsz); TXD->tcp_seg_setup.fields.hdr_len = hdr_len; - TXD->cmd_and_length = htole32(sc->txd_cmd | - E1000_TXD_CMD_DEXT | /* Extended descr */ - E1000_TXD_CMD_TSE | /* TSE context */ - E1000_TXD_CMD_IP | /* Do IP csum */ - E1000_TXD_CMD_TCP | /* Do TCP checksum */ - (pi->ipi_len - hdr_len)); /* Total len */ + /* + * 8254x SDM4.0 page 45, and PCIe GbE SDM2.5 page 63 + * - Set up basic TUCMDs + * - Enable IP bit on 82544 + * - For others IP bit on indicates IPv4, while off indicates IPv6 + */ + cmd_type_len = sc->txd_cmd | + E1000_TXD_CMD_DEXT | /* Extended descr */ + E1000_TXD_CMD_TSE | /* TSE context */ + E1000_TXD_CMD_TCP; /* Do TCP checksum */ + if (hw->mac.type == e1000_82544) + cmd_type_len |= E1000_TXD_CMD_IP; + else if (pi->ipi_etype == ETHERTYPE_IP) + cmd_type_len |= E1000_TXD_CMD_IP; + TXD->cmd_and_length = htole32(cmd_type_len | + (pi->ipi_len - hdr_len)); /* Total len */ + txr->tx_tso = true; if (++cur == scctx->isc_ntxd[0]) {