Message ID | 20220218083133.18031-2-imagedong@tencent.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: add skb drop reasons to TCP packet receive | expand |
On Fri, 18 Feb 2022 16:31:25 +0800 menglong8.dong@gmail.com wrote: > +static inline void tcp_drop(struct sock *sk, struct sk_buff *skb) The patches are marked as changes requested in patchwork. I presume Dave also thinks this static inline is best avoided. Is this function really not getting inlined? Otherwise please repost with the inline keyword removed. > +{ > + tcp_drop_reason(sk, skb, SKB_DROP_REASON_NOT_SPECIFIED); > }
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index af94a6d22a9d..0a2740add404 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -4684,10 +4684,16 @@ static bool tcp_ooo_try_coalesce(struct sock *sk, return res; } -static void tcp_drop(struct sock *sk, struct sk_buff *skb) +static void tcp_drop_reason(struct sock *sk, struct sk_buff *skb, + enum skb_drop_reason reason) { sk_drops_add(sk, skb); - __kfree_skb(skb); + kfree_skb_reason(skb, reason); +} + +static inline void tcp_drop(struct sock *sk, struct sk_buff *skb) +{ + tcp_drop_reason(sk, skb, SKB_DROP_REASON_NOT_SPECIFIED); } /* This one checks to see if we can put data from the