From nobody Wed Mar 16 23:48:33 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 C40A01A164D9 for ; Wed, 16 Mar 2022 23:48:35 +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 4KJn6B2lrJz4nD7 for ; Wed, 16 Mar 2022 23:48:34 +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 06C251FD22 for ; Wed, 16 Mar 2022 23:48:33 +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 22GNmX3n086242 for ; Wed, 16 Mar 2022 23:48:33 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 22GNmXto086241 for net@FreeBSD.org; Wed, 16 Mar 2022 23:48:33 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:48:33 +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=1647474515; 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=DJgMEJ8fFUkkV1rrAaB8mapgGnxcbTt26e1JymVhKeM=; b=PzZLmaW1pS6tOcba7czCzwAQf/CZ5+Mo59XXgTNt+1Dxn9Bzb5eoW/yCmazpGcQgpo6a1v QD/vq/30jZirjWBlb60uKBdFEKY2Av6r1kL0TocZt4Rc0rR0P2RzUaSmoUQnSLETb1LHyi z6z4hmfgsj3E+QtBof2z29j+0FlOb2WsILkMJ7l3BSGW1pF8GKYA+VbrfNE32NN68XUNfB OunJKJy0uS4aCJfYJ0S9eYhwCSPRUVIu8nYo5SSZwL5zYBSDu6a9NjEGgTOlrypNBIKGqL 6KqZ98yAwaecIyogsrUdDvgYr0Rrh00D6AvNETEAV4t9356Mtgz8ToHExYYIUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647474515; a=rsa-sha256; cv=none; b=b7ooPDnrS7g2V9Ax6/ZhHg+AXDcA/shzkGQxMiJGZXYNGmfkOdRciKhWBcJbO8GOvrQS/z C+yts4mubyXfpX/ySEyANPTv1MsLeydj73EfMVh0nGMzPYqaTV4nNS2wVO57SBVXiosO+v Jpos27WHWCglfV79z7peTETJkr6btL0y4zVbL+1LvoJ7IUdRe0RWhePZCzOY7Slsz2A7k5 wYiX3UJmo0SX1iEitcDPj7k0VziLYlvvFQFy5GuaH6spWBP8wLFZbrS/NklLnKDMGyT5J/ kIoM3U+FfhFbEPNyAKstqyBV3ikpLkWcCgZwnZliIG/qpXxt6fNlClUERIKcxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262571 --- Comment #3 from commit-hook@FreeBSD.org --- A commit in branch releng/13.1 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D1ddb6c5518e02953f3fe37d4da27a15eb= d7a5a12 commit 1ddb6c5518e02953f3fe37d4da27a15ebd7a5a12 Author: Michael Gmelin AuthorDate: 2022-03-16 22:08:55 +0000 Commit: Kristof Provost CommitDate: 2022-03-16 23:40:40 +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 Approved by: re (gjb, early MFC) Reported by: Johan Hendriks MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D34569 (cherry picked from commit 66acf7685bcd8cf23b6c658a991637238a01859e) (cherry picked from commit bb9ad300f029d57c84804702daa2652542a2535f) 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.=