From nobody@FreeBSD.org  Tue Dec 20 14:56:30 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2FD551065678
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 20 Dec 2011 14:56:30 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 148C28FC20
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 20 Dec 2011 14:56:30 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id pBKEuTUm000504
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 20 Dec 2011 14:56:29 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id pBKEuTnO000503;
	Tue, 20 Dec 2011 14:56:29 GMT
	(envelope-from nobody)
Message-Id: <201112201456.pBKEuTnO000503@red.freebsd.org>
Date: Tue, 20 Dec 2011 14:56:29 GMT
From: Eugen Konkov <kes-kes@yandex.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: interface does not count bytes on interface
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         163478
>Category:       kern
>Synopsis:       [re] interface does not count bytes on interface
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    yongari
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 20 15:00:30 UTC 2011
>Closed-Date:    Fri Jan 06 21:38:27 UTC 2012
>Last-Modified:  Fri Jan 06 21:38:27 UTC 2012
>Originator:     Eugen Konkov
>Release:        10.0-CURRENT
>Organization:
ISP FreeLine
>Environment:
# uname -a
FreeBSD meta-up 10.0-CURRENT FreeBSD 10.0-CURRENT #1: Sat Dec 17 21:11:04 EET 2011     @:/usr/obj/usr/src/sys/KES_KERN_v10  i386

>Description:
Getting statistics on interface from SNMP:
octetsIn:4057310174 octetsOut:0 packetsIn:6900040 packetsOut:6059095

Doing trafshow or bwm-ng does not show traffic on vlan interface, BUT if I watch  packets - all is OK


# ifconfig re0
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC>
        ether 00:30:67:5a:44:72
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
# ifconfig vlan7
vlan7: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=103<RXCSUM,TXCSUM,TSO4>
        ether 00:1b:21:45:da:b9
        inet 10.11.19.149 netmask 0xfffffff8 broadcast 10.11.19.151 vhid 5
        inet6 fe80::21b:21ff:fe45:dab9%vlan7 prefixlen 64 scopeid 0x9 vhid 5
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        vlan: 7 parent interface: igb1
on one console:
# tcpdump -n -i re0
tcpdump: WARNING: re0: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on re0, link-type EN10MB (Ethernet), capture size 65535 bytes
16:51:36.478028 ARP, Request who-has 10.11.19.145 tell 10.11.19.146, length 42

on other console:
# ping 10.11.19.146
PING 10.11.19.146 (10.11.19.146): 56 data bytes
64 bytes from 10.11.19.146: icmp_seq=1 ttl=63 time=3.720 ms
64 bytes from 10.11.19.146: icmp_seq=2 ttl=63 time=3.676 ms
64 bytes from 10.11.19.146: icmp_seq=3 ttl=63 time=3.757 ms
64 bytes from 10.11.19.146: icmp_seq=4 ttl=63 time=3.760 ms
^C
--- 10.11.19.146 ping statistics ---
5 packets transmitted, 4 packets received, 20.0% packet loss
round-trip min/avg/max/stddev = 3.676/3.728/3.760/0.034 ms

as you see no ARP, Reply packet seen.

again on first console:
# tcpdump -n -i vlan7
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on vlan7, link-type EN10MB (Ethernet), capture size 65535 bytes
16:53:42.914087 ARP, Request who-has 10.11.19.146 tell 10.11.19.149, length 28
16:53:42.916577 ARP, Reply 10.11.19.146 is-at 00:30:4f:71:a8:7f, length 42
16:53:42.916584 IP 10.11.19.149 > 10.11.19.146: ICMP echo request, id 17749, seq 0, length 64
16:53:42.920280 IP 10.11.19.146 > 10.11.19.149: ICMP echo reply, id 17749, seq 0, length 64
16:53:43.914478 IP 10.11.19.149 > 10.11.19.146: ICMP echo request, id 17749, seq 1, length 64
16:53:43.918174 IP 10.11.19.146 > 10.11.19.149: ICMP echo reply, id 17749, seq 1, length 64
16:53:44.914734 IP 10.11.19.149 > 10.11.19.146: ICMP echo request, id 17749, seq 2, length 64
16:53:44.918462 IP 10.11.19.146 > 10.11.19.149: ICMP echo reply, id 17749, seq 2, length 64



>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:

From: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= <kes-kes@yandex.ru>
To: bug-followup@FreeBSD.org, kes-kes@yandex.ru
Cc:  
Subject: Re: i386/163478: interface does not count bytes on interface
Date: Tue, 20 Dec 2011 18:20:26 +0200

 sorry, this is dublicate post and must be closed
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=i386/163480
 
 
 
