From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D151C433EF for ; Wed, 16 Mar 2022 14:45:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356858AbiCPOq1 (ORCPT ); Wed, 16 Mar 2022 10:46:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243640AbiCPOqX (ORCPT ); Wed, 16 Mar 2022 10:46:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B74B039B9F; Wed, 16 Mar 2022 07:45:08 -0700 (PDT) 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 522CA6158F; Wed, 16 Mar 2022 14:45:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6B59C340E9; Wed, 16 Mar 2022 14:45:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647441907; bh=EdzeWj/opABL78Uw5ziB5aHmdj+a+7DmJ7wbHG5eM24=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=mgmwIX+iucmyRtL/ywxTMi08ALCbYSCtysWtxJrtCE3nQRbSg0XmmIa4b86f+4V0S Ir0jvEZR0sxpBiFQCU+Rf2STeOHS0WESKxEWPsJ/GEVVazaqwQ0E7T6jg+3pw6UzHW 9lvbyUnie3f5ue0IemQ0t3gsgHxitfWpMrjpedMBEfifjFq6Vy5+oKHmKaq4/q387A CeiXBuyF3D5T3TI3q/fys/lyYA6fh5wYu0VvDriVfXvcz2H2aa/WsnFAEgQNvY/uPj JES1B1fA7gcuvlwJgrk+IGOGOBHavgv6R978dD/rKA/wWQY+RohCwfnhSQgYgTUa+g 7yOIAkUIXHiIw== Message-ID: <1cab9152-a5bb-17e1-1101-f309a3be6365@kernel.org> Date: Wed, 16 Mar 2022 08:45:05 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH net-next 1/3] net: gre_demux: add skb drop reasons to gre_rcv() Content-Language: en-US To: Menglong Dong Cc: Jakub Kicinski , Steven Rostedt , Ingo Molnar , xeb@mail.ru, David Miller , Hideaki YOSHIFUJI , Menglong Dong , Eric Dumazet , Martin Lau , Talal Ahmad , Kees Cook , Alexander Lobakin , Hao Peng , Mengen Sun , dongli.zhang@oracle.com, LKML , netdev , Biao Jiang References: <20220314133312.336653-1-imagedong@tencent.com> <20220314133312.336653-2-imagedong@tencent.com> <20220315200847.68c2efee@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> From: David Ahern In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/15/22 10:53 PM, Menglong Dong wrote: > On Wed, Mar 16, 2022 at 11:49 AM David Ahern wrote: >> >> On 3/15/22 9:08 PM, Jakub Kicinski wrote: >>> On Mon, 14 Mar 2022 21:33:10 +0800 menglong8.dong@gmail.com wrote: >>>> + reason = SKB_DROP_REASON_NOT_SPECIFIED; >>>> if (!pskb_may_pull(skb, 12)) >>>> goto drop; >>> >>> REASON_HDR_TRUNC ? >>> >>>> ver = skb->data[1]&0x7f; >>>> - if (ver >= GREPROTO_MAX) >>>> + if (ver >= GREPROTO_MAX) { >>>> + reason = SKB_DROP_REASON_GRE_VERSION; >>> >>> TBH I'm still not sure what level of granularity we should be shooting >>> for with the reasons. I'd throw all unexpected header values into one >>> bucket, not go for a reason per field, per protocol. But as I'm said >>> I'm not sure myself, so we can keep what you have.. >> >> I have stated before I do not believe every single drop point in the >> kernel needs a unique reason code. This is overkill. The reason augments >> information we already have -- the IP from kfree_skb tracepoint. > > Is this reason unnecessary? I'm not sure if the GRE version problem should > be reported. With versions not supported by the kernel, it seems we > can't get the > drop reason from the packet data, as they are fine. And previous seems not > suitable here, as it is a L4 problem. > Generically, it is "no support for a protocol version". That kind of reason code + the IP tells you GRE is processing a packet with an unsupported protocol version.