Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5274537pxb; Wed, 26 Jan 2022 08:24:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQrdE+/LhUWwFFpvByoNpfFpS5xOe0iKN5uV4Y4LpU+W1PTz6baHk+qkhuz8JB1ktd7wzI X-Received: by 2002:a17:902:6bc9:b0:149:b7bf:9b33 with SMTP id m9-20020a1709026bc900b00149b7bf9b33mr24226887plt.18.1643214248050; Wed, 26 Jan 2022 08:24:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643214248; cv=none; d=google.com; s=arc-20160816; b=PacchOqSk67GiJgVIAN1zzcvLTA+7xiw+moXclKT7o++q92HnjlWSrDpozk1u7zgld HD7HPtugbdwRQC5b56kZJdHwrcwEYyzSTDfYkazDPCvKDhvOmyXMeBmNRXTUjr++aKEJ pvcaIEc4HbZKJWLGkrX+6aDOusVFt8GS9zlx1Tv8m07FQJ5AaCT1ZZL+nN3KyZpZpHtV hiI7m042JN6/BRLtme01SDgArRfxu2PD9+/y+0unYzYtyZ5xqHCZZBGoTxN0rU5f0nO1 VtTbq98iaGpsdhjgO50isLm2KF9yVQO+EU57RzPMJCdLZLQhcTmoDp872WyEp2LzRx4F Shig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=RJx93SIGFBDDn7EsRNuaC6WbM1HCYqgOCfc1oYCMVtc=; b=LxP9fWki2BtAie0vPr91n1ag7CvlUYhlEMi5vj8FScBBVsFWd4Kx5YzxBm8ESJcv+D IrWtw3uLFoa85dHUtLSh7AGQat6n5e8kPwVdz87p7h55B9uPX9E1yI2+fUAlYMCZsMKj /rUHyOFNrc3nq7DSI9yCP4idsAouh2LzM3a3LhqDnnxzEKypDXaIJUgUVDrJI/Ci+IcA 4mmH8R9CzlTh62GcRNkVKEj8dx4kGSaOvX+RsE7wPU9D0igiNYdUjs8brfktxD6uAiyo iYMXACpxv90HBV3J7669Svx0x2Yl1VN42JwHKfBogpelTb9/F/aXEPtVEBn30wSXZ1kU TmkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nyHUH8z0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z6si2169172pfe.233.2022.01.26.08.23.54; Wed, 26 Jan 2022 08:24:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nyHUH8z0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236788AbiAZDEm (ORCPT + 99 others); Tue, 25 Jan 2022 22:04:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230099AbiAZDEl (ORCPT ); Tue, 25 Jan 2022 22:04:41 -0500 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C9A8C06161C; Tue, 25 Jan 2022 19:04:41 -0800 (PST) Received: by mail-io1-xd30.google.com with SMTP id i62so10418367ioa.1; Tue, 25 Jan 2022 19:04:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=RJx93SIGFBDDn7EsRNuaC6WbM1HCYqgOCfc1oYCMVtc=; b=nyHUH8z04QuJfVzLgFeE9NKHzUg16pG3vr1z50y0g67XKx7PIgJ4NNEayEWqMmkdDK kMmy0p16K1fDBOnRSbsT6z1v7hQeSK36Xr580eimxR/Q0HWPvY0sAv5UmwfHmDKOUvyc uIgAg7DEe+SRIm5tIi1GjNJKsorA6rp7VN94kUASEsjDE/Oop2VRUkP3w37zJFbr9Xp6 1mCFdjWNECZoZoJC25fGOfijrLXCtBRqMq7jrwuEjH5flMH1O9SZo/uPIeCz52vVCu0T Tkziu8dSG2xyouog42mXZoiwJfY20drKxAPaISPHFo3l1WSwJXPmKvpMAMfT+0fAcV3s VcNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=RJx93SIGFBDDn7EsRNuaC6WbM1HCYqgOCfc1oYCMVtc=; b=qfjQaZrqkc/IbuknBJ3bi4bBYlEtR4ZpuRyIe+yOvOWEY2lZVnMx9iAdBDicoEEie2 DhOBERq7zee3a5sza1kgDXrsCeJeH3taLbvIRTdV+6TLOxdgUTe2r8H9XpS/YKRpFgAS NQm0VkY+8N5aGWs7n1IwazMRIz4FjwptOt867gQw1gmB7nVusc3aosbZUiKyJy9UARw4 yypOgQrm0e6lWs3b5KEeH0k1qdQDsPVzREp5fe8LomVNoip7OzRWxibeUbqY/RC9fCo0 zDTdugHxpFWT7h08j798TFLx1uvBtbhApX73H1Jf3x6wTYvk5qd7bjsHnGjcCO8ve9B8 +hng== X-Gm-Message-State: AOAM533Q5/czkcwGFjuHn6Q6DTeQ7Lth+l5flJSZSH8TX7bqvwLK105m 2mEUOk0CbHb1/bq7BEWrbxQ= X-Received: by 2002:a02:2ac8:: with SMTP id w191mr9505237jaw.89.1643166280955; Tue, 25 Jan 2022 19:04:40 -0800 (PST) Received: from ?IPV6:2601:282:800:dc80:1502:2fac:6dee:881? ([2601:282:800:dc80:1502:2fac:6dee:881]) by smtp.googlemail.com with ESMTPSA id y3sm9751056iov.29.2022.01.25.19.04.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Jan 2022 19:04:40 -0800 (PST) Message-ID: <00b8e410-7162-2386-4ce9-d6a619474c30@gmail.com> Date: Tue, 25 Jan 2022 20:04:39 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH net-next 5/6] net: udp: use kfree_skb_reason() in udp_queue_rcv_one_skb() Content-Language: en-US To: Menglong Dong Cc: Jakub Kicinski , Steven Rostedt , mingo@redhat.com, David Miller , Hideaki YOSHIFUJI , David Ahern , pablo@netfilter.org, kadlec@netfilter.org, Florian Westphal , Menglong Dong , Eric Dumazet , alobakin@pm.me, paulb@nvidia.com, Paolo Abeni , talalahmad@google.com, haokexin@gmail.com, Kees Cook , memxor@gmail.com, LKML , netdev , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, Cong Wang References: <20220124131538.1453657-1-imagedong@tencent.com> <20220124131538.1453657-6-imagedong@tencent.com> <308b88bf-7874-4b04-47f7-51203fef4128@gmail.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 1/25/22 7:43 PM, Menglong Dong wrote: > On Wed, Jan 26, 2022 at 10:25 AM David Ahern wrote: >> >> On 1/24/22 6:15 AM, menglong8.dong@gmail.com wrote: >>> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h >>> index 603f77ef2170..dd64a4f2ff1d 100644 >>> --- a/include/linux/skbuff.h >>> +++ b/include/linux/skbuff.h >>> @@ -330,6 +330,7 @@ enum skb_drop_reason { >>> SKB_DROP_REASON_UNICAST_IN_L2_MULTICAST, >>> SKB_DROP_REASON_XFRM_POLICY, >>> SKB_DROP_REASON_IP_NOPROTO, >>> + SKB_DROP_REASON_UDP_FILTER, >> >> Is there really a need for a UDP and TCP version? why not just: >> >> /* dropped due to bpf filter on socket */ >> SKB_DROP_REASON_SOCKET_FILTER >> > > I realized it, but SKB_DROP_REASON_TCP_FILTER was already > introduced before. Besides, I think maybe SKB_DROP_REASON_TCP_FILTER is not in a released kernel yet. If Dave/Jakub are ok you can change SKB_DROP_REASON_TCP_FILTER to SKB_DROP_REASON_SOCKET_FILTER in 'net' repository to make it usable in both code paths. > a SKB_DROP_REASON_L4_CSUM is enough for UDP/TCP/ICMP > checksum error? Separating this one has value to me since they are separate protocols.