bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: remove unused static inlines
@ 2022-01-26 18:54 Jakub Kicinski
  2022-01-27  5:15 ` John Fastabend
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2022-01-26 18:54 UTC (permalink / raw)
  To: daniel, ast
  Cc: netdev, Jakub Kicinski, andrii, kafai, songliubraving, yhs,
	john.fastabend, kpsingh, jakub, lmb, bjorn, magnus.karlsson,
	jonathan.lemon, hawk, bpf

Remove two dead stubs, sk_msg_clear_meta() was never
used, use of xskq_cons_is_full() got replaced by
xsk_tx_writeable() in v5.10.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: ast@kernel.org
CC: daniel@iogearbox.net
CC: andrii@kernel.org
CC: kafai@fb.com
CC: songliubraving@fb.com
CC: yhs@fb.com
CC: john.fastabend@gmail.com
CC: kpsingh@kernel.org
CC: jakub@cloudflare.com
CC: lmb@cloudflare.com
CC: bjorn@kernel.org
CC: magnus.karlsson@intel.com
CC: jonathan.lemon@gmail.com
CC: hawk@kernel.org
CC: bpf@vger.kernel.org
---
 include/linux/bpf.h   | 10 ----------
 include/linux/skmsg.h |  5 -----
 net/xdp/xsk_queue.h   |  7 -------
 3 files changed, 22 deletions(-)

diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 8c92c974bd12..652b29763423 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1875,11 +1875,6 @@ static inline int bpf_obj_get_user(const char __user *pathname, int flags)
 	return -EOPNOTSUPP;
 }
 
-static inline bool dev_map_can_have_prog(struct bpf_map *map)
-{
-	return false;
-}
-
 static inline void __dev_flush(void)
 {
 }
@@ -1943,11 +1938,6 @@ static inline int cpu_map_generic_redirect(struct bpf_cpu_map_entry *rcpu,
 	return -EOPNOTSUPP;
 }
 
-static inline bool cpu_map_prog_allowed(struct bpf_map *map)
-{
-	return false;
-}
-
 static inline struct bpf_prog *bpf_prog_get_type_path(const char *name,
 				enum bpf_prog_type type)
 {
diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h
index 18a717fe62eb..ddde5f620901 100644
--- a/include/linux/skmsg.h
+++ b/include/linux/skmsg.h
@@ -171,11 +171,6 @@ static inline u32 sk_msg_iter_dist(u32 start, u32 end)
 #define sk_msg_iter_next(msg, which)			\
 	sk_msg_iter_var_next(msg->sg.which)
 
-static inline void sk_msg_clear_meta(struct sk_msg *msg)
-{
-	memset(&msg->sg, 0, offsetofend(struct sk_msg_sg, copy));
-}
-
 static inline void sk_msg_init(struct sk_msg *msg)
 {
 	BUILD_BUG_ON(ARRAY_SIZE(msg->sg.data) - 1 != NR_MSG_FRAG_IDS);
diff --git a/net/xdp/xsk_queue.h b/net/xdp/xsk_queue.h
index e9aa2c236356..79be3e53ddf1 100644
--- a/net/xdp/xsk_queue.h
+++ b/net/xdp/xsk_queue.h
@@ -304,13 +304,6 @@ static inline void xskq_cons_release_n(struct xsk_queue *q, u32 cnt)
 	q->cached_cons += cnt;
 }
 
-static inline bool xskq_cons_is_full(struct xsk_queue *q)
-{
-	/* No barriers needed since data is not accessed */
-	return READ_ONCE(q->ring->producer) - READ_ONCE(q->ring->consumer) ==
-		q->nentries;
-}
-
 static inline u32 xskq_cons_present_entries(struct xsk_queue *q)
 {
 	/* No barriers needed since data is not accessed */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH bpf-next] bpf: remove unused static inlines
  2022-01-26 18:54 [PATCH bpf-next] bpf: remove unused static inlines Jakub Kicinski
@ 2022-01-27  5:15 ` John Fastabend
  2022-01-27  5:22   ` Alexei Starovoitov
  0 siblings, 1 reply; 4+ messages in thread
From: John Fastabend @ 2022-01-27  5:15 UTC (permalink / raw)
  To: Jakub Kicinski, daniel, ast
  Cc: netdev, Jakub Kicinski, andrii, kafai, songliubraving, yhs,
	john.fastabend, kpsingh, jakub, lmb, bjorn, magnus.karlsson,
	jonathan.lemon, hawk, bpf

Jakub Kicinski wrote:
> Remove two dead stubs, sk_msg_clear_meta() was never
> used, use of xskq_cons_is_full() got replaced by
> xsk_tx_writeable() in v5.10.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---

Acked-by: John Fastabend <john.fastabend@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next] bpf: remove unused static inlines
  2022-01-27  5:15 ` John Fastabend
@ 2022-01-27  5:22   ` Alexei Starovoitov
  2022-01-27 16:25     ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: Alexei Starovoitov @ 2022-01-27  5:22 UTC (permalink / raw)
  To: John Fastabend
  Cc: Jakub Kicinski, Daniel Borkmann, Alexei Starovoitov,
	Network Development, Andrii Nakryiko, Martin KaFai Lau, Song Liu,
	Yonghong Song, KP Singh, Jakub Sitnicki, Lorenz Bauer,
	Björn Töpel, Karlsson, Magnus, Jonathan Lemon,
	Jesper Dangaard Brouer, bpf

On Wed, Jan 26, 2022 at 9:15 PM John Fastabend <john.fastabend@gmail.com> wrote:
>
> Jakub Kicinski wrote:
> > Remove two dead stubs, sk_msg_clear_meta() was never
> > used, use of xskq_cons_is_full() got replaced by
> > xsk_tx_writeable() in v5.10.
> >
> > Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> > ---
>
> Acked-by: John Fastabend <john.fastabend@gmail.com>

Applied.
How did you find them?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next] bpf: remove unused static inlines
  2022-01-27  5:22   ` Alexei Starovoitov
@ 2022-01-27 16:25     ` Jakub Kicinski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2022-01-27 16:25 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: John Fastabend, Daniel Borkmann, Alexei Starovoitov,
	Network Development, Andrii Nakryiko, Martin KaFai Lau, Song Liu,
	Yonghong Song, KP Singh, Jakub Sitnicki, Lorenz Bauer,
	Björn Töpel, Karlsson, Magnus, Jonathan Lemon,
	Jesper Dangaard Brouer, bpf

On Wed, 26 Jan 2022 21:22:03 -0800 Alexei Starovoitov wrote:
> On Wed, Jan 26, 2022 at 9:15 PM John Fastabend <john.fastabend@gmail.com> wrote:
> >
> > Jakub Kicinski wrote:  
> > > Remove two dead stubs, sk_msg_clear_meta() was never
> > > used, use of xskq_cons_is_full() got replaced by
> > > xsk_tx_writeable() in v5.10.
> > >
> > > Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> > > ---  
> >
> > Acked-by: John Fastabend <john.fastabend@gmail.com>  
> 
> Applied.
> How did you find them?

regex and some bash:

for f in $(sed -n '/static inline [^(]*$/N;s@static inline.*[^_a-z0-9A-Z]\([_a-z0-9A-Z]*\)([a-z_].*@\1@p' $(find include/ -type f) ); do cnt=$(git grep $f | wc -l); [ $cnt -le 1 ] && echo $f >> single; done

takes too long to run to put it in a CI directly, unfortunately, 
more intelligence would be needed. Luckily there isn't that many
instances throughout netdev and bpf so perhaps not even worth 
the hassle.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-27 16:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 18:54 [PATCH bpf-next] bpf: remove unused static inlines Jakub Kicinski
2022-01-27  5:15 ` John Fastabend
2022-01-27  5:22   ` Alexei Starovoitov
2022-01-27 16:25     ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).