Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp267371imw; Fri, 8 Jul 2022 02:35:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sSmXukww8+z+EQ4UcR0X0LyaJF5YJ8/NvpUiAmYVCQmRF9X3k9t14UDshrjqdP/7xsZPcy X-Received: by 2002:a05:6a00:170e:b0:525:4cac:fa65 with SMTP id h14-20020a056a00170e00b005254cacfa65mr3059905pfc.40.1657272939484; Fri, 08 Jul 2022 02:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657272939; cv=none; d=google.com; s=arc-20160816; b=j8dqKhInqfuXZOSlcXzxZ8B4nB9r8F70uNE8FR2xpNMU3ynk/MSyEpJ5rp+QQyUc4+ DVI8lSjmqubsC8txUP9NlSDpV86nX+wKQ65ttCeAbeSRME/XoRAIffJUFhZzpbmSR6zD dCA0gH9nw8dSxyZU52V05598knSENbYrDvOVTPdxWAKKWHV4ovi/tgfGbYzlQPr4N2Ry 2Xu+g/Fiws+J/dbC1LArIV3IRD7NDAXD0J2P51//tBTeZqtdzBtrqwyP+9GF+Vc2c//S FPZhHheHUcefAuG274JdR+jKCM5dzR5EAAu8Zi53ZgiyPS1B86o6vM9opiCUusW9SHVv pF3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version; bh=HkYS3Pvxzk9JnIpH6GH5uSSwiNn+6lI6tWyDSFxfOcA=; b=E2fvtl2/MYj3w4iuYc9uU1FJI3bzmogHM7waMxkpQ4QBSTd7O89vBBu125p7LThlOb hMheB/4Tkm/5jsmnZRSWOmxwIlDc8cDkT65D7Mb6UNNr3O3lajTEaW5GP5weKheHB61+ ziH0VDpKNKxgZDLpV8Cu90lMjvCRCdwYP9m5jRfd/I7q57o5b8+bI8QJVjsvgTQlUihh ak3DCQ8H6OFTQout7GFa6SPOXl6lQ5VSJkUvv8/a3wuvvd7hh6pNNacSWj++AO0JXS52 fkDeZKDo/TJTRB0x1lRERogp3PQNZ8rKqUrHTAhLqVDWK9sKeEfTq1LCDZHZmD+h4Tzb YmoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7-20020a170902f68700b0016c0b0faa7csi5786210plg.219.2022.07.08.02.35.24; Fri, 08 Jul 2022 02:35:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237671AbiGHJG3 (ORCPT + 99 others); Fri, 8 Jul 2022 05:06:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230230AbiGHJG2 (ORCPT ); Fri, 8 Jul 2022 05:06:28 -0400 Received: from mailout-taastrup.gigahost.dk (mailout-taastrup.gigahost.dk [46.183.139.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 253AC1FCDB; Fri, 8 Jul 2022 02:06:27 -0700 (PDT) Received: from mailout.gigahost.dk (mailout.gigahost.dk [89.186.169.112]) by mailout-taastrup.gigahost.dk (Postfix) with ESMTP id DB73F1887457; Fri, 8 Jul 2022 09:06:24 +0000 (UTC) Received: from smtp.gigahost.dk (smtp.gigahost.dk [89.186.169.109]) by mailout.gigahost.dk (Postfix) with ESMTP id D3BF425032B7; Fri, 8 Jul 2022 09:06:24 +0000 (UTC) Received: by smtp.gigahost.dk (Postfix, from userid 1000) id CA8D7A1E00AE; Fri, 8 Jul 2022 09:06:24 +0000 (UTC) X-Screener-Id: 413d8c6ce5bf6eab4824d0abaab02863e8e3f662 MIME-Version: 1.0 Date: Fri, 08 Jul 2022 11:06:24 +0200 From: netdev@kapio-technology.com To: Vladimir Oltean Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Andrew Lunn , Vivien Didelot , Florian Fainelli , Eric Dumazet , Paolo Abeni , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Shuah Khan , Daniel Borkmann , Ido Schimmel , linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v4 net-next 3/6] drivers: net: dsa: add locked fdb entry flag to drivers In-Reply-To: <20220708084904.33otb6x256huddps@skbuf> References: <20220707152930.1789437-1-netdev@kapio-technology.com> <20220707152930.1789437-4-netdev@kapio-technology.com> <20220708084904.33otb6x256huddps@skbuf> User-Agent: Gigahost Webmail Message-ID: X-Sender: netdev@kapio-technology.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,FROM_FMBLA_NEWDOM, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-07-08 10:49, Vladimir Oltean wrote: > Hi Hans, > > On Thu, Jul 07, 2022 at 05:29:27PM +0200, Hans Schultz wrote: >> Ignore locked fdb entries coming in on all drivers. >> >> Signed-off-by: Hans Schultz >> --- > > A good patch should have a reason for the change in the commit message. > This has no reason because there is no reason. > > Think about it, you've said it yourself in patch 1: > > | Only the kernel can set this FDB entry flag, while userspace can read > | the flag and remove it by replacing or deleting the FDB entry. > > So if user space will never add locked FDB entries to the bridge, > then FDB entries with is_locked=true are never transported using > SWITCHDEV_FDB_ADD_TO_DEVICE to drivers, and so, there is no reason at > all to pass is_locked to drivers, just for them to ignore something > that > won't appear. Correct me if I am wrong, but since the bridge can add locked entries, and the ensuring fdb update will create a SWITCHDEV_FDB_ADD_TO_DEVICE, those entries should reach the driver. The policy to ignore those in the driver can be seen as either the right thing to do, or not yet implemented. I remember Ido wrote at a point that the scheme they use is to trap various packets to the CPU and let the bridge add the locked entry, which I then understand is sent to the driver with a SWITCHDEV_FDB_ADD_TO_DEVICE event. > > You just need this for SWITCHDEV_FDB_ADD_TO_BRIDGE, so please keep it > only in those code paths, and remove it from net/dsa/slave.c as well. > >> drivers/net/dsa/b53/b53_common.c | 5 +++++ >> drivers/net/dsa/b53/b53_priv.h | 1 + >> drivers/net/dsa/hirschmann/hellcreek.c | 5 +++++ >> drivers/net/dsa/lan9303-core.c | 5 +++++ >> drivers/net/dsa/lantiq_gswip.c | 5 +++++ >> drivers/net/dsa/microchip/ksz9477.c | 5 +++++ >> drivers/net/dsa/mt7530.c | 5 +++++ >> drivers/net/dsa/mv88e6xxx/chip.c | 5 +++++ >> drivers/net/dsa/ocelot/felix.c | 5 +++++ >> drivers/net/dsa/qca8k.c | 5 +++++ >> drivers/net/dsa/sja1105/sja1105_main.c | 5 +++++ >> include/net/dsa.h | 1 + >> net/dsa/switch.c | 4 ++-- >> 13 files changed, 54 insertions(+), 2 deletions(-)