Message ID | 20230330151758.531170-3-aditi.ghag@isovalent.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | BPF |
Headers | show |
Series | bpf: Add socket destroy capability | expand |
On 3/30/23 8:17 AM, Aditi Ghag wrote: > This is a preparatory commit to remove the field. The field was > previously shared between proc fs and BPF UDP socket iterators. As the > follow-up commits will decouple the implementation for the iterators, > remove the field. As for BPF socket iterator, filtering of sockets is > exepected to be done in BPF programs. > > Suggested-by: Martin KaFai Lau <martin.lau@kernel.org> > Signed-off-by: Aditi Ghag <aditi.ghag@isovalent.com> > --- > include/net/udp.h | 1 - > net/ipv4/udp.c | 15 +++------------ > 2 files changed, 3 insertions(+), 13 deletions(-) > > diff --git a/include/net/udp.h b/include/net/udp.h > index de4b528522bb..5cad44318d71 100644 > --- a/include/net/udp.h > +++ b/include/net/udp.h > @@ -437,7 +437,6 @@ struct udp_seq_afinfo { > struct udp_iter_state { > struct seq_net_private p; > int bucket; > - struct udp_seq_afinfo *bpf_seq_afinfo; This patch does not compile because the remaining st->bpf_seq_afinfo usages are only removed in a later patch 4. https://patchwork.hopto.org/static/nipa/735459/13194325/build_clang/stderr Mostly a heads up. No need to re-spin now. Review can be continued on this revision.
diff --git a/include/net/udp.h b/include/net/udp.h index de4b528522bb..5cad44318d71 100644 --- a/include/net/udp.h +++ b/include/net/udp.h @@ -437,7 +437,6 @@ struct udp_seq_afinfo { struct udp_iter_state { struct seq_net_private p; int bucket; - struct udp_seq_afinfo *bpf_seq_afinfo; }; void *udp_seq_start(struct seq_file *seq, loff_t *pos); diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index c605d171eb2d..c574c8c17ec9 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -2997,10 +2997,7 @@ static struct sock *udp_get_first(struct seq_file *seq, int start) struct udp_table *udptable; struct sock *sk; - if (state->bpf_seq_afinfo) - afinfo = state->bpf_seq_afinfo; - else - afinfo = pde_data(file_inode(seq->file)); + afinfo = pde_data(file_inode(seq->file)); udptable = udp_get_table_afinfo(afinfo, net); @@ -3033,10 +3030,7 @@ static struct sock *udp_get_next(struct seq_file *seq, struct sock *sk) struct udp_seq_afinfo *afinfo; struct udp_table *udptable; - if (state->bpf_seq_afinfo) - afinfo = state->bpf_seq_afinfo; - else - afinfo = pde_data(file_inode(seq->file)); + afinfo = pde_data(file_inode(seq->file)); do { sk = sk_next(sk); @@ -3094,10 +3088,7 @@ void udp_seq_stop(struct seq_file *seq, void *v) struct udp_seq_afinfo *afinfo; struct udp_table *udptable; - if (state->bpf_seq_afinfo) - afinfo = state->bpf_seq_afinfo; - else - afinfo = pde_data(file_inode(seq->file)); + afinfo = pde_data(file_inode(seq->file)); udptable = udp_get_table_afinfo(afinfo, seq_file_net(seq));
This is a preparatory commit to remove the field. The field was previously shared between proc fs and BPF UDP socket iterators. As the follow-up commits will decouple the implementation for the iterators, remove the field. As for BPF socket iterator, filtering of sockets is exepected to be done in BPF programs. Suggested-by: Martin KaFai Lau <martin.lau@kernel.org> Signed-off-by: Aditi Ghag <aditi.ghag@isovalent.com> --- include/net/udp.h | 1 - net/ipv4/udp.c | 15 +++------------ 2 files changed, 3 insertions(+), 13 deletions(-)