From nobody Wed Mar 16 23:30:25 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 4D0221A37C88 for ; Wed, 16 Mar 2022 23:30:26 +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 4KJmjG10v8z4hJX for ; Wed, 16 Mar 2022 23:30:26 +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 023C81F81C for ; Wed, 16 Mar 2022 23:30:26 +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 22GNUPeG076925 for ; Wed, 16 Mar 2022 23:30:25 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 22GNUPWR076924 for net@FreeBSD.org; Wed, 16 Mar 2022 23:30:25 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 262571] epair(4) interfaces stop forwarding traffic on moderate load Date: Wed, 16 Mar 2022 23:30:25 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed 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: commit-hook@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: 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=1647473426; 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=kj54uvNJ5YqM2x68o6jxQzSqrOVgZYO2RsMlZRKmX2Q=; b=PpIUz6GxY5C1/jTlkUO4o5VjlEZNbhk3JPZp9aX2UsYTNUGLbkNZXTxLdisc76PVKP+jeb QyAjO88Qg0/3dN707iuyI99JSllbsaSiTulDzFSy8za9AHZ6t/3cx34fgKnmVYu4F7Lemj OrEkE2HnZI5ICmzwIV1tb2DRIP8Iug86QUAxxxe2UU8J5mxV23Gt69oM3Lq5/DqLH9JYkM KDmB1g8BS+FOpxF5g/N/HpdmtHwaxA+MVL3aFbzhGtlHoMPc4OMzHiDT2DzvVQxYxwsf0D 2sGBhwNez5gKyTzXr9f3FA/H+fjYccNLeV2C1DR7Aa4O3iCwAnXe32UBMtL+mA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647473426; a=rsa-sha256; cv=none; b=sibYIQxl5Go2TePHsSXoVVsxs3XRhYgstFZgyZ9EhFNBGx7kkyKfUIi/GwhMQFrbDN3ueY u2ROG9mgrbwBrXzxhPIIMTWt5Q9P2jiVAyPc7X5axN/QXUzQDewCLlDZLrpGT69clDzSrP 0iwKlcXksmswOdxF4e/zSWSxiUrnrVchYdvkBj7Nmsg291qmTOplnF38i8m6DDRqj3GTK5 Dti9im7AmM2BYM10uxtaGonE4keao+74EBCgr1BRtsDLNLuMHZwVoKm1Br1Z6P5GJy3TsE dYntdMzunomH4gbLqndf/AeLsWFGsI1JtUIarFdf0LRFNEzu5j732VE924udtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262571 --- Comment #1 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D66acf7685bcd8cf23b6c658a991637238= a01859e commit 66acf7685bcd8cf23b6c658a991637238a01859e Author: Michael Gmelin AuthorDate: 2022-03-16 22:08:55 +0000 Commit: Kristof Provost CommitDate: 2022-03-16 22:08:55 +0000 if_epair: fix race condition on multi-core systems As an unwanted side effect of the performance improvements in 24f0bfbad57b9, epair interfaces stop forwarding traffic on higher load levels when running on multi-core systems. This happens due to a race condition in the logic that decides when to place work in the task queue(s) responsible for processing the content of ring buffers. In order to fix this, a field named state is added to the epair_queue structure. This field is used by the affected functions to signal each other that something happened in the underlying ring buffers that might require work to be scheduled in task queue(s), replacing the existing logic, which relied on checking if ring buffers are empty or not. epair_menq() does: - set BIT_MBUF_QUEUED - queue mbuf - if testandset BIT_QUEUE_TASK: enqueue task epair_tx_start_deferred() does: - swap ring buffers - process mbufs - clear BIT_QUEUE_TASK - if testandclear BIT_MBUF_QUEUED enqueue task PR: 262571 Reported by: Johan Hendriks MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D34569 sys/net/if_epair.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=