Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1258038rdb; Fri, 9 Feb 2024 16:01:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkGkR/ZhTTtvS2ngFF3G6g4EFj+PN9XgEtziiPYn1b/ZSsmSiX1Ab0KPKT3YwDVuQPRaKV X-Received: by 2002:a1f:dbc2:0:b0:4c0:375a:d68 with SMTP id s185-20020a1fdbc2000000b004c0375a0d68mr815333vkg.11.1707523293970; Fri, 09 Feb 2024 16:01:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707523293; cv=pass; d=google.com; s=arc-20160816; b=lxqghh+8x/zYMW6TqoCsSWmhd7MtRUhHgclTyogIGnw/4vYbQ4GmnlD4BynF8+N0qF Rlj/la27kuIQWPPaY0IIssJCimtUdgdFhIaaA76ot3eafIBlU6er5ZdyDYhbVSEbU+Bj ZGh2TlqWdMB2UUrqyj1cpt9bOPu/iSsWZ4/9FnpUR+RF26QOBhKjpQbjnctA8+lV/T6f Ra4tFEABy/CnsRpCkMhp/R2nGe9XODlPZjfh8cdWsqiT1U6cfgcJw6aLE2EYVCbS8hHo +pyEtyw8tas8EOhPmENpr9clXSYRFRSoaVtZ/DEiMwCFoEAviHNyOZLboI7HxKBIqctW C6TQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=c6ofdqHOHjOqeu37knmsIEqYVGa2yCjdBWHlcP9NF/Q=; fh=tUUHur4ej0snWkWNwWAkhE0+gB+GqLKh3W7JJ+jFlYg=; b=itx923o2uHOMolZXpus/3xakTwU3UbIqxt4HA5ZnxCZOUSZbZUIjrMoDFi+vMiZhUs iA4Defe4MEqz2LapUd9T9IgO2haV2/Xk95WDhQHOI08fFDOb1RYh5xgjMk4Is4lrfHzf pwQn9RduG59BRA08ikwwlm+oX2Q2NjFZSQGKV2phsm0M6xXFrYzO04uceD04IUw2dL6N cR2HhypoW1ZwIv/xPFJobjMpRYYiuJQNaMzTzS5mHO0uHUE/3adPiCP+vZTaFoZQ3xdn 1v2/sLloVTAmqbkWPlDWDv6ALM53/BRaVKR8SPtE+fpqZYKRzuCz9fYaF5G0hYU8Uoi9 glfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="nC/5y7nX"; arc=pass (i=1 spf=pass spfdomain=flex--sdf.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-60164-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60164-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCVVuHNbxfTyEvyoxBmyfvYeSWf20aKxODcqe5dNWbvFjpO045xLv/CJmRczB7VIGp0HVoxrZ4C8Aj0RY07ezLd0s9x2KfiZw9Takz5ucg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x129-20020a1f7c87000000b004c021303babsi81378vkc.302.2024.02.09.16.01.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 16:01:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60164-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="nC/5y7nX"; arc=pass (i=1 spf=pass spfdomain=flex--sdf.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-60164-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60164-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A88311C24A20 for ; Sat, 10 Feb 2024 00:01:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0DD02107; Sat, 10 Feb 2024 00:01:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="nC/5y7nX" Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E5E037A for ; Sat, 10 Feb 2024 00:01:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707523284; cv=none; b=lj2t7+XS/N7VT71mDJm2DqZwoUsLwtw3fvaP2cUFERbPbcysLcb7dYY8S1I5M/+VbNJLxCnTF72sx+lNx7WUEhKqjhFzDyZ+yyEcPuR4R8cwJdOOLKAYLjxL7pnP20WahNHogNjnoZlrnRUd+VQCX6yddKzTMkQodF8iiGIxaxw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707523284; c=relaxed/simple; bh=rCfJsAKeXXcZCAjkOXWwNzPHH0iNeMtutMIl0Ma/wGc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=L1R3jpmd9z26hfKjxzmWRVfN5+CnUdgDRLWd+T4jZmFSZFfabLDnnOWFwZBSiAoxHLGVmCiOx3BrD+ZWlVWxLWQJsLgqkU2L9+2KTr7NT7jGqLZutv8gPxw2Xy5+titDoCXoLKte1+Aizc8ODQj2WLWobBvtKPrCwgIt/XtwCQ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--sdf.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=nC/5y7nX; arc=none smtp.client-ip=209.85.216.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--sdf.bounces.google.com Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-296f78bdb40so1478151a91.2 for ; Fri, 09 Feb 2024 16:01:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707523283; x=1708128083; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=c6ofdqHOHjOqeu37knmsIEqYVGa2yCjdBWHlcP9NF/Q=; b=nC/5y7nX6754PKWviq40EEoJ8KQ3RAp6ciXnVF5LUbmsfBfjYlGeNTlV+Fl2VElfiz TSTXtT7to/x8w3LyvSpI6IrPv3zJDpFJHbDs1gaqVQe9Oe8QGYPAJLQcM9TEu70NB0D3 SBErKEyVMpGk+MtiP22z9PpvxZKTD3JzjblflOxY4eiaM6JN8mqh0zZORx9LrKmvXKW9 xWMA9G4x+/bESdmjlUzo5q+a4+UBfgOvOn1LtnWSkKEqiWeqP0YMOhrEjjSQw8NimIZG hgrsZdSPbzgCcFhdpEpQ/okg614Yk3971CcpsXDW8rzA4ktLaKVjYYPdXS9No14I3KrH ciNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707523283; x=1708128083; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=c6ofdqHOHjOqeu37knmsIEqYVGa2yCjdBWHlcP9NF/Q=; b=PcjzirP23Bu8KUUse6fRMKVkHse1qGXETMfiBYr0hrI+pgPewa+6JQDpHBzpwutxLL cwzeF+ZvuqRaeqY9i7YTnyBiu3FMsl3KznD1yI4t1mdxyD0nO2b6rsE988jviuF1xMXL CP4sWfq0KBoSfWzqn6X/IyXZzjMHcf+52dZuTzNtmcmA5xcWpaqdsOhNfJmmuO+9FRZ8 NS3PWZCDVvqEEMD/D3o46JOIQnmzYTwn9CrmbRpJ5IJSonNlfz2mvy8wB5J7BGQbMaSl LV8Ki6aX8KfG7iTeNir9eKQWvsk1pMOQ2l5eF6hlABzsj/vbn107MeDbUhYfze1T2rH5 Cggw== X-Gm-Message-State: AOJu0YzcVaUJx+sqv3PIlzmj6QeBNoeOBvGEiI1XWnABwd1+54U1GpaA mSlclC4cVoZGQPD8RCcrdu7b2D6HuqB+LOJOwu8CtAyYCFUmGojm8TAYsXsnlbvJrg== X-Received: from sdf.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5935]) (user=sdf job=sendgmr) by 2002:a17:90a:fc4b:b0:296:c9f1:a67e with SMTP id ee11-20020a17090afc4b00b00296c9f1a67emr10371pjb.6.1707523282741; Fri, 09 Feb 2024 16:01:22 -0800 (PST) Date: Fri, 9 Feb 2024 16:01:21 -0800 In-Reply-To: <5ac3e6uwvhdujq6tywb6b5bh5flqln6d7kedmcbvhyp55jp4yo@65pnej6e2ub6> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <5ac3e6uwvhdujq6tywb6b5bh5flqln6d7kedmcbvhyp55jp4yo@65pnej6e2ub6> Message-ID: Subject: Re: [PATCH v3 bpf-next] net: remove check in __cgroup_bpf_run_filter_skb From: Stanislav Fomichev To: Oliver Crumrine Cc: ast@kernel.org, daniel@iogearbox.net, john.fastabend@gmail.com, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, kpsingh@kernel.org, haoluo@google.com, jolsa@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" On 02/09, Oliver Crumrine wrote: > Originally, this patch removed a redundant check in > BPF_CGROUP_RUN_PROG_INET_EGRESS, as the check was already being done in > the function it called, __cgroup_bpf_run_filter_skb. For v2, it was > reccomended that I remove the check from __cgroup_bpf_run_filter_skb, > and add the checks to the other macro that calls that function, > BPF_CGROUP_RUN_PROG_INET_INGRESS. > > To sum it up, checking that the socket exists and that it is a full > socket is now part of both macros BPF_CGROUP_RUN_PROG_INET_EGRESS and > BPF_CGROUP_RUN_PROG_INET_INGRESS, and it is no longer part of the > function they call, __cgroup_bpf_run_filter_skb. > > Signed-off-by: Oliver Crumrine > > v2->v3: Sent to bpf-next instead of generic patch > v1->v2: Addressed feedback about where check should be removed. > --- > include/linux/bpf-cgroup.h | 7 ++++--- > kernel/bpf/cgroup.c | 3 --- > 2 files changed, 4 insertions(+), 6 deletions(-) > > diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h > index a789266feac3..b28dc0ff4218 100644 > --- a/include/linux/bpf-cgroup.h > +++ b/include/linux/bpf-cgroup.h > @@ -195,10 +195,11 @@ static inline bool cgroup_bpf_sock_enabled(struct sock *sk, > #define BPF_CGROUP_RUN_PROG_INET_INGRESS(sk, skb) \ > ({ \ > int __ret = 0; \ > - if (cgroup_bpf_enabled(CGROUP_INET_INGRESS) && \ > - cgroup_bpf_sock_enabled(sk, CGROUP_INET_INGRESS)) \ > + if (cgroup_bpf_enabled(CGROUP_INET_INGRESS) && \ > + cgroup_bpf_sock_enabled(sk, CGROUP_INET_INGRESS) && sk && \ > + sk_fullsock(sk)) \ > __ret = __cgroup_bpf_run_filter_skb(sk, skb, \ [..] > - CGROUP_INET_INGRESS); \ > + CGROUP_INET_INGRESS); \ The bot still can't git-am it. And I can't either. Did you somehow manually mangle that part above? The original line has less trailing spaces than what your diff source has, look at: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/include/linux/bpf-cgroup.h#n201 Can you drop this part? Let the idents stay broken :-)