aboutsummaryrefslogtreecommitdiff
path: root/net/packet/internal.h
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2012-08-16 05:36:48 +0000
committerDavid S. Miller <davem@davemloft.net>2012-08-20 02:23:14 -0700
commitfff3321d75b1a18231876a1aceb36eacbbf6221e (patch)
treeff7d423fae980191ed922038ce5e1d0a05e19fab /net/packet/internal.h
parent16f01365fa01150bf3606fe702a80a03ec87953a (diff)
downloadlinux-fff3321d75b1a18231876a1aceb36eacbbf6221e.tar.gz
packet: Report fanout status via diag engine
Reported value is the same reported by the FANOUT getsockoption, but unlike it, the absent fanout setup results in absent nlattr, rather than in nlattr with zero value. This is done so, since zero fanout report may mean both -- no fanout, and fanout with both id and type zero. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet/internal.h')
-rw-r--r--net/packet/internal.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/net/packet/internal.h b/net/packet/internal.h
index 2c5fca28b24..44945f6b725 100644
--- a/net/packet/internal.h
+++ b/net/packet/internal.h
@@ -67,7 +67,25 @@ struct packet_ring_buffer {
atomic_t pending;
};
-struct packet_fanout;
+extern struct mutex fanout_mutex;
+#define PACKET_FANOUT_MAX 256
+
+struct packet_fanout {
+#ifdef CONFIG_NET_NS
+ struct net *net;
+#endif
+ unsigned int num_members;
+ u16 id;
+ u8 type;
+ u8 defrag;
+ atomic_t rr_cur;
+ struct list_head list;
+ struct sock *arr[PACKET_FANOUT_MAX];
+ spinlock_t lock;
+ atomic_t sk_ref;
+ struct packet_type prot_hook ____cacheline_aligned_in_smp;
+};
+
struct packet_sock {
/* struct sock has to be the first member of packet_sock */
struct sock sk;