]> git.itanic.dy.fi Git - linux-stable/commitdiff
sock: remove one redundant SKB_FRAG_PAGE_ORDER macro
authorYunsheng Lin <linyunsheng@huawei.com>
Thu, 26 Aug 2021 02:49:47 +0000 (10:49 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Aug 2021 09:46:20 +0000 (10:46 +0100)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/vhost/net.c
include/net/sock.h
net/core/sock.c

index 6414bd5741b877e898ae962e94832f80277fa394..3a249ee7e14401d0f7459f8c401e2f9aebdce201 100644 (file)
@@ -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)
 {
index 95b25777b53ec8a3e0bb82532193b5237b80d511..66a9a90f9558e4c739e01192b3f8cee9fa271ae9 100644 (file)
@@ -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)
index 950f1e70dbf5d5c231bb70b706aecc0f35e0a495..62627e868e03603a5aff99a0dfc7c99c6a4457e2 100644 (file)
@@ -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);
 
 /**