From nobody Tue Mar 15 14:08:19 2022 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 4B68B1A0962A for ; Tue, 15 Mar 2022 14:08:20 +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 4KHwH80LW9z3vs4 for ; Tue, 15 Mar 2022 14:08:20 +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 DD75422E3C for ; Tue, 15 Mar 2022 14:08:19 +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 22FE8Jog063012 for ; Tue, 15 Mar 2022 14:08:19 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 22FE8Jqq063011 for bugs@FreeBSD.org; Tue, 15 Mar 2022 14:08:19 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 262571] epair(4) interfaces stop forwarding traffic on moderate load Date: Tue, 15 Mar 2022 14:08:19 +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: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: grembo@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform bug_file_loc op_sys bug_status bug_severity priority component assigned_to reporter cc flagtypes.name attachments.created 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647353300; 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=S4xlb3pct8Ra7bCuQswJUZaxd79a9JwhiMZyEK8AVXo=; b=wRLPxyncnGEdSHSUyzw6LgmIoQ0+J2/RWZlIkvHR+drEQ1ICD+oWzlR2sSFXBG4CNN2rU+ CD0MuVbwoLTgr5mBaeI654TclY1WkQu/IsbsKr52B7wkjhm4TPQMgKENEM19+ieuVBxphE 2SOJYLHDKZ19uAiDRRAZYxV0pP5U1Z/1Fb9Wu+qdeBqM+GXHFNvmsAip6xAb7yRHPhjgef 0137JZQZNdrWrmouhD7qnY2JtuS6xf6vZ9o6k3gTcvEzchXktfvRLTsYfC3SWSw3KdHyMh 5pSxt1F3sfV3kUYWwtztuQowXIMhlJQEYR2pTZf5lNmwfcMIUGf0f0Han18DVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647353300; a=rsa-sha256; cv=none; b=F5IPXhDBsLnxgHZOIrGGrGJ7ZagmLUQTJw8dWryZBiz/Dosaru+ecQvgCHYhO8BDovMazE /Rn0MrEUqfUkwfyNVKZBfaf7eBy49BS7FoXj3OWlqUQU5irscO90j6Gb9uQFzz1maJsx8x /i4IqQI8E+ttsPmAYMaYRboX3JH7YEGmCUGgVh8Dr7dAYexo0PbujPhSv5vtZ9v6P1tmAW mSXAoMQZdSkNU1UvlFC6K+Tv/42+diCFPKaUNZeiwxYedQhWNWMD4HsIaOH7+h5fmRrHzq iufppDvZcX6DMfd+4wzeugA4FBvEx2xJoQl9fPOJY4kD3zj6HP1z+6wVmaKwZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262571 Bug ID: 262571 Summary: epair(4) interfaces stop forwarding traffic on moderate load Product: Base System Version: 13.1-RELEASE Hardware: Any URL: https://lists.freebsd.org/archives/freebsd-net/2022-Ma rch/001449.html OS: Any Status: New Severity: Affects Many People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: grembo@FreeBSD.org CC: bz@FreeBSD.org, kp@freebsd.org Flags: maintainer-feedback?(kp@freebsd.org) Created attachment 232471 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D232471&action= =3Dedit Patch that works around the problem As discussed on the freebsd-net mailing list[0]. Also affects CURRENT. When running on multicore systems, epair interfaces stop forwarding traffic even on moderate load and don't recover unless recreated. This is a critical problem, as it breaks vnet jails running non-trivial workloads. The problem= can be reproduced easily using a shell script[1]. This was introduced when adding multi-core improvements to epair[2]. It happens because work is scheduled in taskqueue(s) based on a check if mb= uf ring buffers are empty, a logic which is racy on multi-core systems. The ra= ce is happening between epair_menq() and epair_tx_start_deferred(). The patch attached to this PR addresses the problem, but it needs to be loo= ked at, profiled, and most likely improved by somebody who has a better understanding of both the code in question and writing lock free-code in general. [0]https://lists.freebsd.org/archives/freebsd-net/2022-March/001449.html [1]https://people.freebsd.org/~grembo/hang_epair.sh [2]https://cgit.freebsd.org/src/commit/?id=3D24f0bfbad57b9c3cb9b543a60b2ba0= 0e4812c286 --=20 You are receiving this mail because: You are the assignee for the bug.=