From patchwork Tue Dec 14 13:45:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kurt Kanzenbach X-Patchwork-Id: 12676015 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82CDBC4332F for ; Tue, 14 Dec 2021 13:45:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234546AbhLNNpk (ORCPT ); Tue, 14 Dec 2021 08:45:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234548AbhLNNpi (ORCPT ); Tue, 14 Dec 2021 08:45:38 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59809C061574 for ; Tue, 14 Dec 2021 05:45:38 -0800 (PST) From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1639489537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=26GwEMF7AGneK4l0UHeYTB845ctWzrnTU2d7an7yp9o=; b=bYrFwUt0cosW/ISGRM0QzXWaPDUcnQEMHgJgR0JYUGMdvKZLMfv0jyINxikqsdcYwcFnkE pcRUBRidvOhSpTevCN2cSECFsll+rPHBYuZe/rbmEEViJ3Wcp9LYIi908nk413OJz403X8 /SngImZsCKXyfv0JPjAfmTQ6O5nu1yFcO3c82jhbfHZguTY2ZqwREW5hCmgM+Pu6BcnHBR ZQXkfT7HqKF7aRHEgwGSHiWITvC2DONjRaiKdgezx30EB/fH7h1eFnECtxMup+oQdMhu2c hY6i9S2aui1WAgrhTB6q2t9OMhebxjEuEmNvxMmev4690OnovJVvG07bMfN19A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1639489537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=26GwEMF7AGneK4l0UHeYTB845ctWzrnTU2d7an7yp9o=; b=zNHyntp44BbWYLC4cdzF9NKQ6MGYu1dEIj6qBJfrngGqGrWg/aFAeMKQLrbogHDaj+E7n+ iiTxiS5PgY8BExAw== To: "David S. Miller" , Jakub Kicinski Cc: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Richard Cochran , Kamil Alkhouri , netdev@vger.kernel.org, Kurt Kanzenbach Subject: [PATCH net-next v2 2/4] net: dsa: hellcreek: Add STP forwarding rule Date: Tue, 14 Dec 2021 14:45:06 +0100 Message-Id: <20211214134508.57806-3-kurt@linutronix.de> In-Reply-To: <20211214134508.57806-1-kurt@linutronix.de> References: <20211214134508.57806-1-kurt@linutronix.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Treat STP as management traffic. STP traffic is designated for the CPU port only. In addition, STP traffic has to pass blocked ports. Fixes: e4b27ebc780f ("net: dsa: Add DSA driver for Hirschmann Hellcreek switches") Signed-off-by: Kurt Kanzenbach Reviewed-by: Vladimir Oltean --- drivers/net/dsa/hirschmann/hellcreek.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c index c4f840b20adf..17d3a4a3582e 100644 --- a/drivers/net/dsa/hirschmann/hellcreek.c +++ b/drivers/net/dsa/hirschmann/hellcreek.c @@ -1075,6 +1075,17 @@ static int hellcreek_setup_fdb(struct hellcreek *hellcreek) .reprio_tc = 6, /* TC: 6 as per IEEE 802.1AS */ .reprio_en = 1, }; + static struct hellcreek_fdb_entry stp = { + /* MAC: 01-80-C2-00-00-00 */ + .mac = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 }, + .portmask = 0x03, /* Management ports */ + .age = 0, + .is_obt = 0, + .pass_blocked = 1, + .is_static = 1, + .reprio_tc = 6, + .reprio_en = 1, + }; int ret; mutex_lock(&hellcreek->reg_lock); @@ -1082,6 +1093,9 @@ static int hellcreek_setup_fdb(struct hellcreek *hellcreek) if (ret) goto out; ret = __hellcreek_fdb_add(hellcreek, &p2p); + if (ret) + goto out; + ret = __hellcreek_fdb_add(hellcreek, &stp); out: mutex_unlock(&hellcreek->reg_lock);