hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/net/packet/internal.h
....@@ -39,7 +39,7 @@
3939 char *nxt_offset;
4040 struct sk_buff *skb;
4141
42
- atomic_t blk_fill_in_prog;
42
+ rwlock_t blk_fill_in_prog_lock;
4343
4444 /* Default is set to 8ms */
4545 #define DEFAULT_PRB_RETIRE_TOV (8)
....@@ -77,11 +77,12 @@
7777 };
7878
7979 extern struct mutex fanout_mutex;
80
-#define PACKET_FANOUT_MAX 256
80
+#define PACKET_FANOUT_MAX (1 << 16)
8181
8282 struct packet_fanout {
8383 possible_net_t net;
8484 unsigned int num_members;
85
+ u32 max_num_members;
8586 u16 id;
8687 u8 type;
8788 u8 flags;
....@@ -90,10 +91,10 @@
9091 struct bpf_prog __rcu *bpf_prog;
9192 };
9293 struct list_head list;
93
- struct sock *arr[PACKET_FANOUT_MAX];
9494 spinlock_t lock;
9595 refcount_t sk_ref;
9696 struct packet_type prot_hook ____cacheline_aligned_in_smp;
97
+ struct sock __rcu *arr[];
9798 };
9899
99100 struct packet_rollover {
....@@ -135,6 +136,7 @@
135136 struct net_device __rcu *cached_dev;
136137 int (*xmit)(struct sk_buff *skb);
137138 struct packet_type prot_hook ____cacheline_aligned_in_smp;
139
+ atomic_t tp_drops ____cacheline_aligned_in_smp;
138140 };
139141
140142 static struct packet_sock *pkt_sk(struct sock *sk)