Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: problems with vlan interface counters (NetBSD 8.0_BETA)



Hi, Uwe

The problem was happened in vlan mp-ify.
I fixed this problem by the following patch in my environment.

Could you apply the patch and check it?

Regards,
s-yamaguchi@IIJ

---- patch ----
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 531a2f5..a4ea6e1 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -1451,10 +1451,13 @@ vlan_transmit(struct ifnet *ifp, struct mbuf *m)
                /* mbuf is already freed */
                ifp->if_oerrors++;
        } else {
+               size_t pktlen = m->m_pkthdr.len;
+               bool mcast = (m->m_flags & M_MCAST) != 0;
+
                ifp->if_opackets++;
-               /*
-                * obytes is incremented at ether_output() or bridge_enqueue().
-                */
+               ifp->if_obytes += pktlen;
+               if (mcast)
+                       ifp->if_omcasts++;
        }

 out:


2017-07-28 17:10 GMT+09:00  <6bone%6bone.informatik.uni-leipzig.de@localhost>:
> Hello,
>
> The interface counters of vlan interface do not count:
>
> bash-4.4# ifconfig -v vlan8
> vlan8: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         capabilities=7ff80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx>
>         capabilities=7ff80<TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Rx>
>         capabilities=7ff80<TCP6CSUM_Tx,UDP6CSUM_Rx,UDP6CSUM_Tx,TSO6>
>         enabled=0
>         vlan: 8 parent: ixg0
>         address: a0:36:9f:d4:3c:08
>         input: 1966263 packets, 273676300 bytes, 66058 multicasts
>         output: 1238957 packets, 0 bytes
>         inet6 fe80::a236:9fff:fed4:3c08%vlan8/64 flags 0x0 scopeid 0x1a
>         inet6 xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx flags 0x0
>
> The output byte counter shows 0. With netbsd-7 all worked fine.
>
> So it is not longer possible to record traffic data via snmp.
>
>
> Regards
> Uwe


Home | Main Index | Thread Index | Old Index