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

2017-08-30 Thread 6bone

Hello,

I was not in the office for three weeks and can only answer today.

I have tested the netbsd-8 sources of yesterday. The problem is solved.


Thank you for your efforts

Regards
Uwe


On Wed, 9 Aug 2017, Kengo NAKAHARA wrote:


Date: Wed, 9 Aug 2017 15:36:15 +0900
From: Kengo NAKAHARA 
To: s.ymgch...@gmail.com, 6b...@6bone.informatik.uni-leipzig.de
Cc: current-users@netbsd.org
Subject: Re: problems with vlan interface counters (NetBSD 8.0_BETA)

Hi,

On 2017/08/03 18:13, s ymgch wrote:

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  <6b...@6bone.informatik.uni-leipzig.de>:

Hello,

The interface counters of vlan interface do not count:

bash-4.4# ifconfig -v vlan8
vlan8: flags=0x8843 mtu 1500
capabilities=7ff80
capabilities=7ff80
capabilities=7ff80
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 ::::::: 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.

I test s-yamaguchi's patch and minor fixes which I received locally.
# He is my co-worker :)
The patch fixes the problem correctly, so I commit that as if_vlan.c:r1.99.

I will send pullup request to netbsd-8 branch. Could you retry after
pulled up?


Thanks,

--
//
Internet Initiative Japan Inc.

Device Engineering Section,
IoT Platform Development Department,
Network Division,
Technology Unit

Kengo NAKAHARA 



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

2017-08-08 Thread Kengo NAKAHARA
Hi,

On 2017/08/03 18:13, s ymgch wrote:
> 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  <6b...@6bone.informatik.uni-leipzig.de>:
>> Hello,
>>
>> The interface counters of vlan interface do not count:
>>
>> bash-4.4# ifconfig -v vlan8
>> vlan8: flags=0x8843 mtu 1500
>> capabilities=7ff80
>> capabilities=7ff80
>> capabilities=7ff80
>> 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 ::::::: 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.
I test s-yamaguchi's patch and minor fixes which I received locally.
# He is my co-worker :)
The patch fixes the problem correctly, so I commit that as if_vlan.c:r1.99.

I will send pullup request to netbsd-8 branch. Could you retry after
pulled up?


Thanks,

-- 
//
Internet Initiative Japan Inc.

Device Engineering Section,
IoT Platform Development Department,
Network Division,
Technology Unit

Kengo NAKAHARA 


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

2017-08-03 Thread s ymgch
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  <6b...@6bone.informatik.uni-leipzig.de>:
> Hello,
>
> The interface counters of vlan interface do not count:
>
> bash-4.4# ifconfig -v vlan8
> vlan8: flags=0x8843 mtu 1500
> capabilities=7ff80
> capabilities=7ff80
> capabilities=7ff80
> 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 ::::::: 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


problems with vlan interface counters (NetBSD 8.0_BETA)

2017-07-28 Thread 6bone

Hello,

The interface counters of vlan interface do not count:

bash-4.4# ifconfig -v vlan8
vlan8: flags=0x8843 mtu 1500
capabilities=7ff80
capabilities=7ff80
capabilities=7ff80
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 ::::::: 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