Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5977218pxb; Thu, 27 Jan 2022 03:57:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJw449k9cH2Z31BlQyrAlWzIsnEbhNzZeP6a/N8j9ff20LjEJJ77OjGO7XSiJN2SWTng4Cey X-Received: by 2002:a05:6402:12cf:: with SMTP id k15mr3266890edx.299.1643284648997; Thu, 27 Jan 2022 03:57:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643284648; cv=none; d=google.com; s=arc-20160816; b=MmQ0PdCb8vObYC4WR2dFB5kkjWGqxRR09aFSQDYMO7PVNPyoNj785kejqHZmosqmo5 MAj8PcqB06g39LkyYbbc7uihZfKIbL6ItavcMaY3vq3ehT9qbRqSvGiC+9ssXlBYtzuX OXiEC1gdudx86OKX3ai4V8DgvwyW4f6LAW/WXI+Y940ywf4r4NM3BU+Z+oEguYLq0uQ7 NDrvCL9TTs4bp9Kcf+o3xt63TBOnEv8gHDV2WrS+P/bIpfCeWsELsiHYTi77guSX7AkY 7XmX8lZczprXNi8Z0SCVariHKPsL/BXmS3sXUiD7Qj1CKyim7gX5FoL2CXKvRvB0uXgb uDpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YwFBiJwCNR2Ej7oenh8eiccZ78vpn8xgNO2lAje6Aiw=; b=XLvzLiWCNTpc7fzeCN61BKTJWg3aSej0icz4awJZLjW08myb8GM1JsXVgTAOYoGXUy Md0URVN2yr6d/Jqxw/3s/nCJJ2XLXEXfpNWR/4i7oI7oO6JF3+clphVK5HRxm1QaZSbU ZTpS7avIpk6rLSVEOCwcxoyPCDT7NBeUXRZFnlOv5BRUbr2v5PbSlSXoo3RNvh5+dYho vq+lyjY/mURhhpEnBKV17ASPWAwmYb7aNhyGBGC+DAY6IXVNEihv8Gqd6MTpiCFtpfQQ 7oBZHBevaA4XqzgdS2HG5AIOhMEH4BWm8/4IfTDW+GMed6NoXAVevEKrIMhN++MzbSed 4SSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gGsznywt; 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 b5si1282751edm.306.2022.01.27.03.57.04; Thu, 27 Jan 2022 03:57:28 -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=gGsznywt; 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 S234892AbiA0FIh (ORCPT + 99 others); Thu, 27 Jan 2022 00:08:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231201AbiA0FIg (ORCPT ); Thu, 27 Jan 2022 00:08:36 -0500 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 439A0C06161C; Wed, 26 Jan 2022 21:08:36 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id c3so1526210pls.5; Wed, 26 Jan 2022 21:08:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YwFBiJwCNR2Ej7oenh8eiccZ78vpn8xgNO2lAje6Aiw=; b=gGsznywtVegD8GK1UXhoZE+oLJZwTKV/nyRjdwL76E6WGjPLf4UM1NicsEbFD5gEyg FhqbHtfyUlDq8Y9XsvHo4z9OYFdNc/ZZ/vbgog9H+dHGvWR2R2/ILtrBv/AiMp53ssUH BSN4HcjOWO8lrhPYYScTFUdn32VBaslS7KHGYQyVTvIN3R/Y1z7yADtr/ElTyghjLNlu TIMU6UJki74ZTCta8ps+LBs8sCcVkIdg/r+V2IQdMdWz3wSvKgdtrpWmuLvb68KsWkE8 zVZ2IMJlBRMO7wRGoGZM7m5Ok+XsM63mKFntFN2ymU9w7kv4e7IpMq+GOOnjmB65rcw0 HA1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YwFBiJwCNR2Ej7oenh8eiccZ78vpn8xgNO2lAje6Aiw=; b=7XG3MSFikTeC9FQrL2GGISogXZRarCvvp0vyY0rkT1nsUQH3KJ8jDOYBVDoi6I3Z/b beaPX3FakCbYtWK0rnBLObtew+xvP8OsXka6IEmx3TTeCzngR8IYUwe6/BjYO8a0FHir bh5QXnMGvFdQ1kIk+FXZwosQLEn9gfqQEbMEa/F/hFgOPUKZiMYqGPtgVBKA8nEZUM9v cckUbn+wAw3K5W8z6hjP9+VvN2f4pGeSX4Jx59Ak2QMyEhxvpWqTb0JGBSDn/OOnaD3W 4/0pTA+d+8wyNFE9DPn2Az8uSMZpeb7D0ZIRFeLpcb8+KpTrxHXGN+2uNIEctwbA9+E3 v6+g== X-Gm-Message-State: AOAM531EbDHXzjklQw6CiCC+yuKDnA46gN1mtMeavoNY3TwE4jOTLnAG sLZrPD5t7a4N1LbJtMwWW9wF4+YaVjxBxjozF7F8YkaJLds= X-Received: by 2002:a17:90a:d203:: with SMTP id o3mr12237180pju.122.1643260115628; Wed, 26 Jan 2022 21:08:35 -0800 (PST) MIME-Version: 1.0 References: <94e36de3cc2b579e45f95c189a6f5378bf1480ac.1643156174.git.asml.silence@gmail.com> <20220126203055.3xre2m276g2q2tkx@kafai-mbp.dhcp.thefacebook.com> In-Reply-To: From: Alexei Starovoitov Date: Wed, 26 Jan 2022 21:08:24 -0800 Message-ID: Subject: Re: [PATCH for-next v4] cgroup/bpf: fast path skb BPF filtering To: Pavel Begunkov Cc: Martin KaFai Lau , Network Development , bpf , Alexei Starovoitov , Andrii Nakryiko , Song Liu , LKML , Stanislav Fomichev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 26, 2022 at 1:29 PM Pavel Begunkov wrote: > > 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); BPF_CGROUP_RUN_PROG_INET_INGRESS() is used in one place. Are you folks saying that you want to remove !sk check from __cgroup_bpf_run_filter_skb()? Seems like micro optimization, but sure why not. EXPORT_SYMBOL() is there because of "ipv6 as a module" mess. So it's not a concern. Pls tag the subj of the patch with [PATCH bpf-next] instead of "for-next".