All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] xdp: Make __mem_id_disconnect static
@ 2019-06-25  2:31 ` YueHaibing
  0 siblings, 0 replies; 6+ messages in thread
From: YueHaibing @ 2019-06-25  2:31 UTC (permalink / raw)
  To: davem, ast, daniel, jakub.kicinski, hawk, john.fastabend
  Cc: linux-kernel, netdev, xdp-newbies, bpf, YueHaibing

Fix sparse warning:

net/core/xdp.c:88:6: warning:
 symbol '__mem_id_disconnect' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 net/core/xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/xdp.c b/net/core/xdp.c
index b29d7b5..829377c 100644
--- a/net/core/xdp.c
+++ b/net/core/xdp.c
@@ -85,7 +85,7 @@ static void __xdp_mem_allocator_rcu_free(struct rcu_head *rcu)
 	kfree(xa);
 }
 
-bool __mem_id_disconnect(int id, bool force)
+static bool __mem_id_disconnect(int id, bool force)
 {
 	struct xdp_mem_allocator *xa;
 	bool safe_to_remove = true;
-- 
2.7.4



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

* [PATCH net-next] xdp: Make __mem_id_disconnect static
@ 2019-06-25  2:31 ` YueHaibing
  0 siblings, 0 replies; 6+ messages in thread
From: YueHaibing @ 2019-06-25  2:31 UTC (permalink / raw)
  To: davem, ast, daniel, jakub.kicinski, hawk, john.fastabend
  Cc: linux-kernel, netdev, xdp-newbies, bpf, YueHaibing

Fix sparse warning:

net/core/xdp.c:88:6: warning:
 symbol '__mem_id_disconnect' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 net/core/xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/xdp.c b/net/core/xdp.c
index b29d7b5..829377c 100644
--- a/net/core/xdp.c
+++ b/net/core/xdp.c
@@ -85,7 +85,7 @@ static void __xdp_mem_allocator_rcu_free(struct rcu_head *rcu)
 	kfree(xa);
 }
 
