From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (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 24AC4288C30 for ; Wed, 24 Jun 2026 11:55:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782302101; cv=none; b=WocpiCPKfz3ZFY1x//o9+Aj94wKUxtuCd4AmjeYLa+EPX5tvsUMEqtqCGGaAQNQErnlg5tBqEafBqjpYE1/Q7ix+oNTX+raWNjcBCwGANAaYCBKzOepluo7qGQE2y57TqTurFwfxNLhadPnc9xdMlSb0pyy4lxsa+Y4z30jCniI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782302101; c=relaxed/simple; bh=TMWGjgzhMSCfw5zila1yJHv6X+TiVrsYoTVEXvWsB08=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X4Fd5/f3jwEryZP9G6YWhNlP/3RWZ7UTudXHKN0VN3En6eANijvraycnvQXTcTIJ9oLFqQff2lTnLGh+UF2k8lhl8fUzIUpRCCBjl83KjsU0Xaw9QqWXgwHXjAt39iTPNnY8rJfUW5fFMPLU9GbQPsBk9WTFCIpZaSYSFN6N0ak= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=l+VAs0Ge; arc=none smtp.client-ip=209.85.215.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="l+VAs0Ge" Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-c8b49639fbaso614328a12.0 for ; Wed, 24 Jun 2026 04:54:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782302099; x=1782906899; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z8Vn96XVnW2krHp7V5/fKbqoj2TgGkav7pxGg+ctypU=; b=l+VAs0Ge3VmNgoPHIGGaEz93robzx8O2WeN/PCGNkW1FuuuWhawCn5cPDiG3IWMCSN 6eDp/0ZlX/LuyfYNVUqDhBpsq+cPxKl23vPxwBF1qvIpaVyLBGzF10wZEnq5r19zr1u+ MiwMkW2POaym+c9IsyqR6yRiDFA5ePR4tMOzx8bRgjuLaQSYSXl26CUnAZN5JFtvFt4L /2jRrmV0KC1HN/yiuwPqIH7MK0v7XsLFF+vp0QbzfEuv6FQ0reSoYmrGTWRgR+ul5K76 Wce+1rQx9HA7NuLgtlJOdibcwQm6jGm43jQPwTWD65FsxsYjZS5lC6xe/GBRbjho0ZH8 ZLvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782302099; x=1782906899; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Z8Vn96XVnW2krHp7V5/fKbqoj2TgGkav7pxGg+ctypU=; b=R5OxO/Oko9PkxtmF9vHdV6OaQqvVsk3Ozqq0+scs0MW/JFelPsnQaf7K7NcKJYnVIG dOJDfoLA4qw0Q2R2hXjhOsVgtFF5SiRqNxmW7lpxkfTAGLM0Oj5nzFDBYpXEspxn2AO4 1hitw4+3DaTJWEk9JKNsylQfHCW3WwsYC0MqOFAZ0v0O6snyKChpbjftM3h0ioFFUVwd v4w3bGhKKYuUZO1VlJMLDEdd2YkkF/iHVa8qFKbD9k0CRUibHYhreTCQ5bz0fvCLg5uS yHNrv3v2yXsHVHHSFCEE1Y1KcYu7AnVWkEvpJBZhXd03VeGkxolqwGcOGdcvthX6uWGE Muhg== X-Forwarded-Encrypted: i=1; AFNElJ/be5jIBRI+lexYJ+Qp05hBrKsqBe1iHEjzGhAOCG7yNlJWoi1nOsbbrocyNR//KsVcKBKj7/7p7cWlobA=@vger.kernel.org X-Gm-Message-State: AOJu0YweeQy+C25/Cjo4M0VvGX8QfAa2qcYFzkwgzDKCKmhRqzsNw9tv aIfhEhRqdFO8vnziHeiXoJNhiyjpytQ4ON4KPM/a1sr7g5BL5TvYboro X-Gm-Gg: AfdE7cmDdn3GVUrc1Gw7tDQ56BShN5BwbAcZQwASgG55AkH+IDVUTvLF9BmZZNmlsqN 99fkhV6MdtakDqY2V47di3UnvO8Xz6hPeR/esBGmDR/RH2BMTSd09HLAis4pFasnsLpra7ctuGd Im7teWSp4VC5K+233DcLDZ0aIeVmmnnpjPxm0lPKKjT0sC5+UGmiudIBfsxLIvj22SwkvR1P45z bxC4mhUAOn8YW8oF9yJ+go1HOWt7ehaSPiHmfUPkAF2U3kRkxmRIPZJ8Kg8x5PCCqSLHtDtSoyC B8t/iSHCt7Ko82d4bFoIBM4DE87rsF7g6s8B6RhsFko+ldKoTr0cDD94sHTTO9ewpdObq1y8yyJ mm+E3m0lF8WPznHh+2z/hpoNDbRVoGezz/9vwbHdoSMCw5csG0uV5hjXIEOAqfk3xSeT8ascQ1O Q3z97f8bwEw6xTbrr5GEPXXT98RKxBrD9MgqvKtFxAm7xx41ghp7A/jJahkBxx X-Received: by 2002:a05:6a20:b7a7:b0:3b3:f46:1ef3 with SMTP id adf61e73a8af0-3bd15239141mr9670702637.41.1782302094539; Wed, 24 Jun 2026 04:54:54 -0700 (PDT) Received: from r912.tailbb6e1e.ts.net ([182.70.116.80]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c8bc563c168sm12708560a12.20.2026.06.24.04.54.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2026 04:54:54 -0700 (PDT) From: Avinash Duduskar To: toke@redhat.com, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org Cc: eddyz87@gmail.com, memxor@gmail.com, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, jolsa@kernel.org, emil@etsalapatis.com, john.fastabend@gmail.com, sdf@fomichev.me, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, shuah@kernel.org, hawk@kernel.org, yatsenko@meta.com, leon.hwang@linux.dev, kpsingh@kernel.org, a.s.protopopov@gmail.com, ameryhung@gmail.com, rongtao@cestc.cn, eyal.birger@gmail.com, bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, dsahern@kernel.org Subject: Re: [PATCH bpf-next v5 1/3] bpf: Add BPF_FIB_LOOKUP_VLAN flag to bpf_fib_lookup() helper Date: Wed, 24 Jun 2026 17:24:42 +0530 Message-ID: <20260624115442.4112419-1-avinash.duduskar@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <87pl1gcmgf.fsf@toke.dk> References: <20260624030530.3342884-1-avinash.duduskar@gmail.com> <20260624030530.3342884-2-avinash.duduskar@gmail.com> <87pl1gcmgf.fsf@toke.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit > > + if (flags & BPF_FIB_LOOKUP_VLAN) > > + return -EINVAL; > > + > > This is fine, but we should probably reject the input flag as well in > the next patch (for symmetry). I dug into this and I don't think the two are symmetric. The egress reject is right for exactly the reason you gave: in tc you can redirect to the VLAN device directly, so reducing the egress to the physical parent is only needed for XDP. But that is a transmit argument, and VLAN_INPUT never touches the egress or redirect side. It only sets the lookup's ingress (flowi_iif), which picks the iif policy rule and the VRF table, and there is no XDP-only constraint there for the symmetry to mirror. tc also has a real user for it. In __netif_receive_skb_core() the tcx ingress hook runs before vlan_do_receive() demuxes the frame, so a clsact program on the physical port sees a tagged frame with skb->dev still the physical device and the tag in skb->vlan_tci. That is exactly the physical-ifindex-plus-tag input VLAN_INPUT takes, and it wants the subinterface-scoped answer. The 2/3 selftest already runs the VLAN_INPUT cases on the tc path, including the VRF-table-selection ones, and they pass, so this isn't a theoretical tc path. So I would keep VLAN_INPUT allowed on both. If you would rather hold a uniform "both VLAN flags are XDP-only" line under the same restrict-now-relax-later rule as the TBID and OUTPUT combos, I will add the reject, but unlike the egress case it removes a working tc path rather than one tc cannot use. Happy either way, just let me know. Thanks for the review. -Avinash