Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5390037rwb; Tue, 17 Jan 2023 13:06:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXt0Evg7xTiDZ1KT604NgqwXndzTzgyWoI4AZWJ1QJ26vfpM8v3zfXiG8EJ7l0w7tw7qHbQh X-Received: by 2002:a05:6a21:398b:b0:b6:a58c:d01 with SMTP id ad11-20020a056a21398b00b000b6a58c0d01mr4712277pzc.30.1673989600660; Tue, 17 Jan 2023 13:06:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673989600; cv=none; d=google.com; s=arc-20160816; b=O2cZ1zrxEO0q2Kx0zBxjZiOZJT0A0treAZOaTv8lGboSlE7XyHfczCBjWbOVAIAYpF 57T2DbZboVt72ZxNl7Qk5ZTzV3e/lTI+ytfDDeY+pYktsue0js6iS8l3Inj0QccaUQpE ht7KKpKZ5qm6NBeQspUYCD2yWYF1OGwB/5nk0JkExYQm/+e5n5tMMKeAtTwcRtYFKMFx vUpiPEg8skgRmwz+r+1R59EI+DcM/Z9+3VsogqY4OPyMcnHpgnzhVBakN9f+Oc3WLjAo bH1epGXW+YZ9pKgguLySvXny6DH9nvKXcayKDyxWoxM+j7LHb+yyHd8L3Ivh/WnINMAY uF5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:message-id:date:subject:cc:to:from; bh=HfdIqG8/Q0woghbu01MzM1vhtjvhCMDSUJ5G+aREKWg=; b=X58UoAFXRh2ewR6uwhYCRylCYONK+Xax8XNtNvhnvz6pKFCxohlEIq390v29vmxpYO omhLx4U0xkSH42qewQMTHtPaTKrlR7qhyyyK3tsGLPnaJCjbPnJiGOFuvkp39+nZGiy2 PAL4sv8jUSv/o0qEBsTuK/jIHIILrYaO+SbtJNxeehkxETnlsUKIyy09vwPyyZZhWgV1 n/XWZyoV/p2F9L6Fa9tjpBxyqzohDwz0ZWgvGF1in6AA/3cdvNeZvh+FfhNgTTYqGXr8 79orSjrGeoW0x7MZaggbYQtLHX3ddflWpWAoi2TQHfAXn0xf2/0ixc+4TH38QvOxupw9 /anA== 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 j24-20020a63cf18000000b004b675a3de36si22003322pgg.531.2023.01.17.13.06.34; Tue, 17 Jan 2023 13:06:40 -0800 (PST) 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 S232442AbjAQUyN (ORCPT + 47 others); Tue, 17 Jan 2023 15:54:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235166AbjAQUtW (ORCPT ); Tue, 17 Jan 2023 15:49:22 -0500 Received: from mailout-taastrup.gigahost.dk (mailout-taastrup.gigahost.dk [46.183.139.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 937C047426; Tue, 17 Jan 2023 11:25:07 -0800 (PST) Received: from mailout.gigahost.dk (mailout.gigahost.dk [89.186.169.112]) by mailout-taastrup.gigahost.dk (Postfix) with ESMTP id 6717018835E1; Tue, 17 Jan 2023 18:59:12 +0000 (UTC) Received: from smtp.gigahost.dk (smtp.gigahost.dk [89.186.169.109]) by mailout.gigahost.dk (Postfix) with ESMTP id 55926250007B; Tue, 17 Jan 2023 18:59:12 +0000 (UTC) Received: by smtp.gigahost.dk (Postfix, from userid 1000) id 4C2739EC000B; Tue, 17 Jan 2023 18:59:12 +0000 (UTC) X-Screener-Id: 413d8c6ce5bf6eab4824d0abaab02863e8e3f662 Received: from fujitsu.vestervang (2-104-116-184-cable.dk.customer.tdc.net [2.104.116.184]) by smtp.gigahost.dk (Postfix) with ESMTPSA id A051B91201DF; Tue, 17 Jan 2023 18:59:11 +0000 (UTC) From: "Hans J. Schultz" To: davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, "Hans J. Schultz" , Florian Fainelli , Andrew Lunn , Vladimir Oltean , Eric Dumazet , Paolo Abeni , Kurt Kanzenbach , Hauke Mehrtens , Woojung Huh , UNGLinuxDriver@microchip.com (maintainer:MICROCHIP KSZ SERIES ETHERNET SWITCH DRIVER), Sean Wang , Landen Chao , DENG Qingfang , Matthias Brugger , Claudiu Manoil , Alexandre Belloni , =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Russell King , Christian Marangi , linux-kernel@vger.kernel.org (open list), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-mediatek@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-renesas-soc@vger.kernel.org (open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER), bridge@lists.linux-foundation.org (moderated list:ETHERNET BRIDGE) Subject: [RFC PATCH net-next 0/5] ATU and FDB synchronization on locked ports Date: Tue, 17 Jan 2023 19:57:09 +0100 Message-Id: <20230117185714.3058453-1-netdev@kapio-technology.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Organization: Westermo Network Technologies AB Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham 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 This patch set makes it possible to have synchronized dynamic ATU and FDB entries on locked ports. As locked ports are not able to automatically learn, they depend on userspace added entries, where userspace can add static or dynamic entries. The lifetime of static entries are completely dependent on userspace intervention, and thus not of interest here. We are only concerned with dynamic entries, which can be added with a command like: bridge fdb replace ADDR dev master dynamic We choose only to support this feature on locked ports, as it involves utilizing the CPU to handle ATU related switchcore events (typically interrupts) and thus can result in significant performance loss if exposed to heavy traffic. On locked ports it is important for userspace to know when an authorized station has become silent, hence not breaking the communication of a station that has been authorized based on the MAC-Authentication Bypass (MAB) scheme. Thus if the station keeps being active after authorization, it will continue to have an open port as long as it is active. Only after a silent period will it have to be reauthorized. As the ageing process in the ATU is dependent on incoming traffic to the switchcore port, it is necessary for the ATU to signal that an entry has aged out, so that the FDB can be updated at the correct time. This patch set includes a solution for the Marvell mv88e6xxx driver, where for this driver we use the Hold-At-One feature so that an age-out violation interrupt occurs when a station has been silent for the system-set age time. The age out violation interrupt allows the switchcore driver to remove both the ATU and the FDB entry at the same time. It is up to the maintainers of other switchcore drivers to implement the feature for their specific driver. Hans J. Schultz (5): net: bridge: add dynamic flag to switchdev notifier net: dsa: propagate flags down towards drivers drivers: net: dsa: add fdb entry flags incoming to switchcore drivers net: bridge: ensure FDB offloaded flag is handled as needed net: dsa: mv88e6xxx: implementation of dynamic ATU entries drivers/net/dsa/b53/b53_common.c | 12 ++++- drivers/net/dsa/b53/b53_priv.h | 4 +- drivers/net/dsa/hirschmann/hellcreek.c | 12 ++++- drivers/net/dsa/lan9303-core.c | 12 ++++- drivers/net/dsa/lantiq_gswip.c | 12 ++++- drivers/net/dsa/microchip/ksz9477.c | 8 ++-- drivers/net/dsa/microchip/ksz9477.h | 8 ++-- drivers/net/dsa/microchip/ksz_common.c | 14 ++++-- drivers/net/dsa/mt7530.c | 12 ++++- drivers/net/dsa/mv88e6xxx/chip.c | 24 ++++++++-- drivers/net/dsa/mv88e6xxx/global1_atu.c | 21 +++++++++ drivers/net/dsa/mv88e6xxx/port.c | 6 ++- drivers/net/dsa/mv88e6xxx/switchdev.c | 61 +++++++++++++++++++++++++ drivers/net/dsa/mv88e6xxx/switchdev.h | 5 ++ drivers/net/dsa/mv88e6xxx/trace.h | 5 ++ drivers/net/dsa/ocelot/felix.c | 12 ++++- drivers/net/dsa/qca/qca8k-common.c | 12 ++++- drivers/net/dsa/qca/qca8k.h | 4 +- drivers/net/dsa/rzn1_a5psw.c | 12 ++++- drivers/net/dsa/sja1105/sja1105_main.c | 19 ++++++-- include/net/dsa.h | 6 ++- include/net/switchdev.h | 1 + net/bridge/br_fdb.c | 5 +- net/bridge/br_switchdev.c | 1 + net/dsa/port.c | 28 +++++++----- net/dsa/port.h | 8 ++-- net/dsa/slave.c | 17 +++++-- net/dsa/switch.c | 30 ++++++++---- net/dsa/switch.h | 1 + 29 files changed, 298 insertions(+), 74 deletions(-) -- 2.34.1