net-packet: restore packet statistics tp_packets to include drops
Subsystems (3)
PATCH 1/1 net-packet: restore packet statistics tp_packets to include drops
getsockopt PACKET_STATISTICS returns tp_packets + tp_drops. Commit ee80fbf301 cleaned up the getsockopt PACKET_STATISTICS code. This also changed semantics. Historically, tp_packets included tp_drops on return. The commit removed the line that adds tp_drops into tp_packets.
This patch reinstates the old semantics.
--- net/packet/af_packet.c | 2 ++ 1 file changed, 2 insertions(+)
net/packet/af_packet.c +2 -0
@@ -3259,9 +3259,11 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,if (po->tp_version ==TPACKET_V3 ) { lv =sizeof (struct tpacket_stats_v3 ); + st.stats3.tp_packets += st.stats3.tp_drops; data = &st.stats3; }else { lv =sizeof (struct tpacket_stats ); + st.stats1.tp_packets += st.stats1.tp_drops; data = &st.stats1; }
Signature · 1 line
1.8.3
Quoted 9 lines · Willem de Bruijn
getsockopt
PACKET_STATISTICSreturnstp_packets+tp_drops. Commitee80fbf301cleaned up the getsockoptPACKET_STATISTICScode. This also changed semantics. Historically,tp_packetsincludedtp_dropson return. The commit removed the line that addstp_dropsintotp_packets.This patch reinstates the old semantics.
Signed-off-by Willem de Bruijn <[email protected]>
Hello.
Quoted 2 lines · Willem de Bruijn
getsockopt
PACKET_STATISTICSreturnstp_packets+tp_drops. Commitee80fbf301cleaned up the getsockoptPACKET_STATISTICScode.
Please also specify that commit's summary in parens.
Quoted 7 lines
This also changed semantics. Historically,
tp_packetsincludedtp_dropson return. The commit removed the line that addstp_dropsintotp_packets.This patch reinstates the old semantics.
Signed-off-by Willem de Bruijn <[email protected]>
WBR, Sergei
PATCH 1/1 packet: restore packet statistics tp_packets to include drops
getsockopt PACKET_STATISTICS returns tp_packets + tp_drops. Commit ee80fbf301 ("packet: account statistics only in tpacket_stats_u") cleaned up the getsockopt PACKET_STATISTICS code.
This also changed semantics. Historically, tp_packets included tp_drops on return. The commit removed the line that adds tp_drops into tp_packets.
This patch reinstates the old semantics.
---
v2: incorporated commit summary by request. no code changes
--- net/packet/af_packet.c | 2 ++ 1 file changed, 2 insertions(+)
net/packet/af_packet.c +2 -0
@@ -3215,9 +3215,11 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,if (po->tp_version ==TPACKET_V3 ) { lv =sizeof (struct tpacket_stats_v3 ); + st.stats3.tp_packets += st.stats3.tp_drops; data = &st.stats3; }else { lv =sizeof (struct tpacket_stats ); + st.stats1.tp_packets += st.stats1.tp_drops; data = &st.stats1; }
Signature · 1 line
1.8.3
Re: [PATCH net] packet: restore packet statistics tp_packets to include drops
Quoted 10 lines · Willem de Bruijn
getsockopt
PACKET_STATISTICSreturnstp_packets+tp_drops. Commitee80fbf301("packet: account statistics only intpacket_stats_u") cleaned up the getsockoptPACKET_STATISTICScode.
This also changed semantics. Historically,tp_packetsincludedtp_dropson return. The commit removed the line that addstp_dropsintotp_packets.This patch reinstates the old semantics.
Signed-off-by Willem de Bruijn <[email protected]>
Re: [PATCH net] packet: restore packet statistics tp_packets to include drops
From: Daniel Borkmann <[email protected]>
Date: Mon, 19 Aug 2013 23:11:08 +0200
Quoted 8 lines · Willem de Bruijn
Quoted 7 lines
getsockopt
PACKET_STATISTICSreturnstp_packets+tp_drops. Commitee80fbf301("packet: account statistics only intpacket_stats_u") cleaned up the getsockoptPACKET_STATISTICScode.
This also changed semantics. Historically,tp_packetsincludedtp_dropson return. The commit removed the line that addstp_dropsintotp_packets.
Quoted 5 lines
Quoted 3 lines
This patch reinstates the old semantics.
Signed-off-by Willem de Bruijn <[email protected]>Acked-by Daniel Borkmann <[email protected]>
Applied, thanks.