From owner-freebsd-bugs@freebsd.org Wed Jan 20 08:16:34 2021 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B19654EDF23 for ; Wed, 20 Jan 2021 08:16:34 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4DLJJf4SYXz3sHv for ; Wed, 20 Jan 2021 08:16:34 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 9748A4EDF22; Wed, 20 Jan 2021 08:16:34 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 970DF4EDF95 for ; Wed, 20 Jan 2021 08:16:34 +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 4DLJJf3dNkz3s18 for ; Wed, 20 Jan 2021 08:16: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 6F8CE162FA for ; Wed, 20 Jan 2021 08:16:34 +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 10K8GYqP036627 for ; Wed, 20 Jan 2021 08:16:34 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 10K8GYYZ036626 for bugs@FreeBSD.org; Wed, 20 Jan 2021 08:16:34 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 252850] Netmap doesn't update default packet statistics for management entities Date: Wed, 20 Jan 2021 08:16:34 +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: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: stephan.dewt@yahoo.co.uk 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 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 MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2021 08:16:34 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D252850 Bug ID: 252850 Summary: Netmap doesn't update default packet statistics for management entities Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: stephan.dewt@yahoo.co.uk Created attachment 221760 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D221760&action= =3Dedit patch for the above-described bug Certain userspace applications might want to keep track of RX/TX bytes and packets, which are fed into the if_mib structure and accessible via the sys= ctl net.link.generic.ifdata.[IF_INDEX].{general/linkspecific}. The handler for = this calls if_data_copy(), which in turn calls a driver-specific function which checks if certain statistics are available in the hardware, such as: - IPACKET=20 - OPACKETS - IBYTES - OBYTES etc. If a driver does NOT collect these statistics, such as Intel, the system re= lies on a default counter which gets incremented as soon as a packet makes its w= ay through the datapath in iflib. However, when the interface is in NETMAP mode, these counters are not incremented. This means that any management entities keeping track of bytes= and packets do not see anything coming through. The fix for this (unless this was intentionally left out?) has two options = in my opinion: 1. Increase default counters as the system would, right after if_input() is called. This undermines the idea of Netmap though, since userspace applicat= ions control whether packets are passed up the host stack. 2. Increase the default counters right before netmap_{rx/tx}sync has finish= ed executing. This has the effect that ALL packets and bytes which enter the system are recorded, causing the numbers to be representative of the underl= ying hardware, as is intended through iflib's ifdi_get_counter() function. Please find attached a proposed patch for this. --=20 You are receiving this mail because: You are the assignee for the bug.=