State-Changed-From-To: open->closed 
State-Changed-By: eadler 
State-Changed-When: Mon Dec 26 01:50:53 UTC 2011 
State-Changed-Why:  
duplicate; closed per submitter 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163478 
State-Changed-From-To: closed->open 
State-Changed-By: eadler 
State-Changed-When: Mon Dec 26 13:33:33 UTC 2011 
State-Changed-Why:  
woops - the other one was already closed 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163478 
Responsible-Changed-From-To: freebsd-i386->freebsd-net 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Mon Dec 26 13:33:43 UTC 2011 
Responsible-Changed-Why:  
assign  

http://www.freebsd.org/cgi/query-pr.cgi?pr=163478 
State-Changed-From-To: open->feedback 
State-Changed-By: yongari 
State-Changed-When: Tue Dec 27 18:38:15 UTC 2011 
State-Changed-Why:  
I believe this has nothing to do with re(4). 
See a possible patch for vlan(4) at the following URL. 
http://lists.freebsd.org/pipermail/freebsd-net/2011-December/030818.html 


Responsible-Changed-From-To: freebsd-net->yongari 
Responsible-Changed-By: yongari 
Responsible-Changed-When: Tue Dec 27 18:38:15 UTC 2011 
Responsible-Changed-Why:  
Grab. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163478 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/163478: commit references a PR
Date: Thu, 29 Dec 2011 18:41:08 +0000 (UTC)

 Author: yongari
 Date: Thu Dec 29 18:40:58 2011
 New Revision: 228967
 URL: http://svn.freebsd.org/changeset/base/228967
 
 Log:
   Update if_obytes and if_omcast after successful transmit.
   While I'm here update if_oerrors if parent interface of vlan is not
   up and running.  Previously it updated collision counter and it was
   confusing to interprete it.
   
   PR:		kern/163478
   Reviewed by:	glebius, jhb
   Tested by:	Joe Holden < lists <> rewt dot org dot uk >
 
 Modified:
   head/sys/net/if_vlan.c
 
 Modified: head/sys/net/if_vlan.c
 ==============================================================================
 --- head/sys/net/if_vlan.c	Thu Dec 29 18:25:18 2011	(r228966)
 +++ head/sys/net/if_vlan.c	Thu Dec 29 18:40:58 2011	(r228967)
 @@ -1012,10 +1012,12 @@ vlan_transmit(struct ifnet *ifp, struct 
  {
  	struct ifvlan *ifv;
  	struct ifnet *p;
 -	int error;
 +	int error, len, mcast;
  
  	ifv = ifp->if_softc;
  	p = PARENT(ifv);
 +	len = m->m_pkthdr.len;
 +	mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1 : 0;
  
  	BPF_MTAP(ifp, m);
  
 @@ -1025,7 +1027,7 @@ vlan_transmit(struct ifnet *ifp, struct 
  	 */
  	if (!UP_AND_RUNNING(p)) {
  		m_freem(m);
 -		ifp->if_collisions++;
 +		ifp->if_oerrors++;
  		return (0);
  	}
  
 @@ -1081,9 +1083,11 @@ vlan_transmit(struct ifnet *ifp, struct 
  	 * Send it, precisely as ether_output() would have.
  	 */
  	error = (p->if_transmit)(p, m);
 -	if (!error)
 +	if (!error) {
  		ifp->if_opackets++;
 -	else
 +		ifp->if_omcasts += mcast;
 +		ifp->if_obytes += len;
 +	} else
  		ifp->if_oerrors++;
  	return (error);
  }
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: feedback->patched 
State-Changed-By: yongari 
State-Changed-When: Fri Dec 30 00:08:30 UTC 2011 
State-Changed-Why:  
Fixed in HEAD(r228967). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163478 

From: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= <kes-kes@yandex.ru>
To: bug-followup@FreeBSD.org, kes-kes@yandex.ru
Cc:  
Subject: Re: kern/163478: [re] interface does not count bytes on interface
Date: Fri, 6 Jan 2012 23:04:49 +0200

 works fine from sources
   9.0-STABLE FreeBSD 9.0-STABLE #2: Wed Jan  4 01:18:53 EET 2012
 
   may close
 
State-Changed-From-To: patched->closed 
State-Changed-By: yongari 
State-Changed-When: Fri Jan 6 21:37:43 UTC 2012 
State-Changed-Why:  
MFC to stable/[8-9] complete. 
Thanks a lot! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163478 
>Unformatted:
