Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2104575pxb; Mon, 23 Aug 2021 12:08:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3K79zjo4qEyZ2A0GnnlzCTE1Jf+HSJZbnWmyDqq4u4V6CHfagp2DxNxEgThuwk3dy8ob6 X-Received: by 2002:a92:6e12:: with SMTP id j18mr24940893ilc.243.1629745690410; Mon, 23 Aug 2021 12:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629745690; cv=none; d=google.com; s=arc-20160816; b=o9pmnYDtKxmS2RlUJKQ02UR2YpdhFML5xycAObHEiQhnwahjp+7TWPWTZAce89E3tE Pues47bV9zohEasNzg/5+RAeohuJ4es7k61miPDbHd430UEYMmNsoi4l1cAxO9QnMXLY wjjLn2dBhRJ3dByKdLISTn4TxYkpCxjBz91U1TY9cyT96vBGk4kJ5j6yg7JAy5G2/bz1 8/qdtqDEzZNSj9i9gp4U9DvRBcoELCC+5m15+crB95gC1a4EogLejkJiRCUaUzFPC5yF YYyziUcmcu8hZebS+iNZYU1TKJ739XaDHGDdIEavPhVvjt+7/Dpb3oLsEj/ScqsL5wAQ N7Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=OK5raMfr4HWbmDE1X5alE45vtZr48DaZU6LTzAH7JtU=; b=HQdvngTZJm4qsP5LW3d3r7HQ3TSd1gnlag/3P7/DiWbnDYFikRiMnMg8JedXw8ejlH hWlYn5uJ5p2GTrHN9uVBitMbsUMiVdSLgU9ZwfkLV8l5NYWntn5qV0V+iM5zbfQIDl2b yQw4IiB59F3fBcKmRIMarKNpEMdiYpdXfVQnt4e30oxnIVUgjsB1trsc0x+cxfFgg7eY u76ZYl6RWb8/GZrGXBZAtMhkzvBGCfQ7txUONROVxX1YuYqh8VIUPHn5zVpXNQ1I6Szz +mOlQiGzsCkEn/VwzzB0mUp7+GtrBE5VaOPEeDvvrp1o2VPbjA5qTtQB9WfsrBi4PWCN NRCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iqIWOR6B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si17007328jaj.45.2021.08.23.12.07.54; Mon, 23 Aug 2021 12:08:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iqIWOR6B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231151AbhHWTHy (ORCPT + 99 others); Mon, 23 Aug 2021 15:07:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230192AbhHWTHy (ORCPT ); Mon, 23 Aug 2021 15:07:54 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62FB3C061575; Mon, 23 Aug 2021 12:07:11 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id x15so1310458plg.10; Mon, 23 Aug 2021 12:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OK5raMfr4HWbmDE1X5alE45vtZr48DaZU6LTzAH7JtU=; b=iqIWOR6BDMZuOi0JHMrPDX6DiluhbvEKUasTEz90yLmPQp5J1CBmPFVtC9S9KGH2mi dNarP1bkbZ9E+pbT5dlX/tp3N61HX8etofXbNKJ+Ce3SC4OQXH8pkhTr6j/KhGxclmeW EM2Xyv3iEUFu0Wy/UOxaqzjxaWr8GUdAvBdyBbvOUyrhnPQK3DOJ3LPBab9+tTdH+Drd gygQ1DyxQPYo5hoHAOsaPF8L8esf65ffbPtLuHL/JT67IS3GID12tEZcaGG1eE4ahbpH 7nYp7L3pjKd5PPY3ojlTwI6K6eN8VZas6H0UjbKIt4fRKCLpHbKxrkNokuFlikpbVvQI 5S8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OK5raMfr4HWbmDE1X5alE45vtZr48DaZU6LTzAH7JtU=; b=PQhUgSZyr+Kbkj+hgtFds+QlGPCkBheP3Jy/jIL9x4glLtunq+8Vm0Z5/OsZmuNE4Y uC7IdAZB5KjxattrhIE5AkVk8SB4ldPJW/bGM42TbjpC9NxfYlW9S0KI4Bz8RPiSztph CTETPC2URK/LF5kso12L2irgQwGnhraPlczNNDOvLzes/jWVH+FCoJYu/FZVMTctW2r+ wv9OQEEluWegSxnzt566ODBlorr2qMEfsHAb5Q1eyhNa1EKngHc80v4ejZ2oh+eLuThI ydzB6BEOIsXn3IfxgbmdHI4d/MfbwenmL/7Fg9om66xeirpRxJW+JdA5g9xRsMP7U/xT dNjg== X-Gm-Message-State: AOAM530Tm1yH53YgIZvIAn/EnDXWI6ml46sZer7yUXzAe10lqv7dzICe RP+5jDy+wDxNNNKOqIGw1EnnxMRoI4zCvxHlEQE= X-Received: by 2002:a17:90a:a091:: with SMTP id r17mr85122pjp.56.1629745630840; Mon, 23 Aug 2021 12:07:10 -0700 (PDT) MIME-Version: 1.0 References: <20210821155327.251284-1-yan2228598786@gmail.com> In-Reply-To: <20210821155327.251284-1-yan2228598786@gmail.com> From: Cong Wang Date: Mon, 23 Aug 2021 12:06:59 -0700 Message-ID: Subject: Re: [PATCH] net/mlx4: tcp_drop replace of tcp_drop_new To: jony-one Cc: Jakub Kicinski , Eric Dumazet , Steven Rostedt , Ingo Molnar , David Miller , Hideaki YOSHIFUJI , dsahern@kernel.org, Linux Kernel Network Developers , LKML , hengqi.chen@gmail.com, Yonghong Song Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 21, 2021 at 8:55 AM jony-one wrote: > @@ -4676,7 +4683,7 @@ static void tcp_ofo_queue(struct sock *sk) > rb_erase(&skb->rbnode, &tp->out_of_order_queue); > > if (unlikely(!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt))) { > - tcp_drop(sk, skb); > + tcp_drop_new(sk, skb, __func__); This is very similar to race_kfree_skb(): void kfree_skb(struct sk_buff *skb) { if (!skb_unref(skb)) return; trace_kfree_skb(skb, __builtin_return_address(0)); __kfree_skb(skb); } So... why not something like this? iff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 3f7bd7ae7d7a..cc840e4552c9 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -4678,6 +4678,7 @@ static bool tcp_ooo_try_coalesce(struct sock *sk, static void tcp_drop(struct sock *sk, struct sk_buff *skb) { sk_drops_add(sk, skb); + trace_kfree_skb(skb, __builtin_return_address(0)); __kfree_skb(skb); } Thanks.