Merge tag 'sched_urgent_for_v5.16_rc1' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / include / net / tcp.h
index 70972f3..4da22b4 100644 (file)
@@ -293,7 +293,10 @@ static inline bool tcp_out_of_memory(struct sock *sk)
 static inline void tcp_wmem_free_skb(struct sock *sk, struct sk_buff *skb)
 {
        sk_wmem_queued_add(sk, -skb->truesize);
-       sk_mem_uncharge(sk, skb->truesize);
+       if (!skb_zcopy_pure(skb))
+               sk_mem_uncharge(sk, skb->truesize);
+       else
+               sk_mem_uncharge(sk, SKB_TRUESIZE(skb_end_offset(skb)));
        __kfree_skb(skb);
 }
 
@@ -974,7 +977,8 @@ static inline bool tcp_skb_can_collapse(const struct sk_buff *to,
                                        const struct sk_buff *from)
 {
        return likely(tcp_skb_can_collapse_to(to) &&
-                     mptcp_skb_can_collapse(to, from));
+                     mptcp_skb_can_collapse(to, from) &&
+                     skb_pure_zcopy_same(to, from));
 }
 
 /* Events passed to congestion control interface */