.. | .. |
---|
39 | 39 | char *nxt_offset; |
---|
40 | 40 | struct sk_buff *skb; |
---|
41 | 41 | |
---|
42 | | - atomic_t blk_fill_in_prog; |
---|
| 42 | + rwlock_t blk_fill_in_prog_lock; |
---|
43 | 43 | |
---|
44 | 44 | /* Default is set to 8ms */ |
---|
45 | 45 | #define DEFAULT_PRB_RETIRE_TOV (8) |
---|
.. | .. |
---|
77 | 77 | }; |
---|
78 | 78 | |
---|
79 | 79 | extern struct mutex fanout_mutex; |
---|
80 | | -#define PACKET_FANOUT_MAX 256 |
---|
| 80 | +#define PACKET_FANOUT_MAX (1 << 16) |
---|
81 | 81 | |
---|
82 | 82 | struct packet_fanout { |
---|
83 | 83 | possible_net_t net; |
---|
84 | 84 | unsigned int num_members; |
---|
| 85 | + u32 max_num_members; |
---|
85 | 86 | u16 id; |
---|
86 | 87 | u8 type; |
---|
87 | 88 | u8 flags; |
---|
.. | .. |
---|
90 | 91 | struct bpf_prog __rcu *bpf_prog; |
---|
91 | 92 | }; |
---|
92 | 93 | struct list_head list; |
---|
93 | | - struct sock *arr[PACKET_FANOUT_MAX]; |
---|
94 | 94 | spinlock_t lock; |
---|
95 | 95 | refcount_t sk_ref; |
---|
96 | 96 | struct packet_type prot_hook ____cacheline_aligned_in_smp; |
---|
| 97 | + struct sock __rcu *arr[]; |
---|
97 | 98 | }; |
---|
98 | 99 | |
---|
99 | 100 | struct packet_rollover { |
---|
.. | .. |
---|
115 | 116 | int copy_thresh; |
---|
116 | 117 | spinlock_t bind_lock; |
---|
117 | 118 | struct mutex pg_vec_lock; |
---|
| 119 | + unsigned long flags; |
---|
118 | 120 | unsigned int running; /* bind_lock must be held */ |
---|
119 | | - unsigned int auxdata:1, /* writer must hold sock lock */ |
---|
120 | | - origdev:1, |
---|
121 | | - has_vnet_hdr:1, |
---|
| 121 | + unsigned int has_vnet_hdr:1, /* writer must hold sock lock */ |
---|
122 | 122 | tp_loss:1, |
---|
123 | 123 | tp_tx_has_off:1; |
---|
124 | 124 | int pressure; |
---|
.. | .. |
---|
135 | 135 | struct net_device __rcu *cached_dev; |
---|
136 | 136 | int (*xmit)(struct sk_buff *skb); |
---|
137 | 137 | struct packet_type prot_hook ____cacheline_aligned_in_smp; |
---|
| 138 | + atomic_t tp_drops ____cacheline_aligned_in_smp; |
---|
138 | 139 | }; |
---|
139 | 140 | |
---|
140 | 141 | static struct packet_sock *pkt_sk(struct sock *sk) |
---|
.. | .. |
---|
142 | 143 | return (struct packet_sock *)sk; |
---|
143 | 144 | } |
---|
144 | 145 | |
---|
| 146 | +enum packet_sock_flags { |
---|
| 147 | + PACKET_SOCK_ORIGDEV, |
---|
| 148 | + PACKET_SOCK_AUXDATA, |
---|
| 149 | +}; |
---|
| 150 | + |
---|
| 151 | +static inline void packet_sock_flag_set(struct packet_sock *po, |
---|
| 152 | + enum packet_sock_flags flag, |
---|
| 153 | + bool val) |
---|
| 154 | +{ |
---|
| 155 | + if (val) |
---|
| 156 | + set_bit(flag, &po->flags); |
---|
| 157 | + else |
---|
| 158 | + clear_bit(flag, &po->flags); |
---|
| 159 | +} |
---|
| 160 | + |
---|
| 161 | +static inline bool packet_sock_flag(const struct packet_sock *po, |
---|
| 162 | + enum packet_sock_flags flag) |
---|
| 163 | +{ |
---|
| 164 | + return test_bit(flag, &po->flags); |
---|
| 165 | +} |
---|
| 166 | + |
---|
145 | 167 | #endif |
---|