From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 7BFD96FB14 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org B97A86FABF MIME-Version: 1.0 Date: Thu, 20 Oct 2022 21:34:05 +0200 From: netdev@kapio-technology.com In-Reply-To: References: <20221018165619.134535-1-netdev@kapio-technology.com> <20221018165619.134535-3-netdev@kapio-technology.com> Message-ID: <40edb67ac71ba7eef428c8366753ae94@kapio-technology.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Bridge] [PATCH v8 net-next 02/12] net: bridge: add blackhole fdb entry flag List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ido Schimmel Cc: Andrew Lunn , Alexandre Belloni , Nikolay Aleksandrov , Kurt Kanzenbach , Eric Dumazet , linux-kselftest@vger.kernel.org, Joachim Wiberg , Shuah Khan , Ivan Vecera , Florian Fainelli , Daniel Borkmann , Florent Fourcot , bridge@lists.linux-foundation.org, Russell King , linux-arm-kernel@lists.infradead.org, Roopa Prabhu , kuba@kernel.org, Paolo Abeni , Vivien Didelot , Woojung Huh , Landen Chao , Jiri Pirko , Amit Cohen , Christian Marangi , Hauke Mehrtens , Hans Schultz , Sean Wang , DENG Qingfang , Claudiu Manoil , linux-mediatek@lists.infradead.org, Matthias Brugger , Yuwei Wang , Petr Machata , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com, Vladimir Oltean , davem@davemloft.net On 2022-10-20 15:06, Ido Schimmel wrote: > On Tue, Oct 18, 2022 at 06:56:09PM +0200, Hans J. Schultz wrote: >> Add a 'blackhole' fdb flag, ensuring that no forwarding from any port >> to a destination MAC that has a FDB entry with this flag on will >> occur. >> The packets will thus be dropped. >> >> When the blackhole fdb flag is set, the 'local' flag will also be >> enabled >> as blackhole entries are not associated with any port. > > It reads as if the kernel will enable the 'local' flag automatically, > which is not true anymore. The bridge driver enforces that > 'NUD_PERMANENT' is set if 'NTF_EXT_BLACKHOLE' is specified. > >> >> Thus the command will be alike to: >> bridge fdb add MAC dev br0 local blackhole >> >> Signed-off-by: Hans J. Schultz > > Looks OK to me. See one comment below. > > Reviewed-by: Ido Schimmel > > [...] > >> @@ -1140,7 +1148,7 @@ static int __br_fdb_add(struct ndmsg *ndm, >> struct net_bridge *br, >> err = br_fdb_external_learn_add(br, p, addr, vid, true); >> } else { >> spin_lock_bh(&br->hash_lock); >> - err = fdb_add_entry(br, p, addr, ndm, nlh_flags, vid, nfea_tb); >> + err = fdb_add_entry(br, p, addr, ndm, nlh_flags, vid, ext_flags, >> nfea_tb); > > I believe the preference is to wrap to 80 columns when possible. Ok, I only have knowledge of 100 columns as a limit.