lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 24 Sep 2014 12:45:45 -0400
From:	Vlad Yasevich <vyasevic@...hat.com>
To:	Eric Dumazet <eric.dumazet@...il.com>,
	Vladislav Yasevich <vyasevich@...il.com>
CC:	netdev@...r.kernel.org, stephen@...workplumber.org
Subject: Re: [PATCH] vlan: Fix receive statistics under-reporting

On 09/24/2014 11:08 AM, Eric Dumazet wrote:
> On Wed, 2014-09-24 at 10:45 -0400, Vladislav Yasevich wrote:
>> Vlan devices uder-report 14 bytes per packet in the recieve statistics.
>> This is because the ETH_HLEN bytes of data has been pulled off the skb
>> by the time it gets to the vlan receive code.  When accounting for
>> receive butes, add ETH_HLEN back.
>>
>> See also https://bugzilla.kernel.org/show_bug.cgi?id=84951
>>
>> Signed-off-by: Vladislav Yasevich <vyasevic@...hat.com>
>> ---
>>  net/8021q/vlan_core.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
>> index 90cc2bd..8bc5d46 100644
>> --- a/net/8021q/vlan_core.c
>> +++ b/net/8021q/vlan_core.c
>> @@ -54,7 +54,7 @@ bool vlan_do_receive(struct sk_buff **skbp)
>>  
>>  	u64_stats_update_begin(&rx_stats->syncp);
>>  	rx_stats->rx_packets++;
>> -	rx_stats->rx_bytes += skb->len;
>> +	rx_stats->rx_bytes += skb->len + ETH_HLEN;
>>  	if (skb->pkt_type == PACKET_MULTICAST)
>>  		rx_stats->rx_multicast++;
>>  	u64_stats_update_end(&rx_stats->syncp);
> 
> 
> I do not think this patch is general enough, it doesn't handle GRO for
> example.

I just looked at more software devices (including encapsulators) and
find that macvlan appears to be the only anomaly.

Everyone appears to be using skb->len directly and dropping ETH_HLEN.
Macvlan tries to be "extra smart" and adds the ETH_HLEN back in.

Definitely this patch isn't enough all by itself.  I might be better
to make it consistent the other way around.


> 
> And should not the vlan tag also be accounted ? 
> 
> 

I don't think so. We don't do it on TX.

-vlad
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