aboutsummaryrefslogtreecommitdiffstats
path: root/net/packet/internal.h
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-04-19 02:12:29 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-25 01:29:43 -0400
commitee80fbf301adac644d0c9465194a7ec87bcd4a07 (patch)
treeac14fe920736575c7f8c39ed912201c6143fe501 /net/packet/internal.h
parent0578edc5604e3e192980f406f9e1040aa6434ca4 (diff)
packet: account statistics only in tpacket_stats_u
Currently, packet_sock has a struct tpacket_stats stats member for TPACKET_V1 and TPACKET_V2 statistic accounting, and with TPACKET_V3 ``union tpacket_stats_u stats_u'' was introduced, where however only statistics for TPACKET_V3 are held, and when copied to user space, TPACKET_V3 does some hackery and access also tpacket_stats' stats, although everything could have been done within the union itself. Unify accounting within the tpacket_stats_u union so that we can remove 8 bytes from packet_sock that are there unnecessary. Note that even if we switch to TPACKET_V3 and would use non mmap(2)ed option, this still works due to the union with same types + offsets, that are exposed to the user space. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet/internal.h')
-rw-r--r--net/packet/internal.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/packet/internal.h b/net/packet/internal.h
index 650751b9a7ee..c4e4b4561207 100644
--- a/net/packet/internal.h
+++ b/net/packet/internal.h
@@ -93,8 +93,7 @@ struct packet_sock {
93 /* struct sock has to be the first member of packet_sock */ 93 /* struct sock has to be the first member of packet_sock */
94 struct sock sk; 94 struct sock sk;
95 struct packet_fanout *fanout; 95 struct packet_fanout *fanout;
96 struct tpacket_stats stats; 96 union tpacket_stats_u stats;
97 union tpacket_stats_u stats_u;
98 struct packet_ring_buffer rx_ring; 97 struct packet_ring_buffer rx_ring;
99 struct packet_ring_buffer tx_ring; 98 struct packet_ring_buffer tx_ring;
100 int copy_thresh; 99 int copy_thresh;