-bool __mem_id_disconnect(int id, bool force)
+static bool __mem_id_disconnect(int id, bool force)
 {
 	struct xdp_mem_allocator *xa;
 	bool safe_to_remove = true;
-- 
2.7.4

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

* Re: [PATCH net-next] xdp: Make __mem_id_disconnect static
  2019-06-25  2:31 ` YueHaibing
@ 2019-06-25  9:21   ` Jesper Dangaard Brouer
  -1 siblings, 0 replies; 6+ messages in thread
From: Jesper Dangaard Brouer @ 2019-06-25  9:21 UTC (permalink / raw)
  To: YueHaibing
  Cc: davem, ast, daniel, jakub.kicinski, john.fastabend, linux-kernel,
	netdev, xdp-newbies, bpf, brouer

On Tue, 25 Jun 2019 10:31:37 +0800
YueHaibing <yuehaibing@huawei.com> wrote:

> Fix sparse warning:
> 
> net/core/xdp.c:88:6: warning:
>  symbol '__mem_id_disconnect' was not declared. Should it be static?

I didn't declare it static as I didn't want it to get inlined.  As
during development I was using kprobes to inspect this function.  In
the end I added a tracepoint in this function as kprobes was not enough
to capture the state needed.

So, I guess we can declare it static.

Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>

> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  net/core/xdp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/xdp.c b/net/core/xdp.c
> index b29d7b5..829377c 100644
> --- a/net/core/xdp.c
> +++ b/net/core/xdp.c
> @@ -85,7 +85,7 @@ static void __xdp_mem_allocator_rcu_free(struct rcu_head *rcu)
>  	kfree(xa);
>  }
>  
> -bool __mem_id_disconnect(int id, bool force)
> +static bool __mem_id_disconnect(int id, bool force)
>  {
>  	struct xdp_mem_allocator *xa;
>  	bool safe_to_remove = true;


-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

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

* Re: [PATCH net-next] xdp: Make __mem_id_disconnect static
@ 2019-06-25  9:21   ` Jesper Dangaard Brouer
  0 siblings, 0 replies; 6+ messages in thread
From: Jesper Dangaard Brouer @ 2019-06-25  9:21 UTC (permalink / raw)
  To: YueHaibing
  Cc: davem, ast, daniel, jakub.kicinski, john.fastabend, linux-kernel,
	netdev, xdp-newbies, bpf, brouer

On Tue, 25 Jun 2019 10:31:37 +0800
YueHaibing <yuehaibing@huawei.com> wrote:

> Fix sparse warning:
> 
> net/core/xdp.c:88:6: warning:
>  symbol '__mem_id_disconnect' was not declared. Should it be static?

I didn't declare it static as I didn't want it to get inlined.  As
during development I was using kprobes to inspect this function.  In
the end I added a tracepoint in this function as kprobes was not enough
to capture the state needed.

So, I guess we can declare it static.

Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>

> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  net/core/xdp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/xdp.c b/net/core/xdp.c
> index b29d7b5..829377c 100644
> --- a/net/core/xdp.c
> +++ b/net/core/xdp.c
> @@ -85,7 +85,7 @@ static void __xdp_mem_allocator_rcu_free(struct rcu_head *rcu)
>  	kfree(xa);
>  }
>  
> -bool __mem_id_disconnect(int id, bool force)
> +static bool __mem_id_disconnect(int id, bool force)
>  {
>  	struct xdp_mem_allocator *xa;
>  	bool safe_to_remove = true;


-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

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

* Re: [PATCH net-next] xdp: Make __mem_id_disconnect static
  2019-06-25  9:21   ` Jesper Dangaard Brouer
  (?)
@ 2019-06-25 22:23   ` Song Liu
  -1 siblings, 0 replies; 6+ messages in thread
From: Song Liu @ 2019-06-25 22:23 UTC (permalink / raw)
  To: Jesper Dangaard Brouer
  Cc: YueHaibing, David S . Miller, Alexei Starovoitov,
	Daniel Borkmann, Jakub Kicinski, John Fastabend, open list,
	Networking, xdp-newbies, bpf

On Tue, Jun 25, 2019 at 4:52 AM Jesper Dangaard Brouer
<brouer@redhat.com> wrote:
>
> On Tue, 25 Jun 2019 10:31:37 +0800
> YueHaibing <yuehaibing@huawei.com> wrote:
>
> > Fix sparse warning:
> >
> > net/core/xdp.c:88:6: warning:
> >  symbol '__mem_id_disconnect' was not declared. Should it be static?
>
> I didn't declare it static as I didn't want it to get inlined.  As
> during development I was using kprobes to inspect this function.  In
> the end I added a tracepoint in this function as kprobes was not enough
> to capture the state needed.
>
> So, I guess we can declare it static.
>
> Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>

I think the rule is, non-static function must be declared in a header.

Acked-by: Song Liu <songliubraving@fb.com>

>
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> > ---
> >  net/core/xdp.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/core/xdp.c b/net/core/xdp.c
> > index b29d7b5..829377c 100644
> > --- a/net/core/xdp.c
> > +++ b/net/core/xdp.c
> > @@ -85,7 +85,7 @@ static void __xdp_mem_allocator_rcu_free(struct rcu_head *rcu)
> >       kfree(xa);
> >  }
> >
> > -bool __mem_id_disconnect(int id, bool force)
> > +static bool __mem_id_disconnect(int id, bool force)
> >  {
> >       struct xdp_mem_allocator *xa;
> >       bool safe_to_remove = true;
>
>
> --
> Best regards,
>   Jesper Dangaard Brouer
>   MSc.CS, Principal Kernel Engineer at Red Hat
>   LinkedIn: http://www.linkedin.com/in/brouer

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

* Re: [PATCH net-next] xdp: Make __mem_id_disconnect static
  2019-06-25  2:31 ` YueHaibing
  (?)
  (?)
@ 2019-06-26 14:33 ` Daniel Borkmann
  -1 siblings, 0 replies; 6+ messages in thread
From: Daniel Borkmann @ 2019-06-26 14:33 UTC (permalink / raw)
  To: YueHaibing, davem, ast, jakub.kicinski, hawk, john.fastabend
  Cc: linux-kernel, netdev, xdp-newbies, bpf

On 06/25/2019 04:31 AM, YueHaibing wrote:
> Fix sparse warning:
> 
> net/core/xdp.c:88:6: warning:
>  symbol '__mem_id_disconnect' was not declared. Should it be static?
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied, thanks!

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

end of thread, other threads:[~2019-06-26 14:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-25  2:31 [PATCH net-next] xdp: Make __mem_id_disconnect static YueHaibing
2019-06-25  2:31 ` YueHaibing
2019-06-25  9:21 ` Jesper Dangaard Brouer
2019-06-25  9:21   ` Jesper Dangaard Brouer
2019-06-25 22:23   ` Song Liu
2019-06-26 14:33 ` Daniel Borkmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.