Skip to content

Commit 7865dfb

Browse files
jrfastabMartin KaFai Lau
authored andcommitted
bpf: sockmap, added comments describing update proto rules
Add a comment describing that the psock update proto callbback can be called multiple times and this must be safe. Signed-off-by: John Fastabend <[email protected]> Signed-off-by: Martin KaFai Lau <[email protected]> Reviewed-by: Jakub Sitnicki <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 16b2f26 commit 7865dfb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/linux/skmsg.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ struct sk_psock {
100100
void (*saved_close)(struct sock *sk, long timeout);
101101
void (*saved_write_space)(struct sock *sk);
102102
void (*saved_data_ready)(struct sock *sk);
103+
/* psock_update_sk_prot may be called with restore=false many times
104+
* so the handler must be safe for this case. It will be called
105+
* exactly once with restore=true when the psock is being destroyed
106+
* and psock refcnt is zero, but before an RCU grace period.
107+
*/
103108
int (*psock_update_sk_prot)(struct sock *sk, struct sk_psock *psock,
104109
bool restore);
105110
struct proto *sk_proto;

0 commit comments

Comments
 (0)