LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net-next] sock: remove one redundant SKB_FRAG_PAGE_ORDER macro
@ 2021-08-26  2:49 Yunsheng Lin
  2021-08-26  3:30 ` Jason Wang
  2021-08-26 10:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Yunsheng Lin @ 2021-08-26  2:49 UTC (permalink / raw)
  To: davem, kuba
  Cc: linuxarm, mst, jasowang, edumazet, pabeni, fw, aahringo,
	xiangxia.m.yue, yangbo.lu, kvm, virtualization, netdev,
	linux-kernel

Both SKB_FRAG_PAGE_ORDER are defined to the same value in
net/core/sock.c and drivers/vhost/net.c.

Move the SKB_FRAG_PAGE_ORDER definition to net/core/sock.h,
as both net/core/sock.c and drivers/vhost/net.c include it,
and it seems a reasonable file to put the macro.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
---
 drivers/vhost/net.c | 2 --
 include/net/sock.h  | 1 +
 net/core/sock.c     | 1 -
 3 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 6414bd5..3a249ee 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -643,8 +643,6 @@ static bool tx_can_batch(struct vhost_virtqueue *vq, size_t total_len)
 	       !vhost_vq_avail_empty(vq->dev, vq);
 }
 
-#define SKB_FRAG_PAGE_ORDER     get_order(32768)
-
 static bool vhost_net_page_frag_refill(struct vhost_net *net, unsigned int sz,
 				       struct page_frag *pfrag, gfp_t gfp)
 {
diff --git a/include/net/sock.h b/include/net/sock.h
index 95b2577..66a9a90 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2717,6 +2717,7 @@ extern int sysctl_optmem_max;
 extern __u32 sysctl_wmem_default;
 extern __u32 sysctl_rmem_default;
 
+#define SKB_FRAG_PAGE_ORDER	get_order(32768)
 DECLARE_STATIC_KEY_FALSE(net_high_order_alloc_disable_key);
 
 static inline int sk_get_wmem0(const struct sock *sk, const struct proto *proto)
diff --git a/net/core/sock.c b/net/core/sock.c
index 950f1e7..62627e8 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2574,7 +2574,6 @@ static void sk_leave_memory_pressure(struct sock *sk)
 	}
 }
 
-#define SKB_FRAG_PAGE_ORDER	get_order(32768)
 DEFINE_STATIC_KEY_FALSE(net_high_order_alloc_disable_key);
 
 /**
-- 
2.7.4


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

* Re: [PATCH net-next] sock: remove one redundant SKB_FRAG_PAGE_ORDER macro
  2021-08-26  2:49 [PATCH net-next] sock: remove one redundant SKB_FRAG_PAGE_ORDER macro Yunsheng Lin
@ 2021-08-26  3:30 ` Jason Wang
  2021-08-26 10:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Wang @ 2021-08-26  3:30 UTC (permalink / raw)
  To: Yunsheng Lin
  Cc: davem, Jakub Kicinski, linuxarm, mst, Eric Dumazet, pabeni, fw,
	aahringo, Tonghao Zhang, yangbo.lu, kvm, virtualization, netdev,
	linux-kernel

On Thu, Aug 26, 2021 at 10:51 AM Yunsheng Lin <linyunsheng@huawei.com> wrote:
>
> Both SKB_FRAG_PAGE_ORDER are defined to the same value in
> net/core/sock.c and drivers/vhost/net.c.
>
> Move the SKB_FRAG_PAGE_ORDER definition to net/core/sock.h,
> as both net/core/sock.c and drivers/vhost/net.c include it,
> and it seems a reasonable file to put the macro.
>
> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
> ---

Acked-by: Jason Wang <jasowang@redhat.com>

>  drivers/vhost/net.c | 2 --
>  include/net/sock.h  | 1 +
>  net/core/sock.c     | 1 -
>  3 files changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index 6414bd5..3a249ee 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -643,8 +643,6 @@ static bool tx_can_batch(struct vhost_virtqueue *vq, size_t total_len)
>                !vhost_vq_avail_empty(vq->dev, vq);
>  }
>
> -#define SKB_FRAG_PAGE_ORDER     get_order(32768)
> -
>  static bool vhost_net_page_frag_refill(struct vhost_net *net, unsigned int sz,
>                                        struct page_frag *pfrag, gfp_t gfp)
>  {
> diff --git a/include/net/sock.h b/include/net/sock.h
> index 95b2577..66a9a90 100644
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -2717,6 +2717,7 @@ extern int sysctl_optmem_max;
>  extern __u32 sysctl_wmem_default;
>  extern __u32 sysctl_rmem_default;
>
> +#define SKB_FRAG_PAGE_ORDER    get_order(32768)
>  DECLARE_STATIC_KEY_FALSE(net_high_order_alloc_disable_key);
>
>  static inline int sk_get_wmem0(const struct sock *sk, const struct proto *proto)
> diff --git a/net/core/sock.c b/net/core/sock.c
> index 950f1e7..62627e8 100644
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -2574,7 +2574,6 @@ static void sk_leave_memory_pressure(struct sock *sk)
>         }
>  }
>
> -#define SKB_FRAG_PAGE_ORDER    get_order(32768)
>  DEFINE_STATIC_KEY_FALSE(net_high_order_alloc_disable_key);
>
>  /**
> --
> 2.7.4
>


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

* Re: [PATCH net-next] sock: remove one redundant SKB_FRAG_PAGE_ORDER macro
  2021-08-26  2:49 [PATCH net-next] sock: remove one redundant SKB_FRAG_PAGE_ORDER macro Yunsheng Lin
  2021-08-26  3:30 ` Jason Wang
@ 2021-08-26 10:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-26 10:10 UTC (permalink / raw)
  To: Yunsheng Lin
  Cc: davem, kuba, linuxarm, mst, jasowang, edumazet, pabeni, fw,
	aahringo, xiangxia.m.yue, yangbo.lu, kvm, virtualization, netdev,
	linux-kernel

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Thu, 26 Aug 2021 10:49:47 +0800 you wrote:
> Both SKB_FRAG_PAGE_ORDER are defined to the same value in
> net/core/sock.c and drivers/vhost/net.c.
> 
> Move the SKB_FRAG_PAGE_ORDER definition to net/core/sock.h,
> as both net/core/sock.c and drivers/vhost/net.c include it,
> and it seems a reasonable file to put the macro.
> 
> [...]

Here is the summary with links:
  - [net-next] sock: remove one redundant SKB_FRAG_PAGE_ORDER macro
    https://git.kernel.org/netdev/net-next/c/723783d077e3

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-08-26 10:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26  2:49 [PATCH net-next] sock: remove one redundant SKB_FRAG_PAGE_ORDER macro Yunsheng Lin
2021-08-26  3:30 ` Jason Wang
2021-08-26 10:10 ` patchwork-bot+netdevbpf

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).