Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1756778pxb; Wed, 9 Feb 2022 03:58:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwh02q9Mf9ULszMzvWW9wxmXqWTXIy3nxW0SMKq4yT917kI5pGkKERoWbaaL1OLsGppaa9H X-Received: by 2002:a63:f15:: with SMTP id e21mr1584300pgl.571.1644407937861; Wed, 09 Feb 2022 03:58:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644407937; cv=none; d=google.com; s=arc-20160816; b=JvmaR31/CovTmP1dNqnyVBGhvOFs1wohBBPQ13Skz10YfZG4Htuc/7RXb4DC6vhBj0 roJdA6sSY7DYCU39RkQhOzz9dHKZmukW7OxBa3s3jg9VYu6ky/CyVz+2c9H1/JPz0Fcv MWHa63np/ZnM41/BtjlxntcNw1muFSpluQ/Ku6OATH6a9s3RS6id3QFyV7hWS1XW/x0s kNqt+KLV5Me2JrA0x/cLe0Xm47W9NEF0+MjsZB4WzKWDRHH3bxVBqJEgVGCmvjWT0Gjm WQsijf6y2dwOqnsXmlvZQ15pY/x/c9/AJU6Xsp0hUhVn987ZdyKVl+LWaMqdMeabXDnA 7JXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=vJO0Nw9lyaFuSWIJg6LiAlxrczeNtGVjrT1n1tbVYZU=; b=rQjF4Q6nEMlEW5HdjVidg/v89xGbY417RB575HvCcTuEbStgKc1bDWZUKVmvmz3efm CZlUShGInB6MzLpSX70qJUnwYFHgeDgDmE7J5BDgobMmXfz7BE1U4v5/hx77Srefpez+ 1oqsG+ZJZjQhQHvz900wrinQem/dDsI/6qT6TApA12rP6gbX8ShlxdEmkTsAgf4+INQn L+wsz5scpBVgcCNki5DkD3x/YfqGv78/JQ5brpJb3R1TaevjYUOYIrnlgCeKQOFLmg/d h8MRVCKFCWYVKLb+AfbZWLdtlRqu/jdPCqVUIKmz+JwYYMp8chgXSRhTwAv0NUloRP1c NjVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Nqd41M3o; 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=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id bf21si2093439pgb.384.2022.02.09.03.58.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 03:58:57 -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=@kernel.org header.s=k20201202 header.b=Nqd41M3o; 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=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3C68FE0EF864; Wed, 9 Feb 2022 02:03:15 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239877AbiBIA1d (ORCPT + 99 others); Tue, 8 Feb 2022 19:27:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237906AbiBIA1c (ORCPT ); Tue, 8 Feb 2022 19:27:32 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A148BC061576; Tue, 8 Feb 2022 16:27:31 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3D46461827; Wed, 9 Feb 2022 00:27:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64535C004E1; Wed, 9 Feb 2022 00:27:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644366450; bh=DOgHT7IypYPcEzB2cyqFOeqBxjv+zi17vi6+cGA2ltE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Nqd41M3obBvnPKwbaBCPjq91MTVykmhnHBw7axREl7vJFMenD/ol0SXTUODmtB2Uj DK4FGG7sGbKCAn1coIkQmufTBBJBMQcTBRmCj50sYqeFyHhq4fnXQHS1Ai4p/SEdSu hb6c49gjGv0r6DtOkOpxTKQMtImOevWD/GRxSTs6v/Ofiq9YfpShRvAGzLzmOuQEtp IMtTx4dZJzFr4D/AWZR33DQciXT1xXBbZgiWXPRvsjzLZkXbPyaN9KH/7B7s/Oyej9 JB50IJsuZ40RaCKMxvNo7BIWAu+Bjf5AkNQNep34s+ElaHsoR+QllQuwPn40dWOleW rhYEmEWf+8BsA== Date: Tue, 8 Feb 2022 16:27:29 -0800 From: Jakub Kicinski To: Yajun Deng Cc: davem@davemloft.net, rostedt@goodmis.org, mingo@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: dev: introduce netdev_drop_inc() Message-ID: <20220208162729.41b62ae7@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20220208064318.1075849-1-yajun.deng@linux.dev> References: <20220208064318.1075849-1-yajun.deng@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On Tue, 8 Feb 2022 14:43:18 +0800 Yajun Deng wrote: > We will use 'sudo perf record -g -a -e skb:kfree_skb' command to trace > the dropped packets when dropped increase in the output of ifconfig. > But there are two cases, one is only called kfree_skb(), another is > increasing the dropped and called kfree_skb(). The latter is what > we need. So we need to separate these two cases. > > From the other side, the dropped packet came from the core network and > the driver, we also need to separate these two cases. > > Add netdev_drop_inc() and add a tracepoint for the core network dropped > packets. use 'sudo perf record -g -a -e net:netdev_drop' and 'sudo perf > script' will recored the dropped packets by the core network. > > Signed-off-by: Yajun Deng Have you seen the work that's being done around kfree_skb_reason()?