From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31EEE396572 for ; Mon, 13 Jul 2026 07:56:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783929380; cv=none; b=u35YiZcwVZTTTyRCB8N+jF1RNJKAuGNF0b2xYnJ677RiuJmkhHDZxOBHvOLX8D2HDobeLjd7P5IkMxDH6DDWHiVA1+dGs6IB7Js6lkz8Hfl7pW9rJ0wtLnb9SqtYef7WHm0jPfrakV95Qkj/pqjQYEZ6DeZ7KRSsBB0275ixfWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783929380; c=relaxed/simple; bh=NHfZjyhkVxC1U5fPhVwFtqICNsZ1kIJkn+jnD7xhz1s=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=dhi3HAuBSU06au6Gl1hKw+nTGkW/s/hBHvWWIS01UtBlZejPqXOVQTI3+lIU++f6us5DCn5c0AFNYr8lVKiVcWzz0jECFO88aBFZbUA4kHxj36CNgpyTQPf4XwugsMTMpJ5pjdTAeV4H0DdvKF9JYA/Tr5aPwkWhNDJSNRZU3Ho= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ed07tDQp; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=UVx31Ah5; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ed07tDQp"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="UVx31Ah5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783929378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NHfZjyhkVxC1U5fPhVwFtqICNsZ1kIJkn+jnD7xhz1s=; b=ed07tDQpXCnxz8G1VLorph/M5l2/MkL7HrYQN2f8UOGQYSDvvEtbN88w1OZ+zUOFNbLEm3 y8LOi4tGrHPZzNOTS9iYq8Q9s4GPomZnUiRWcCKjPgoJtphxEXW+P7Ntr4bxSLz8CSA/SB cnmbnycRy7lEYlO+xCXY2Vib6+4CRlw= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-326-__9gqLpmPiuktYUer9UEPA-1; Mon, 13 Jul 2026 03:56:16 -0400 X-MC-Unique: __9gqLpmPiuktYUer9UEPA-1 X-Mimecast-MFC-AGG-ID: __9gqLpmPiuktYUer9UEPA_1783929375 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-492714d002cso23656015e9.0 for ; Mon, 13 Jul 2026 00:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1783929375; x=1784534175; darn=vger.kernel.org; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=NHfZjyhkVxC1U5fPhVwFtqICNsZ1kIJkn+jnD7xhz1s=; b=UVx31Ah5wbD6eO9vavAhPOWCTd1cErlqT9PphP4mT8XMdu8jxr3OQx/YH1JcyV0Pm9 1YBrIg0quoM9zMG8JQ4rbkloyX9G82zIPmr1IWt7u9w5si7UcuuxXb67lrqiZ/C/UfQi BIYJOz2GFi7fxM1SOy/Qx4vuJajfIiSMt1nzmChLWzGTlLB17XDvpNqbiVOHhCkNWxMk imUI6x2tYvCar/buSGgfanI2rGVhQZ4vqVwcovGVTAknlWHOTcd+snOnHVl2fvauO5mm Xm4UzCFoKx202CDdy5kzBgLfmoZzG6HnVguP4xcja/3SjtMcBvaDiBpHWSM1D40fkkMJ 8/zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783929375; x=1784534175; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=NHfZjyhkVxC1U5fPhVwFtqICNsZ1kIJkn+jnD7xhz1s=; b=kn+0SpAUKtDBaMsgPpEkCJ6ANUsOsVxm6bLlnu7UR74Dl5LohcyxDiEsFJZhs5+Jkj I3Km+X4kHZRJr+jleykfvd3/jVFSYT23kf60VyVUIGsFJq4Mihejpxvn7iKEDLBBODin uXKMvOo/V7Uuk7eZNaIY1mXoctN7oQtja9U39bAOXY20ShOgdR1O+sLCr/U5yo4sk18n Ay+EtvJEVZBdATtzhIiKWzCNazc4yXzV2w7T2C2GKDBRjKxcTujm6UZv2VrtMjcR4maZ WqwciCsfUKSV5QU5dSmfbb89DdH+lLLU42/n2CP47TIQz1l1dg4O9lde4IqP/LapSZr+ bo4A== X-Forwarded-Encrypted: i=1; AHgh+RpJcSM0Q4tSW+wQzs5TTxStlLqP6o2F578vPR6QjtbFB5WhEVtgGQoDz+y21igPhRKqSTBwW/3c+SkehBM=@vger.kernel.org X-Gm-Message-State: AOJu0Yyxcn818ESlyIiFvPo1+it6T2JVXiZVsDOEpprCAs4dPQDnX3rx nEGhM1HDVxl80XDO93KiU2GgHDnVkKgWbrFPi2Rtxzu/5KmWCF/WLtMDEnQBZJG71np6XTKTOLl pwt7nq8J03lx4//wHb19NFs3JjQ1gCel6vQd94HZirQIpZWB1AFI3p5LZelc1PTq+9w== X-Gm-Gg: AfdE7cmjqP0Qugqtpp6bZTWYWucZ+KDTD3oVCVMWd/MuhcXQVHQIkrWJfYiQL3N6VRb weTLcmEUFjZ00mvCBhzbRSbJ9Za37jLL+HSzXNpN7zPG5rAWXDUBsET82DOEHymwuKXP62aItTg Dl96PJeOOEiJoqlwO/e02scp/Q5is60JNK07xeX8DT72V5urKKrIR7a822PH/dsAPCIrjsqQ5wX iulHo9m3KxuYwRY9vMNcH+u89NSDrYxkNOfsnHx1ToqvZabTsxC+/G7YQJE/Is4k8ikQHMsZZs5 3NXkan13W8NWF8gjCUO9VZyHDkkfN06YpMhCCPxh7tQZNN48aXNkCzp+6p3FU8cVJWbVZHPv2ta i358dbsn9s2q29un+LeEdCaa+JRlftYVoiBZE2g== X-Received: by 2002:a05:600c:4ece:b0:493:a613:56b2 with SMTP id 5b1f17b1804b1-493f87d8573mr76494915e9.8.1783929375245; Mon, 13 Jul 2026 00:56:15 -0700 (PDT) X-Received: by 2002:a05:600c:4ece:b0:493:a613:56b2 with SMTP id 5b1f17b1804b1-493f87d8573mr76494685e9.8.1783929374804; Mon, 13 Jul 2026 00:56:14 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk (alrua-x1.borgediget.toke.dk. [2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa039b0cesm85537025f8f.22.2026.07.13.00.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 00:56:13 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 20E94869E8D; Mon, 13 Jul 2026 09:56:13 +0200 (CEST) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Avinash Duduskar , andrii@kernel.org, ast@kernel.org, daniel@iogearbox.net Cc: a.s.protopopov@gmail.com, ameryhung@gmail.com, bpf@vger.kernel.org, davem@davemloft.net, dsahern@kernel.org, eddyz87@gmail.com, edumazet@google.com, emil@etsalapatis.com, eyal.birger@gmail.com, hawk@kernel.org, horms@kernel.org, john.fastabend@gmail.com, jolsa@kernel.org, kpsingh@kernel.org, kuba@kernel.org, leon.hwang@linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, martin.lau@linux.dev, memxor@gmail.com, netdev@vger.kernel.org, pabeni@redhat.com, rongtao@cestc.cn, sdf@fomichev.me, shuah@kernel.org, song@kernel.org, yatsenko@meta.com, yonghong.song@linux.dev Subject: Re: [PATCH bpf-next v6 1/3] bpf: Add BPF_FIB_LOOKUP_VLAN flag to bpf_fib_lookup() helper In-Reply-To: <20260708080434.732503-1-avinash.duduskar@gmail.com> References: <20260704092159.1256823-1-avinash.duduskar@gmail.com> <20260704092159.1256823-2-avinash.duduskar@gmail.com> <20260708080434.732503-1-avinash.duduskar@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Mon, 13 Jul 2026 09:56:12 +0200 Message-ID: <878q7fl3vn.fsf@toke.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Avinash Duduskar writes: > The bpf ci bot flagged the VLAN_FAILURE re-issue advice in the uapi doc > here, and the finding is real. By the time the lookup fails, > params->tbid is gone (the h_vlan fields it shares storage with are > zeroed on entry to bpf_fib_set_fwd_params()) and params->mark is gone > on the resolved-neighbour path (overwritten by the smac output). A > program that follows the advice with the same struct and DIRECT|TBID or > MARK set runs the second lookup with a zero tbid or a garbage mark. The > selftests did not catch it because every arm re-initializes params, > which is the safe pattern. > > Toke, the re-issue recovery came from > https://lore.kernel.org/all/87jyrwf9g1.fsf@toke.dk/, so before I > respin: my preference is to keep the mechanics and fix the sentence, > "repeat the lookup without the flag, re-initializing *params* first; > output fields overwrite the inputs they share storage with". > Overwriting inputs on the way out is the helper's existing behaviour on > every path (rt_metric lands on top of tos/flowinfo even on NO_NEIGH), > so one rule, re-initialize before any reuse, seems better than making > VLAN_FAILURE the only return code that preserves inputs. Sure, SGTM :) -Toke