summaryrefslogtreecommitdiff
path: root/include/net/sock_reuseport.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sock_reuseport.h')
-rw-r--r--include/net/sock_reuseport.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/sock_reuseport.h b/include/net/sock_reuseport.h
index 6bef7a0052f2..e1a7681856f7 100644
--- a/include/net/sock_reuseport.h
+++ b/include/net/sock_reuseport.h
@@ -5,8 +5,11 @@
#include <linux/filter.h>
#include <linux/skbuff.h>
#include <linux/types.h>
+#include <linux/spinlock.h>
#include <net/sock.h>
+extern spinlock_t reuseport_lock;
+
struct sock_reuseport {
struct rcu_head rcu;
@@ -16,6 +19,8 @@ struct sock_reuseport {
* reuse->socks[] group.
*/
unsigned int synq_overflow_ts;
+ /* ID stays the same even after the size of socks[] grows. */
+ unsigned int reuseport_id;
struct bpf_prog __rcu *prog; /* optional BPF sock selector */
struct sock *socks[0]; /* array of sock pointers */
};
@@ -29,5 +34,6 @@ extern struct sock *reuseport_select_sock(struct sock *sk,
int hdr_len);
extern struct bpf_prog *reuseport_attach_prog(struct sock *sk,
struct bpf_prog *prog);
+int reuseport_get_id(struct sock_reuseport *reuse);
#endif /* _SOCK_REUSEPORT_H */