Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1661009pxb; Wed, 9 Feb 2022 01:30:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWtxkRwMncacRPtVBkuGVjh71JXlEeS7+6mRGnsD58Z0p/EAYWeLOUJVIe6tUI63djlMBM X-Received: by 2002:a05:6a00:1514:: with SMTP id q20mr1320696pfu.82.1644399028419; Wed, 09 Feb 2022 01:30:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644399028; cv=none; d=google.com; s=arc-20160816; b=qCrFUoIuO4AqcVqZA4lSO4OVy5HKi/nPzuR4aYzOObfP5ViNl6okJf684mDCRFz1+R coh1VMm2YNsN7qeAcm/2e991vK4r2rl+SOl7X4A8qkZf9X6OsBJzHS4aXT5aDENY3sYn gIHb/TKDST7UqsXC1+IRh2POr32AMoJDX6ni5l9SUMjf2Kd2IaEc9gIS0LgqFdKhbFWp Ax6VSz3WJeWGlMnbfQCSwF3rStYX8gPNsx2y8BBqlFoGbjyAUbx9yrWnl+uJH7kRcIvK N/wXv7avqneGTtgJ+74sqLfSJVWU8zBUxJTzOwj4R3uGestcJavdHpYE7GXeyz94O0uV sGxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:cc:to:subject:message-id :from:content-transfer-encoding:date:dkim-signature:mime-version; bh=duEdvsmvfL1YUaUj/WhXeBPgED0TQAZfCHM+etVCeio=; b=jMB3VDTtEkf4qsAeYQIr7aPZ4Mb+XGV9EOZv+NJP+sas81nyY3iHdcwERZ7KtBoget wJ77WDHjPYhtyQ5wxG3azUb0i8OQahhVKZY7KCwiJ3bwgCKCkhT4KSk4eN01/daxHolX SgG0xnT4krgRc21I7Wj+Ax5lOp2Lobl3nfvGNsIZtFsiqcGS+7FTHtMpJr5V/0qaAT47 rranNYDvuKQd4/v63qzmrGzhdp3tlhBIXXyKxcEUylkyrpnaabhbzHIAFJ+9LeIYia0+ V4Q/7UdHrYcNXKSDpoRfnt0kGzWnFrOez3su8Kh3i8I/wHOGSStHZOEtfaGuUFn77+sd qYFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=gKRYgH1i; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h2si15132593pgc.39.2022.02.09.01.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 01:30:28 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=gKRYgH1i; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4F671E04A81F; Wed, 9 Feb 2022 00:59:29 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235096AbiBICq5 (ORCPT + 99 others); Tue, 8 Feb 2022 21:46:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244925AbiBICUL (ORCPT ); Tue, 8 Feb 2022 21:20:11 -0500 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D97BC06157B; Tue, 8 Feb 2022 18:20:09 -0800 (PST) MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1644373207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=duEdvsmvfL1YUaUj/WhXeBPgED0TQAZfCHM+etVCeio=; b=gKRYgH1i4qRCdJmIiJSTJULASGNH0ILH45mJ3qZs5pLNrqBE6Jq8bEAF5yMT3z+ZsGPOW+ j0BMVIeZCsfoZOerdHXrmWFsbem5kJ8W0DgmLIWE4zirnrYTXk+FarLHRWmRQW6EtLVGlU RBWNnyPtCnK7Sc51kRBBvARmysww1WA= Date: Wed, 09 Feb 2022 02:20:07 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: yajun.deng@linux.dev Message-ID: <753bb02bfa8c2cf5c08c63c31f193f90@linux.dev> Subject: Re: [PATCH net-next] net: dev: introduce netdev_drop_inc() To: "Jakub Kicinski" Cc: davem@davemloft.net, rostedt@goodmis.org, mingo@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220208162729.41b62ae7@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> References: <20220208162729.41b62ae7@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20220208064318.1075849-1-yajun.deng@linux.dev> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org February 9, 2022 8:27 AM, "Jakub Kicinski" wrote:=0A=0A= > On Tue, 8 Feb 2022 14:43:18 +0800 Yajun Deng wrote:=0A> =0A>> We will u= se 'sudo perf record -g -a -e skb:kfree_skb' command to trace=0A>> the dr= opped packets when dropped increase in the output of ifconfig.=0A>> But t= here are two cases, one is only called kfree_skb(), another is=0A>> incre= asing the dropped and called kfree_skb(). The latter is what=0A>> we need= . So we need to separate these two cases.=0A>> =0A>> From the other side,= the dropped packet came from the core network and=0A>> the driver, we al= so need to separate these two cases.=0A>> =0A>> Add netdev_drop_inc() and= add a tracepoint for the core network dropped=0A>> packets. use 'sudo pe= rf record -g -a -e net:netdev_drop' and 'sudo perf=0A>> script' will reco= red the dropped packets by the core network.=0A>> =0A>> Signed-off-by: Ya= jun Deng =0A> =0A> Have you seen the work that's be= ing done around kfree_skb_reason()?=0A=0AYes, I saw it. The focus of kfre= e_skb_reason() is trace kfree_skb() and the reason, =0Abut the focus of t= his patch only traces this case of the dropped packet.=0A=0AI don't want = to trace all kfree_skb(), but I just want to trace the dropped packet.=0A= =0AThis command 'sudo perf record -g -a -e skb:kfree_skb' would trace all= kfree_skb(),=0Akfree_skb() would drowned out the case of dropped packets= when the samples were too large.