From nobody Mon Jun 13 21:47:09 2022 X-Original-To: net@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 0310F83BFA2 for ; Mon, 13 Jun 2022 21:47:18 +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 4LMQC960jXz4gw0 for ; Mon, 13 Jun 2022 21:47:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 AEE421DBFD for ; Mon, 13 Jun 2022 21:47:17 +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 25DLlHpc013869 for ; Mon, 13 Jun 2022 21:47:17 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 25DLlHPU013868 for net@FreeBSD.org; Mon, 13 Jun 2022 21:47:17 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: net@FreeBSD.org Subject: [Bug 166724] if_re(4): watchdog timeout Date: Mon, 13 Jun 2022 21:47:09 +0000 X-Bugzilla-Reason: AssignedTo CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.1-RELEASE X-Bugzilla-Keywords: needs-patch, needs-qa X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: freebsd@ruka.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: mfc-stable13? mfc-stable12? X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: 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: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655156837; 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: in-reply-to:in-reply-to:references:references; bh=U9coCmcpLR+OTiJvb8S+2ipIQoZE2I7EiwZUVbhspO0=; b=qnfgNvURCnIrlI6Ku3odArcIlZWHSAruPzLpuANgiH02IOIuAbIlOD73sCa5hT5Z+fmxC7 +YFUsPam2A+b3XQE6MpY1x0TyHMYCtIgEWwVi9e4cYGmR2V2lflrRQyTomhiA0J5GLvQur X8gN4NqTA1EhM/VEZzD6LglFZxlugR9PoXw0FkVG0Age2KT9LaR6wM51L8X+jvyr+/28Mt m+bhv435snlYYq5+Qm/kIzENUVuTkG0U0gDs5pHRkY85/2lfYjYEajOn/FnJ1BFhiVwunu +7/PeGOY4kb7EYyKkN+kTqjIzCjHLv1JGAAYw1jJE0X2uuGVeRCzgQupAykESw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655156837; a=rsa-sha256; cv=none; b=V5uT/LT1rDeGc7g08sfx2lMU5asMBAbFD6K1xxdtK/HyXM463V2A7pH2k1IEOoHIQAjNIu 9wf51omzbBRqSvORiL/Vc31sWnCzJAbrq2kEIUqypRQziaow/yvKRZ9AqCuKLt04Fnw5vY wog8O8/Lmq1/xJ3aIKvpwHfJQES+a7C9Wc0NllFnA9s3rHLCfpHX03ADAxrGaYWmyQ2DvW VlZOLeW6nJupEmU/3eN9A5MrlZTko20pNSIaUBcwViMjxRQVzoEJsX+0HEt5Eazvtz749o MYvubba49gI66vEZ4F9VSuzsJPPPuLPkqQnC854q9GcZRQs0EZ65SZrREZQYfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D166724 Richard Russo changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |freebsd@ruka.org --- Comment #101 from Richard Russo --- I spent some time trying to debug this, without significant results, but I wanted to share what I learned, mostly things that didn't work. My hardware is class=3D0x020000 rev=3D0x0c hdr=3D0x00 vendor=3D0x10ec devic= e=3D0x8168 subvendor=3D0x1462 subdevice=3D0x7850; and I was able to fairly reliably tr= igger the condition with iperf3 -s on the re0 (in a vnet jail), and iperf3 -c --b= idir on another interface. My hardware is fairly meager, Intel G3470, using a multiport Intel em card for the otherside of the iperf3 testing. Using the kernel driver (13.1-RELEASE), I would tend to see traffic stall a= nd timeouts be reported within one minute, although sometimes within a few seconds. Using the vendor driver from net/realtek-re-kmod, I was unable to reproduce the error condition. There's a fair amount of differences between the two drivers, and I tried a bunch of things, but could never pass my test. Sending more transmit reques= ts didn't help; the vendor driver sends it twice, but that doesn't seem to hel= p; sending TX requests in the watchdog handler didn't help either. I noticed that the Tx queue would usually be stuck on the 2nd segment of a = two or three segment packet, so I tried adding m_defrag to make all the packets= a single segment. That didn't work either. There didn't seem to be a pattern = of which Tx segment the NIC would get stuck on, or anything obvious about the = data addresses. I also tried messing with the reset to maybe make that more reliable. The vendor driver does reset a little bit differently, but nothing there made things reliable for me either. After a few resets, the NIC just doesn't see= m to start sending again; until a reboot (at least with my NIC; I've seen some reports that a power cycle is required). Reading the tx/rx registers before setting them, I saw that those are retained across reboots, so the device doesn't seem to be getting fully reset, which might explain some reporter's need to power cycle. I suspect there's something in the mostly opaque vendor initialization code, that puts the device in a better mode where it doesn't get stuck (at least = with my test loads). I do notice that the vendor initialization causes the devic= e to emit ethernet pause frames, which doesn't happen with the kernel code. One thing I was able to make a positive difference with though, the kernel reset doesn't clear the RX/TX buffers, although it frees the associated mbu= fs. Sometimes during a reset or shortly afterwards, the NIC is still using those descriptor arrays; so I would see weird packets apparently coming in on re0= via tcpdump, many of them looking like recently used mbufs on other interfaces.= I also saw some bizarre packets RXed by the em NIC connected to re0, and some evidence of other NICs receiving corrupted mbufs. Using explicit_bzero during descriptor setup seemed to help, as well as tur= ning off the CMD_OWN flag on the descriptors during re_stop. It's obviously a bit tricky if the device is acknowledging a command reset, but not actually ful= ly resetting. I don't have an IOMMU system, but I'd guess if you had that, you could get more information about what's going on. Running with INVARIANTS showed some use after free errors, which I believe = are related to the device using the mbufs, although it was hard to trigger and difficult to debug. --=20 You are receiving this mail because: You are the assignee for the bug. You are on the CC list for the bug.=