summaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-23 03:21:15 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-23 03:21:15 -0400
commit58ee01007c9e00531c1280b2d99b49d29a5e9844 (patch)
treed1feb7102591a811b4458e2e209d476580ae3687 /include/net/sock.h
parent4850f26abfcac9ed28a4db5817b46dc0bfbbbae0 (diff)
parent4b972a01a7da614b4796475f933094751a295a2f (diff)
Merge 5.2-rc6 into usb-next
We need the USB fixes in here too. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index e9d769c04637..6cbc16136357 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1463,12 +1463,14 @@ static inline void sk_mem_uncharge(struct sock *sk, int size)
1463 __sk_mem_reclaim(sk, 1 << 20); 1463 __sk_mem_reclaim(sk, 1 << 20);
1464} 1464}
1465 1465
1466DECLARE_STATIC_KEY_FALSE(tcp_tx_skb_cache_key);
1466static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb) 1467static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb)
1467{ 1468{
1468 sock_set_flag(sk, SOCK_QUEUE_SHRUNK); 1469 sock_set_flag(sk, SOCK_QUEUE_SHRUNK);
1469 sk->sk_wmem_queued -= skb->truesize; 1470 sk->sk_wmem_queued -= skb->truesize;
1470 sk_mem_uncharge(sk, skb->truesize); 1471 sk_mem_uncharge(sk, skb->truesize);
1471 if (!sk->sk_tx_skb_cache && !skb_cloned(skb)) { 1472 if (static_branch_unlikely(&tcp_tx_skb_cache_key) &&
1473 !sk->sk_tx_skb_cache && !skb_cloned(skb)) {
1472 skb_zcopy_clear(skb, true); 1474 skb_zcopy_clear(skb, true);
1473 sk->sk_tx_skb_cache = skb; 1475 sk->sk_tx_skb_cache = skb;
1474 return; 1476 return;
@@ -2433,13 +2435,11 @@ static inline void skb_setup_tx_timestamp(struct sk_buff *skb, __u16 tsflags)
2433 * This routine must be called with interrupts disabled or with the socket 2435 * This routine must be called with interrupts disabled or with the socket
2434 * locked so that the sk_buff queue operation is ok. 2436 * locked so that the sk_buff queue operation is ok.
2435*/ 2437*/
2438DECLARE_STATIC_KEY_FALSE(tcp_rx_skb_cache_key);
2436static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb) 2439static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb)
2437{ 2440{
2438 __skb_unlink(skb, &sk->sk_receive_queue); 2441 __skb_unlink(skb, &sk->sk_receive_queue);
2439 if ( 2442 if (static_branch_unlikely(&tcp_rx_skb_cache_key) &&
2440#ifdef CONFIG_RPS
2441 !static_branch_unlikely(&rps_needed) &&
2442#endif
2443 !sk->sk_rx_skb_cache) { 2443 !sk->sk_rx_skb_cache) {
2444 sk->sk_rx_skb_cache = skb; 2444 sk->sk_rx_skb_cache = skb;
2445 skb_orphan(skb); 2445 skb_orphan(skb);
@@ -2534,6 +2534,8 @@ extern int sysctl_optmem_max;
2534extern __u32 sysctl_wmem_default; 2534extern __u32 sysctl_wmem_default;
2535extern __u32 sysctl_rmem_default; 2535extern __u32 sysctl_rmem_default;
2536 2536
2537DECLARE_STATIC_KEY_FALSE(net_high_order_alloc_disable_key);
2538
2537static inline int sk_get_wmem0(const struct sock *sk, const struct proto *proto) 2539static inline int sk_get_wmem0(const struct sock *sk, const struct proto *proto)
2538{ 2540{
2539 /* Does this proto have per netns sysctl_wmem ? */ 2541 /* Does this proto have per netns sysctl_wmem ? */