Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2951062rdb; Mon, 4 Dec 2023 12:01:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGm7ME+HRXmxHIRkBfQq/1A9lAOWrGBEThyTUiRf/MMDWiah3VhOkYuCRfZng1uqdhYZoRu X-Received: by 2002:a17:90b:1c8d:b0:286:a9f0:3456 with SMTP id oo13-20020a17090b1c8d00b00286a9f03456mr122461pjb.46.1701720079664; Mon, 04 Dec 2023 12:01:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701720079; cv=none; d=google.com; s=arc-20160816; b=wYNaMiEWonyvaUh+NNmcqPrXy7JDfO19JGkGnqbxtfPWbf/eD0CWRRS/4x3DypJFBK MahldL+6KDrC/RetbCDOARqF0U9rCmi+tXdYTt1zH4zVzrpYcZuQA9drB2b9mmoXt4MC uG/fWwJKKBQhKz0Lnq+RjMdcH8sXVn120n5zD4jX6bdIhx5VTzYndSRfpT3xf5G7MBPB tSg3odWMDh1kTBEl/t50kBqihzaS7Bp1Y9NXv7vy4NmNJFLW/l/8y6Iq0xJZ4rZEmvwX B73e2Ibp8gGHB7aDk9wVjlyXeM1YTBPkNPNAXFg3thd19jkVX1KnTvMZjsOOM9u+9kEI t+aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Z4qUKdBMoTlxHYFiskzAv8nyrsjpTSREfKpRVBZmhZs=; fh=/+fbPisZpgx8OaFbVauINUgFXTFi8zHNHBQHjmE7YxQ=; b=nf9VAmLD0Ug4pxLSNWV4tbPwGUq8MsBQGh93b006GD15s/6eNBXam5xDjfrzDnEiZR iIpYoldnF7jQ8Brz/bUyLC6u2N3R99HiCVBiBsIHgAkBzc4HmUMuofprH6wGIdIVRDaN s/6Sg+Y4/DFvxjSTqk+GgPOoB/DiwDe2DaRmVxIaYiFwmeRP2ccYFEbjV3xn1CjUXT/2 fBmO5o+TVHopkkNRe1Mn90M31v2bXw99lMW47bMzPVMI56cumDcOAF+J1KRKk3TXKndn /NTpQCxLKfi+17kjJReZJVd9fVfCeExfmR2G9PODM/+wUfTA7IopJr7l9oD+y9CKuJrv 1z2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Th5CH+bl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id s69-20020a632c48000000b005c6763c301asi3338191pgs.467.2023.12.04.12.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 12:01:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Th5CH+bl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 805E680699DB; Mon, 4 Dec 2023 12:01:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232848AbjLDUBI (ORCPT + 99 others); Mon, 4 Dec 2023 15:01:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230317AbjLDUBH (ORCPT ); Mon, 4 Dec 2023 15:01:07 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AC77CD for ; Mon, 4 Dec 2023 12:01:13 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-54c79cca895so2559a12.0 for ; Mon, 04 Dec 2023 12:01:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701720071; x=1702324871; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Z4qUKdBMoTlxHYFiskzAv8nyrsjpTSREfKpRVBZmhZs=; b=Th5CH+blKchcjlPg5H0iQyaw1E0Dc6XFMO2YZGfDy/gegzdrJV9MY8HsyBFSbVjkWz xIvwuBOxwzs4NCh1XZsISIxN6XSp/hwQ/yNkKH5ZzIa3P6OqFmKeR0AXsH81/VticX6q ebKskBIOZYmDj2stBTe5yvR/Df2u2U2Y+5fZJ7ekCrll2c7pFe1xnMSB7NeEfFBC9a+i CxcNx2DzT5xhZ/0dpNcALRJUAspvjlEto6HOiYiVy3NZtfIz9vVRo5Qn8rDv2Qjc6uzG 51g4/5VW6vzAeY0+VWfJD+bJe6RMgYiZB2YcDn+IGedSlNmdGSHpBdlJAJY1fWjaSJAk 9Aiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701720071; x=1702324871; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z4qUKdBMoTlxHYFiskzAv8nyrsjpTSREfKpRVBZmhZs=; b=EJkZSUfq2/wGjYI3H6u6FSPLMfTXxYfhXdC3u/pPlWuJlzqocvKrdS8QGxv21qU9YC nx5p0vB+nkSABKTgKlwlJIhn0/S/6ZhPxzAfNn8aaKhJR9sGNkI5Cy7oT+J7vu2cCYIF NPmsf4eF/QZBDM7RG4esYgofq72SHWwrCh0vZmxeWZFT79Cm4ksJ3a2jl46XVpw0omzH tR876qw4nA28vY1DPzln8aZ9b/rictzcnTYmXIAgOAecv/inQ7zsdQUfffDmhajIptqb hEmbKk/so5x0AHa+A25w6XJHe0x7h494RlXnX2YFOnVhelkmH9bs/5pm3MxZHMYJsboR STIQ== X-Gm-Message-State: AOJu0YwlOsNt5mPF2NqGnHb2TmOBjW/spkjGpzrtdmy4sPfU+3IExsN5 26pkOaHbv6vn48KFuppGeAPBc8ZURudF0St/4llefA== X-Received: by 2002:a50:99de:0:b0:54a:ee8b:7a99 with SMTP id n30-20020a5099de000000b0054aee8b7a99mr332954edb.0.1701720071324; Mon, 04 Dec 2023 12:01:11 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Eric Dumazet Date: Mon, 4 Dec 2023 21:01:00 +0100 Message-ID: Subject: Re: [PATCH v4 net-next] packet: add a generic drop reason for receive To: Yan Zhai Cc: netdev@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , linux-kernel@vger.kernel.org, kernel-team@cloudflare.com, Jesper Brouer Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 04 Dec 2023 12:01:18 -0800 (PST) On Mon, Dec 4, 2023 at 8:33=E2=80=AFPM Yan Zhai wrote: > > Commit da37845fdce2 ("packet: uses kfree_skb() for errors.") switches > from consume_skb to kfree_skb to improve error handling. However, this > could bring a lot of noises when we monitor real packet drops in > kfree_skb[1], because in tpacket_rcv or packet_rcv only packet clones > can be freed, not actual packets. > > Adding a generic drop reason to allow distinguish these "clone drops". > > [1]: https://lore.kernel.org/netdev/CABWYdi00L+O30Q=3DZah28QwZ_5RU-xcxLFU= K2Zj08A8MrLk9jzg@mail.gmail.com/ > Fixes: da37845fdce2 ("packet: uses kfree_skb() for errors.") > Suggested-by: Eric Dumazet > Suggested-by: Willem de Bruijn > Signed-off-by: Yan Zhai > --- Reviewed-by: Eric Dumazet