From nobody Sat Jul 22 04:44:09 2023 X-Original-To: dev-commits-src-all@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 4R7DNB6X0Bz4nYgm; Sat, 22 Jul 2023 04:44:10 +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 4R7DNB5Z8Kz3tCQ; Sat, 22 Jul 2023 04:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690001050; 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=+MbIKR0cQLMSrwwRpuqSJ0w34HJXyVNQNszfWsQqrZE=; b=q0lzXJ0rfC1OZ8JP4v2cH5/ODOv9neNyNWlJz7sflAoEMweIp+ruvZ8bsGJQoYUQKDgiXp AK8h+4gxbzRKimxBHvVxU2bKVTj/9ObRQiXnJWb+I3+MLbL37tEtLXzZJ8IO4nucQyphXo Jdo8IorK5v+1jpxgPaq18miWgWs1czlwdOK2zOWzY1CYB5TPs1oyAA+B8fer+lr1hjvU5S OhP/q/KS5/yJHVPSEQqwzNA337DAoA//l8XKpES9NOLg6P49JYWqHq4T43g2NZvDhCP1DZ YfS5VBBAhm6w6UWjVMen/sAPWe11btkAvehXr7TsvycyejwcDoPgDh9NoRPXOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690001050; 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=+MbIKR0cQLMSrwwRpuqSJ0w34HJXyVNQNszfWsQqrZE=; b=gWhfl+23UuoDpR32nH1kxY0fzMB2fGwzP+8ake9dmoIaRm3LF+Et+tJSnyCp59a7/48GV6 WE1Cado6kxjJ50uOxJqJasm8E5+KLxMOJ521OBTwNzi07dh1nMEp169PCcFBH6cdunv7Lj 1PmjTqDN6gl7fDwz0jcUEPYFKZ1qWX9983I2O+t2I+ZR8T0dtk8I3TG5VH8wkYGsdagBcR 2ABHYBupVAMQmUtZcjyiYMixlfH8qtWQInoIHd1dDnrQeZINC8YDsTBiYHmA+BngL6+Vy6 PeMDsrZn/x4v7/2+ND+5urIxjc50/yDLNxK1at+SZEGgIGeef7Bz93BcxiyEbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690001050; a=rsa-sha256; cv=none; b=weuujpv9deZb/ev7X0YvcqrLjAzHF6TG++kWLe/AboP5wtfjV0N6DceU6+27Wf9CyT7r/t 8gE1QPZmRlK73zEBglqOSTGbizf3D9FeKXD5kKFx9NpJpwNuN+f1V16Kr8GBeXsofGm6uV dV94qRLOo5pa8VJFkSqzbcIpFsRYDQXNjsMbMvbwKvG9Z+VPMuEkxO73yV5JqLQnyrYiaA F2kS2USe6dD+9dvn7lGgfS0n41/dpuyEAAQ2TGwjkYXE1Dpmy6wjlSMhxB32VGlCAqS906 a40CDBGoQ2vC0nP3yNGpQYjCdSpPEbX95eZpZTBPeqkmj8a5B1Q3HLmyg3GDeA== 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 4R7DNB46QVzh2Q; Sat, 22 Jul 2023 04:44:10 +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 36M4i9ZA018662; Sat, 22 Jul 2023 04:44:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36M4i9CE018661; Sat, 22 Jul 2023 04:44:09 GMT (envelope-from git) Date: Sat, 22 Jul 2023 04:44:09 GMT Message-Id: <202307220444.36M4i9CE018661@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: 5d3c98254927 - main - Revert "e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 5d3c982549278c72d59debae7227366453d3c4a8 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=5d3c982549278c72d59debae7227366453d3c4a8 commit 5d3c982549278c72d59debae7227366453d3c4a8 Author: Kevin Bowling AuthorDate: 2023-07-22 04:42:23 +0000 Commit: Kevin Bowling CommitDate: 2023-07-22 04:42:23 +0000 Revert "e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes" Seems to cause a panic when booting under VitrualBox. Reported by: yasu This reverts commit 95f7b36e8fac45092b9a4eea5e32732e979989f0. --- sys/dev/e1000/em_txrx.c | 15 +++++++-------- sys/dev/e1000/if_em.c | 48 ++++++++++++++++-------------------------------- 2 files changed, 23 insertions(+), 40 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index 069a1c00a4b2..47f9b187aa14 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -674,12 +674,12 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) i++; } while (!eop); - if (scctx->isc_capenable & IFCAP_RXCSUM) + /* XXX add a faster way to look this up */ + if (sc->hw.mac.type >= e1000_82543) em_receive_checksum(status, errors, ri); - if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && - status & E1000_RXD_STAT_VP) { - ri->iri_vtag = le16toh(rxd->special & E1000_RXD_SPC_VLAN_MASK); + if (status & E1000_RXD_STAT_VP) { + ri->iri_vtag = le16toh(rxd->special); ri->iri_flags |= M_VLANTAG; } @@ -699,11 +699,11 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) uint16_t len; uint32_t pkt_info; - uint32_t staterr; + uint32_t staterr = 0; bool eop; int i, cidx; - staterr = i = 0; + i = 0; cidx = ri->iri_cidx; do { @@ -739,8 +739,7 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) if (scctx->isc_capenable & IFCAP_RXCSUM) em_receive_checksum(staterr, staterr >> 24, ri); - if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && - staterr & E1000_RXD_STAT_VP) { + if (staterr & E1000_RXD_STAT_VP) { ri->iri_vtag = le16toh(rxd->wb.upper.vlan); ri->iri_flags |= M_VLANTAG; } diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index b5a6e7e777d3..0b664b155872 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -781,21 +781,19 @@ em_set_num_queues(if_ctx_t ctx) return (maxqueues); } -#define LEM_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_JUMBO_MTU - -#define EM_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ - IFCAP_TSO6 - -#define IGB_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ +#define LEM_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER + +#define EM_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO + +#define IGB_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 |\ IFCAP_TSO6 /********************************************************************* @@ -899,7 +897,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_tso_segsize_max = EM_TSO_SEG_SIZE; scctx->isc_capabilities = scctx->isc_capenable = EM_CAPS; /* - * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO,TSO6} + * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO} * by default as we don't have workarounds for all associated * silicon errata. E. g., with several MACs such as 82573E, * TSO only works at Gigabit speed and otherwise can cause the @@ -914,9 +912,8 @@ em_if_attach_pre(if_ctx_t ctx) * work for a few MACs of this class - at least when sticking * with Gigabit - in which case users may enable TSO manually. */ - scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO | IFCAP_TSO6); - scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO | - CSUM_IP6_TCP | CSUM_IP6_UDP; + scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); + scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO; /* * We support MSI-X with 82574 only, but indicate to iflib(4) * that it shall give MSI at least a try with other devices. @@ -935,19 +932,6 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP; scctx->isc_txrx = &lem_txrx; scctx->isc_capabilities = LEM_CAPS; - - /* - * For LEM-class devices, don't enable IFCAP {TSO4,VLAN_HWTSO} - * by default as we don't have workarounds for all associated - * silicon errata. TSO4 may work on > 82544 but its status - * is unknown by the authors. Please report any success or failures. - */ - scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); - - /* 8254x SDM4.0 page 33 - FDX requirement on these chips */ - if (hw->mac.type == e1000_82547 || hw->mac.type == e1000_82547_rev_2) - scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); - if (hw->mac.type < e1000_82543) scctx->isc_capabilities &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); /* 82541ER doesn't do HW tagging */