Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp390651lqb; Tue, 4 Jun 2024 14:48:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUAGxoPaGTsjis96XyfFA3g1c28OnVcVrN772a37Dvv8JhPR/48G8HwMmkTwQB7vbE0HreD205sYZNATP+2YjCZdRPdLbCI4mfbB7dGuw== X-Google-Smtp-Source: AGHT+IFEQtCKUVrP8I1r4k9l5EK3wjFHIe/3+Stuyt4FxHgpJ90eIdGPG06Jd/Zy93De8kc1IR7F X-Received: by 2002:a17:90a:5d90:b0:2bd:4498:e503 with SMTP id 98e67ed59e1d1-2c27db55ee4mr778163a91.31.1717537723202; Tue, 04 Jun 2024 14:48:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717537723; cv=pass; d=google.com; s=arc-20160816; b=Unstf0CxjNZVsABvCxz1EGK3FXeba9MTAm/VtRzTXMHU/aq9zwTjABtTwIc2126eCt OYA40olSfhCh89j6Ok8xrYA1tyjukE5idJv1aMN1tSHCM/kILI/t/QZr8FCBuq2bs+U8 fYwn1GWoFSvVl/3weFMBWxWyiMXzRDFtt88XOxRZBMT3AW2FvSIp5Q6k8rUtc0eGoNCv EK9EFviZFnSoMbm80TZDA3zogMYNd1/fyQ/HK/JZBVC3gLpKNsknegoy2Gw/8QnEzO5f fYdrYXjWhqZojahRl/3cxblougzgUHf8g2mJ3mSx1Jlyo/ezyyJXv8SLa73ifzQprt8o kiyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZokBvFXzTLhgVv1PaHNF9XfQX0m9YCf5c4LTRhvqEjE=; fh=B03x1gFx9KWLxlhLsshJ+cmuKEuBRLjqZc466LIiK8o=; b=wOHNr2i5ppjbjxQt/B1LDm/6YXX/lAcTsTuqXKakuEF1xSLigCoRde2GOPgZ6ZEUsY VbQBCgFx9aAqCcC1BXzfHMeHCoX/vxh3M2iXDT5HE1TAhQxi6UvQsAjYyS83y106qkCQ V6dwFwTyQUWbyECluYOnct8l8lEkJBMVByexMrc9zCjk4mBzz5Lw+baSD1ryzClGky9p lwu+K32pfBuH/LYHk23CluRoUmrtrCrnYJYHdVXZJLJ9WaWbugrD3DnUo5zocNSTXLK1 VHdqSUHZLZQHLHol21WXk2LzFgr2G6Uw1zGrUIvVYDtxIj8HLT2j9u7afJoO2YehWB0C CVIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b=Z2PNykFB; arc=pass (i=1 spf=pass spfdomain=cloudflare.com dkim=pass dkdomain=cloudflare.com dmarc=pass fromdomain=cloudflare.com); spf=pass (google.com: domain of linux-kernel+bounces-201422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201422-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c2806ad6afsi984a91.159.2024.06.04.14.48.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 14:48:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b=Z2PNykFB; arc=pass (i=1 spf=pass spfdomain=cloudflare.com dkim=pass dkdomain=cloudflare.com dmarc=pass fromdomain=cloudflare.com); spf=pass (google.com: domain of linux-kernel+bounces-201422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201422-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D76EF286F6E for ; Tue, 4 Jun 2024 21:48:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD4F014D71B; Tue, 4 Jun 2024 21:47:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cloudflare.com header.i=@cloudflare.com header.b="Z2PNykFB" Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B609114D6E6 for ; Tue, 4 Jun 2024 21:47:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717537671; cv=none; b=VgQVolLxabW5Cj8Pe9oWa651LtVDQdR44C2lcGkofJYy+5BcB/mSylN6CXMVk2isAZPw2NetA9BH/DiwMC97i61GW1Ntb8fFNHpHXwiF/SjUMDt4hwH0bOxX9/4HRFXBcg3UYZTXX2ZnR2M8jLoJJRYQY1jTisaaGdJ0zzG1GVI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717537671; c=relaxed/simple; bh=jkzjDY7vnEB8DqdbcGuw7ABHpoGpOOOicO2KkYgqYYM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=X1FRqkiyBAAcXhE+Zp4bM8uwanLkBomHzIfXbG8X7OzPyv8oo+z12vkVKhjqzfnye8pNR946qnNhBtSe9afGBnVkSQivjnjz8GeWuiiMBPYYDYsxBltCE3EqohWN7KCI7ClVIOmokJOAc6GUSsW6TwsULu9V3OlPFcK8Xs/0wyQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=cloudflare.com; spf=pass smtp.mailfrom=cloudflare.com; dkim=pass (2048-bit key) header.d=cloudflare.com header.i=@cloudflare.com header.b=Z2PNykFB; arc=none smtp.client-ip=209.85.167.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=cloudflare.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cloudflare.com Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-3c9cc681ee4so3311603b6e.0 for ; Tue, 04 Jun 2024 14:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google09082023; t=1717537669; x=1718142469; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ZokBvFXzTLhgVv1PaHNF9XfQX0m9YCf5c4LTRhvqEjE=; b=Z2PNykFBGGMHFGchjXa/OmUdra2jHDOXI+VbW5tmKPM9o748EuEl3EoT3SSTcwWMGg LJ/vJGeOGay59QynmfMC/fgz9bPdmGyR5eWWUEX0XiCGrsJ0t98gUMi8vr2mQJn6vTvX +PjLlqClYuBFDQSZReLpacJbsfNsVr1UH2C6A4BpjSNi2UBR6E9b8VCioNJNbqWhazrI qErncViwqW4Touum7ORClyMtMFDoXDV6S6UgXNC5ysH6t9iPfaJ7YXV3Vlr/Y0suZgiL x4AoGkGEItIbHOGwaU0FcPCv65EL2aGIhDpdOxYzjYZZ6pqouyVx5rq8qa2sKpx/uSiw Th8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717537669; x=1718142469; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZokBvFXzTLhgVv1PaHNF9XfQX0m9YCf5c4LTRhvqEjE=; b=PbWDxDluInoC+HhIN161uD2rsRmKoP0x9B8ovbFGsD/x+QRBfKjDbkiA3axiNB8tMr nduc+ArIlvPKM+Fn09zuQ9cOL8Sj5JGY9ZE+cDffpNRHQVgVuzm5y4k2qfacFgI/YX6s y1EWqBVPv3HJpLzEWx2VXrC1dss3IHDYWoKUQB80BVmAhY71aPxoyCkluMbbuBHgpzHR lL5eOiWZrhyG7G0+418da1d+8TZmbQT9fKM1vjx+cnoW1NHPSw9ejlLQRhBiaiPcOUvD o26K9ArnNK+dNY8GPtLXWbU/ViNUbatv1RdzgRIrwe6CnJmHxPAJLDxMWo6lm9QB0LOu MDOg== X-Forwarded-Encrypted: i=1; AJvYcCW65ToXuD0DhDMpoj8CB/mEfqULcQ4qjYV94cac9DdCvDpAyg+4js8Ge2HtTWNQCahe7PXJu3JF534sNkPhhBqIJAv6C9X86aGQPmu0 X-Gm-Message-State: AOJu0Yx2eBv8VRol3iOn55r09aUwD9jM3uPsusZFNPPsMNOPtnTRQlxF 31zw0joNK0bkshaHY+Ge1BAwLgWONSp4F4vlT7ecs7STGPeAKnxJQoWi+A67mQU= X-Received: by 2002:a54:4193:0:b0:3c9:94ab:e8e8 with SMTP id 5614622812f47-3d2043a7200mr644527b6e.33.1717537668593; Tue, 04 Jun 2024 14:47:48 -0700 (PDT) Received: from debian.debian ([2a09:bac5:7a49:f9b::18e:1c]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ae4a73e425sm42261866d6.24.2024.06.04.14.47.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 14:47:47 -0700 (PDT) Date: Tue, 4 Jun 2024 14:47:45 -0700 From: Yan Zhai To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , David Ahern , Abhishek Chauhan , Mina Almasry , Florian Westphal , Alexander Lobakin , David Howells , Jiri Pirko , Daniel Borkmann , Sebastian Andrzej Siewior , Lorenzo Bianconi , Pavel Begunkov , linux-kernel@vger.kernel.org, kernel-team@cloudflare.com, Jesper Dangaard Brouer , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Neil Horman , linux-trace-kernel@vger.kernel.org, Dan Carpenter Subject: [RFC v3 net-next 3/7] ping: use sk_skb_reason_drop to free rx packets Message-ID: <5e4263e09e784f8b32e261a0fb8ed7056da313a5.1717529533.git.yan@cloudflare.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Replace kfree_skb_reason with sk_skb_reason_drop and pass the receiving socket to the tracepoint. Signed-off-by: Yan Zhai --- net/ipv4/ping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 823306487a82..619ddc087957 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c @@ -946,7 +946,7 @@ static enum skb_drop_reason __ping_queue_rcv_skb(struct sock *sk, pr_debug("ping_queue_rcv_skb(sk=%p,sk->num=%d,skb=%p)\n", inet_sk(sk), inet_sk(sk)->inet_num, skb); if (sock_queue_rcv_skb_reason(sk, skb, &reason) < 0) { - kfree_skb_reason(skb, reason); + sk_skb_reason_drop(sk, skb, reason); pr_debug("ping_queue_rcv_skb -> failed\n"); return reason; } -- 2.30.2