Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5661979pxb; Wed, 26 Jan 2022 18:00:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVUw0yP8mg42+kE7NT16ZDTu8dYpARSWUSvWPJFVAvsT4PhgF+wjmzJt/dbklXAazJJks9 X-Received: by 2002:a17:906:794c:: with SMTP id l12mr1322389ejo.292.1643248802508; Wed, 26 Jan 2022 18:00:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643248802; cv=none; d=google.com; s=arc-20160816; b=M7hTSjX7gdDi+tantyVDgaR2iRBTFkobK25txrDDty9JS8iQRE94Uokq9bs0vHrQI9 o5l2xtvGcxI9iSeXJ1YjDgA52x6qbaABkDMbA4vZfwCqhbs1uCMLLD5XfPV9BbE4UYI8 wQV0IDqMa2XPHQExv3YcWC02I8HXQQmPeaObdx1uAQIDBRAGC40oCoDgogXh+8SEDvvt GDKPpCX4yqE99rvOz0RwNv3bubuivEGQgPU58rcs/9HSBO1OpkC6Debb6mvKxr/xoga6 Yp5uHXv+njBqsh+kKvWBHgiYfcyzeKNC7J2nARgiFA/1ufG2ZI6Gimst8ue20sCGkyG0 1vpg== 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=BMc1fVwckCRvw/Dv/tBaShtNrcGUAklyobw2nHDvO1c=; b=uUkaOeQtdcpYOtNPf6SJB5lrWE0RsYitJFi5pVzQkIFg1/kjp772HHiUU88SfN04fs 2TqFJncevgkY9O9zzmmGakr3i6E7YZ0MeUcOyAksi1WigvmNupFSVa5umrI3DbUFCq1u GurW12aPc+pX/WD87amdXk0N/Gjw9wEcz0AVfsCfqJrCHB8U3RgUIFTk62rePEdwnapA j91SoAMbTF4nSZE4gLS2PmqFblwOLK1KzTuw5YPoUeMWuDwgGYrbbrZDO7PQmFVsrfSU un9L2BxQCUzUdgHqhKfw9T5gKXBv1E2iTbaSfAWp9NGSyORLRMgVKVaM9+89GGMfOvOG tVuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MsVGuWWc; 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 cr15si755819ejc.690.2022.01.26.17.59.21; Wed, 26 Jan 2022 18:00:02 -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=MsVGuWWc; 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 S232533AbiAZV3F (ORCPT + 99 others); Wed, 26 Jan 2022 16:29:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232524AbiAZV3B (ORCPT ); Wed, 26 Jan 2022 16:29:01 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29669C061749; Wed, 26 Jan 2022 13:29:01 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id s5so1438172ejx.2; Wed, 26 Jan 2022 13:29:01 -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=BMc1fVwckCRvw/Dv/tBaShtNrcGUAklyobw2nHDvO1c=; b=MsVGuWWcvHFMYVGkvCKoWrVQUUqS/sftypg2xHuw4tAh/9GAZkcw0g9UGyx7c+skzd mbYm3JtBOWoohyvkr0LwnVj3TwL65K4Q11h1KAbR9cHb4AOwXKvO9WwSn5h+6jrTq+Xp 3rFgZ3zwFXEfkOzuCyvF9+/5rZfRPDs9a2cUJ7po0WBNqbeQJhc6mJzSz0cg2AOu1/px z98xiUGzjxBykAIHzkfBi9zFzJs14Jq0wUFtA/RX7n4IExyGjdXD/f6iHryO3Cn5Heb3 hopKtJXpQyRzQZnbUan8qKcova43qkWDy0UBFVczoeOenRG5vtLAHNdoQeG0Wcq6Bmrd e+xQ== 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=BMc1fVwckCRvw/Dv/tBaShtNrcGUAklyobw2nHDvO1c=; b=gz0b5lJs/l2Q/TdqKbQ0kxFjoj6RCly7iPILTB6hdYll4JCy23DFO+00svzZn7ciEF 3N1cklV/oBWEedMOXc71gxz3sgANJvtJ5e5DkgM7p1OW5Z02rgqYCyr+myrb2wYqu+mn qWBm4wpigR3DZ7lylBj0XUxAwNDmF+2PW0uKFpnaMqU17MgELuqcDWuEs9W6i+CaZCC5 V9ZPdPsEOCD37z7dLgV2PqHEezkxYM0g8tdJe+FFg4k62ISUDAq3Fbqbq5JIm67Ovv3D 6o3/3LRmXYY1vURBqI/giWY6HxcWtkxL5AmcDlfoYGb9PrwSu9vCNpdufvPf/owKQCTz XcZw== X-Gm-Message-State: AOAM532e0FGQ31FzPszy9ubjeixbdQVMVZOftJKNjia8CiRMZkxY4FVF jPnLa92Xu5w+8Yvqq5E/LmM= X-Received: by 2002:a17:906:31cc:: with SMTP id f12mr495303ejf.115.1643232539521; Wed, 26 Jan 2022 13:28:59 -0800 (PST) Received: from [192.168.8.198] ([85.255.234.222]) by smtp.gmail.com with ESMTPSA id fy40sm7718078ejc.36.2022.01.26.13.28.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jan 2022 13:28:59 -0800 (PST) Message-ID: Date: Wed, 26 Jan 2022 21:28:46 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH for-next v4] cgroup/bpf: fast path skb BPF filtering Content-Language: en-US To: Martin KaFai Lau Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, Alexei Starovoitov , Andrii Nakryiko , Song Liu , linux-kernel@vger.kernel.org, Stanislav Fomichev References: <94e36de3cc2b579e45f95c189a6f5378bf1480ac.1643156174.git.asml.silence@gmail.com> <20220126203055.3xre2m276g2q2tkx@kafai-mbp.dhcp.thefacebook.com> From: Pavel Begunkov In-Reply-To: <20220126203055.3xre2m276g2q2tkx@kafai-mbp.dhcp.thefacebook.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/26/22 20:30, Martin KaFai Lau wrote: > On Wed, Jan 26, 2022 at 12:22:13AM +0000, Pavel Begunkov wrote: >> #define BPF_CGROUP_RUN_PROG_INET_INGRESS(sk, skb) \ >> ({ \ >> int __ret = 0; \ >> - if (cgroup_bpf_enabled(CGROUP_INET_INGRESS)) \ >> + if (cgroup_bpf_enabled(CGROUP_INET_INGRESS) && sk && \ > From reading sk_filter_trim_cap() where this will be called, sk cannot be NULL. > If yes, the new sk test is not needed. Well, there is no sane way to verify how it's used considering EXPORT_SYMBOL(__cgroup_bpf_run_filter_skb); but can remove the check if nobody cares > Others lgtm. > >> + cgroup_bpf_sock_enabled(sk, CGROUP_INET_INGRESS)) \ >> __ret = __cgroup_bpf_run_filter_skb(sk, skb, \ >> CGROUP_INET_INGRESS); \ >> \ -- Pavel Begunkov