From nobody Thu Jan 12 17:34:29 2023 X-Original-To: bugs@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 4NtBW95gTPz2pCnL for ; Thu, 12 Jan 2023 17:34:29 +0000 (UTC) (envelope-from bugzilla-noreply@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 4NtBW93DTVz4559 for ; Thu, 12 Jan 2023 17:34:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673544869; 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=JTRR/gVGU6QAqCA8eedgTNVlp7CQh8lXYV3/bXUMTns=; b=Vntf2Gbx3uYW/mKMJy7k3Ph++CD3FTYnj/PZYjwbJMCxKtfBkdD8LBGJf6QBT5CVelQ/3b P+V0yo/o37o5QF6bkZ8P2PcUxThx2u95CowrCZMmJS+TljC727WO7tCyeNr14Y95dlNTdR zQsBlp6wP9taycuKEP/fTTuP8UPmK5tQiHnyJmm+JoXAqcwnUMxwMKpDrBGtcSPeHOQ9D8 e2SolZrC/irt7BQl6jR920sm9FTqNjyttuYJy8Ywav2Y4GEkL/C/NZ5zWJ9Faig9rCysv2 g/Dw4RTkA5n8OInH1Ux8YffT50usuIrm5PNxBhoeWugXjtAVCUVlCda4fqZJNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673544869; a=rsa-sha256; cv=none; b=wRgl6fn4u1Nt478wVazLitJqg6c8eN2B2VTvQ2QnEmaL0/Ff5956MevIHCYeK8MWBsbhc0 zaQBiFGumYMNj4GqwFWsp+mmVllmTj2FFJx+pokwFssA4/8vNrmZr6uhFvN5ZyXFV/8K8N 4dcx9Gf3Vx78mXoCoxxF32l35yK5kUci5t6JQ4ekjIVWxJfMrk4QFdZXSJKD4ygm0SGvjH THNGCtqRXEhcBKzMha/IFDGSeQvYI6eCI0R0uJaOcTjnp18qZ/DUJi+oQaQNAZKmVaHGvI bjB7hR8ySU7WcCXwrAaMn+XBQm/9ed7rR+XN5aGVD//iPGt9kRgQDpKuZKXzmg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4NtBW92JGRzcQ8 for ; Thu, 12 Jan 2023 17:34:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 30CHYTIr070657 for ; Thu, 12 Jan 2023 17:34:29 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 30CHYTfZ070656 for bugs@FreeBSD.org; Thu, 12 Jan 2023 17:34:29 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 268910] ixgbe(4): rxcsum register setting can cause TCP connection hangs Date: Thu, 12 Jan 2023 17:34:29 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: brian90013@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D268910 Bug ID: 268910 Summary: ixgbe(4): rxcsum register setting can cause TCP connection hangs Product: Base System Version: 12.3-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: brian90013@gmail.com Hello, I started diagnosing a FreeBSD-12.3 system with a X550-T2 10GbE controller = that was having trouble making outgoing TCP connections (ssh for example). I used tcpdump and could see a response returning to the host but the client softw= are didn't seem to receive the packet and move forward. The port was configured for 1 queue per direction (dev.ix.0.iflib.override_nrxqs=3D1 and dev.ix.0.iflib.override_ntxqs=3D1) a= nd all offloads were disabled. I discovered that enabling rxcsum restored stable networking. I could complete ssh connections as well as generic TCP/UDP connections using nc. As soon as I removed the rxcsum offload, the initial behavior returned. I also discovered setting the number of queues > 1 was stable while queues=3D1 hung connections. I looked at ixgbe_initialize_receive_units() in if_ix.c where the RXCSUM register is set. Here's the relevant section: rxcsum =3D IXGBE_READ_REG(hw, IXGBE_RXCSUM); ixgbe_initialize_rss_mapping(sc); if (sc->num_rx_queues > 1) { /* RSS and RX IPP Checksum are mutually exclusive */ rxcsum |=3D IXGBE_RXCSUM_PCSD; } if (ifp->if_capenable & IFCAP_RXCSUM) rxcsum |=3D IXGBE_RXCSUM_PCSD; /* This is useful for calculating UDP/IP fragment checksums */ if (!(rxcsum & IXGBE_RXCSUM_PCSD)) rxcsum |=3D IXGBE_RXCSUM_IPPCSE; IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum); Not hard to see that if either queues>1 OR rxcsum is enabled the PCSD bit is set and IPPCSE is not set. In the case where queues=3D=3D1 AND !rxcsum, PCS= D is not set and IPPCSE is set (and my TCP connections hang). I believe there is a problem here but I'm not sure which part. A few notes: * The linux driver unconditionally sets PCSD and doesn't touch IPPCSE in ixgbe_set_mrqc(). * The e1000 FreeBSD driver sets PCSD if rx_queues > 1. It only calls xxx_initialize_rss_mapping() if rx_queues > 1 is true. ixgbe calls xxx_initialize_rss_mapping outside of the conditional so it is always run. = Does this mean PCSD must always be set? * I couldn't find anywhere in the driver where the UDP/IP fragment checksum= was used. Is there any benefit to setting IPPCSE? I modified the above code to always set PCSD and never set IPPCSE. In my testing on the X550-T2 and an optical X520 82599ES, this change eliminated = the hangs even with queues=3D1 and -rxcsum. I'm hoping this is enough detail for someone to identity the true root cause and best solution. Please let me know if you need additional information. --=20 You are receiving this mail because: You are the assignee for the bug.=