Project

General

Profile

Actions

Bug #10812

closed

Traffic graph shows 2X the actual traffic on VLAN interfaces.

Added by Nano Caiordo over 4 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
Start date:
08/03/2020
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.5.x
Affected Architecture:

Description

#3314 is back again on, as of today, latest snapshot

2.5.0-DEVELOPMENT (amd64)
built on Sun Aug 02 19:02:34 EDT 2020
FreeBSD 12.1-STABLE
Actions #1

Updated by → luckman212 about 4 years ago

I notice #10852 also seems to be the same issue.

Actions #2

Updated by Jim Pingle about 4 years ago

  • Target version set to 2.5.0
Actions #3

Updated by Anonymous about 4 years ago

  • Assignee set to Jim Pingle
Actions #4

Updated by Jim Pingle about 4 years ago

  • Subject changed from Reopen - Traffic graph shows 2X the actual traffic on VLAN interfaces. to Traffic graph shows 2X the actual traffic on VLAN interfaces.
  • Assignee changed from Jim Pingle to Renato Botelho

Last time this came up it was due to VLAN traffic counting twice on the parent. In https://redmine.pfsense.org/issues/3314#note-21 it was Renato that added the patch (or noted it was added, at least). Might be one we need to track down and reapply after the last stable merge.

Actions #5

Updated by Marcos M about 4 years ago

Jim Pingle wrote:

Last time this came up it was due to VLAN traffic counting twice on the parent. In https://redmine.pfsense.org/issues/3314#note-21 it was Renato that added the patch (or noted it was added, at least). Might be one we need to track down and reapply after the last stable merge.

Looked at commits during that time, but no luck finding it:
https://redmine.pfsense.org/projects/pfsense/repository/revisions?page=637

Actions #6

Updated by Renato Botelho about 4 years ago

  • Assignee changed from Renato Botelho to Luiz Souza

Luiz enabled ALTQ on if_vlan.c few time before this ticket was opened. He is going to check if his commit re-introduced this issue

Actions #7

Updated by Renato Botelho about 4 years ago

It regressed before as we can see on #7751 and fix was committed to 2.4.4 branch on FreeBSD-src

commit 327d0a44358
Author: Luiz Souza <luiz@netgate.com>
Date:   Thu Aug 17 23:31:03 2017 -0500

    Fix the counter values for VLAN interfaces.  The packet bytes are already counted in IFQ_HANDOFF().

    Ticket #7751

diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index e50b3ddebba..8ccd9c44453 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -1136,12 +1136,8 @@ vlan_start(struct ifnet *ifp)
                 * Send it, precisely as ether_output() would have.
                 */
                error = (p->if_transmit)(p, m);
-               if (error == 0) {
-                       if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
-                       if_inc_counter(ifp, IFCOUNTER_OBYTES, len);
-                       if_inc_counter(ifp, IFCOUNTER_OMCASTS, mcast);
-               } else
-                       if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
+               if_inc_counter(ifp,
+                   (error == 0) ? IFCOUNTER_OPACKETS : IFCOUNTER_OERRORS, 1);
        }
 }
Actions #8

Updated by Luiz Souza about 4 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

Fix committed.

The fix is a bit different with the new code.

Actions #9

Updated by Renato Botelho about 4 years ago

Fixed by commit 2841d41b090 on branch devel-12 of FreeBSD-src repository

Actions #10

Updated by Danilo Zrenjanin about 4 years ago

  • Status changed from Feedback to Resolved

Tested on :

2.5.0-DEVELOPMENT (amd64)
built on Sat Nov 14 07:01:37 EST 2020
FreeBSD 12.2-STABLE

The Traffic graph shows correct values for vlan interfaces. Ticket resolved.

Actions

Also available in: Atom PDF