Skip to content

Commit 723783d

Browse files
Yunsheng Lindavem330
authored andcommitted
sock: remove one redundant SKB_FRAG_PAGE_ORDER macro
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 <[email protected]> Acked-by: Jason Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5e8243e commit 723783d

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed

drivers/vhost/net.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,6 @@ static bool tx_can_batch(struct vhost_virtqueue *vq, size_t total_len)
643643
!vhost_vq_avail_empty(vq->dev, vq);
644644
}
645645

646-
#define SKB_FRAG_PAGE_ORDER get_order(32768)
647-
648646
static bool vhost_net_page_frag_refill(struct vhost_net *net, unsigned int sz,
649647
struct page_frag *pfrag, gfp_t gfp)
650648
{

include/net/sock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2717,6 +2717,7 @@ extern int sysctl_optmem_max;
27172717
extern __u32 sysctl_wmem_default;
27182718
extern __u32 sysctl_rmem_default;
27192719

2720+
#define SKB_FRAG_PAGE_ORDER get_order(32768)
27202721
DECLARE_STATIC_KEY_FALSE(net_high_order_alloc_disable_key);
27212722

27222723
static inline int sk_get_wmem0(const struct sock *sk, const struct proto *proto)

net/core/sock.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2574,7 +2574,6 @@ static void sk_leave_memory_pressure(struct sock *sk)
25742574
}
25752575
}
25762576

2577-
#define SKB_FRAG_PAGE_ORDER get_order(32768)
25782577
DEFINE_STATIC_KEY_FALSE(net_high_order_alloc_disable_key);
25792578

25802579
/**

0 commit comments

Comments
 (0)