Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3653632pxb; Mon, 24 Jan 2022 14:31:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjLbpZPXW9s6VuM0+4nkA30PAMguyzo2hLGIKv9u0v8vvgrmHa4fnjbC5kK00Rcx0SWaYt X-Received: by 2002:a65:5887:: with SMTP id d7mr6584128pgu.503.1643063492455; Mon, 24 Jan 2022 14:31:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643063492; cv=none; d=google.com; s=arc-20160816; b=gtUCtTnhB7IOenSJKX5uae3AztKV7bCrriI31URYnd2nlEpKI1SCQiGaQxSW9VJ2o9 3v2RXYVT794mVCown53EB1kaG2T3gym+5AL7LRtt0yFUnybHkyCktwcVTC9WQGd9q8yF LOcem+HOesJR7MCJkRmtTqal2GvKSQoHwCFRLvC+Up6JmRWwGGADOf2J4O5+XXYCngPa QQQg4kTAXyHcz5vx9bk1xhXMUhFP0U+SKZiqNs1d1vDcYT9tYi9wZ2oykJHZOQGiAFgJ djTOiH4LFC+rqpNDzmgNAvJXV4m+BoVr2EIdgv4dzcMWcNZ7gmQQYF9zCXilwpDSi6Xy z+Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NfyvzS0bEBBI/tNZi/ShgljbzqUqLZRFqN2yHL9jQvg=; b=AAcZ7HQr3S4aBt38wV9t5oqFvlFVSSY7t/5vF7HxEa1yBhEWkq9tRL7nDVr/41K1Wk doXFcSBSy5nwaeaEuoSFcaq/ZpQD9iCjZteweyHlMk00LspdmQAb3qhKzJRUZeP4BgXK 8+9yl2Pea6SYxJ+wgr5tBaFgB4pQexUkb1lzi4+Ut2XFWcXD+6kNiw3XDVt7BWyMjgiA idxbysvefNaOAvlR5PekzFOfWNoGsL2qdQcvPcFQFvK8UT4zM3tmfFtA9U3pSUzt+ynP +VodRRp+ofsQicHDVSTXcan70J8jFcsuhperdd+9u4v11lKLR3PBzDLlxxT1GvAoRNC7 e0Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gGD+t2ek; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si13574291plt.223.2022.01.24.14.31.20; Mon, 24 Jan 2022 14:31:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gGD+t2ek; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1587552AbiAXW2l (ORCPT + 99 others); Mon, 24 Jan 2022 17:28:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1455566AbiAXVfj (ORCPT ); Mon, 24 Jan 2022 16:35:39 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1319C05A184; Mon, 24 Jan 2022 12:22:25 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 99AC7B81229; Mon, 24 Jan 2022 20:22:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D099DC340EB; Mon, 24 Jan 2022 20:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055743; bh=cGgoof5YZQNjDLD4VVh3KObatYUecWRFuj1h/IvavaI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gGD+t2ekRJDx67fvkh7cEPhyhGBO/fHk12S3nRIe2Zsowelp4dKe+HRIYisYvexr1 K3tmR4eHgdeln7HBUVXXeRnqdwiD/AsC4/XcIKvLyT1n13qWB2BlHg94MAAbtmjykj ldQRCXt0UmimdgTrC74ssbDEEqktyzEEDbKRZv2w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kurt Kanzenbach , Richard Cochran , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 250/846] net: dsa: hellcreek: Add missing PTP via UDP rules Date: Mon, 24 Jan 2022 19:36:07 +0100 Message-Id: <20220124184109.573560127@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kurt Kanzenbach [ Upstream commit 6cf01e451599da630ff1af529d61c5e4db4550ab ] The switch supports PTP for UDP transport too. Therefore, add the missing static FDB entries to ensure correct forwarding of these packets. Fixes: ddd56dfe52c9 ("net: dsa: hellcreek: Add PTP clock support") Signed-off-by: Kurt Kanzenbach Acked-by: Richard Cochran Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/dsa/hirschmann/hellcreek.c | 64 ++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c index 2dd1227e0c357..950a54ec4b59b 100644 --- a/drivers/net/dsa/hirschmann/hellcreek.c +++ b/drivers/net/dsa/hirschmann/hellcreek.c @@ -1052,7 +1052,7 @@ static void hellcreek_setup_tc_identity_mapping(struct hellcreek *hellcreek) static int hellcreek_setup_fdb(struct hellcreek *hellcreek) { - static struct hellcreek_fdb_entry ptp = { + static struct hellcreek_fdb_entry l2_ptp = { /* MAC: 01-1B-19-00-00-00 */ .mac = { 0x01, 0x1b, 0x19, 0x00, 0x00, 0x00 }, .portmask = 0x03, /* Management ports */ @@ -1063,7 +1063,29 @@ 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 p2p = { + static struct hellcreek_fdb_entry udp4_ptp = { + /* MAC: 01-00-5E-00-01-81 */ + .mac = { 0x01, 0x00, 0x5e, 0x00, 0x01, 0x81 }, + .portmask = 0x03, /* Management ports */ + .age = 0, + .is_obt = 0, + .pass_blocked = 0, + .is_static = 1, + .reprio_tc = 6, + .reprio_en = 1, + }; + static struct hellcreek_fdb_entry udp6_ptp = { + /* MAC: 33-33-00-00-01-81 */ + .mac = { 0x33, 0x33, 0x00, 0x00, 0x01, 0x81 }, + .portmask = 0x03, /* Management ports */ + .age = 0, + .is_obt = 0, + .pass_blocked = 0, + .is_static = 1, + .reprio_tc = 6, + .reprio_en = 1, + }; + static struct hellcreek_fdb_entry l2_p2p = { /* MAC: 01-80-C2-00-00-0E */ .mac = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e }, .portmask = 0x03, /* Management ports */ @@ -1074,6 +1096,28 @@ 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 udp4_p2p = { + /* MAC: 01-00-5E-00-00-6B */ + .mac = { 0x01, 0x00, 0x5e, 0x00, 0x00, 0x6b }, + .portmask = 0x03, /* Management ports */ + .age = 0, + .is_obt = 0, + .pass_blocked = 1, + .is_static = 1, + .reprio_tc = 6, + .reprio_en = 1, + }; + static struct hellcreek_fdb_entry udp6_p2p = { + /* MAC: 33-33-00-00-00-6B */ + .mac = { 0x33, 0x33, 0x00, 0x00, 0x00, 0x6b }, + .portmask = 0x03, /* Management ports */ + .age = 0, + .is_obt = 0, + .pass_blocked = 1, + .is_static = 1, + .reprio_tc = 6, + .reprio_en = 1, + }; static struct hellcreek_fdb_entry stp = { /* MAC: 01-80-C2-00-00-00 */ .mac = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 }, @@ -1088,10 +1132,22 @@ static int hellcreek_setup_fdb(struct hellcreek *hellcreek) int ret; mutex_lock(&hellcreek->reg_lock); - ret = __hellcreek_fdb_add(hellcreek, &ptp); + ret = __hellcreek_fdb_add(hellcreek, &l2_ptp); + if (ret) + goto out; + ret = __hellcreek_fdb_add(hellcreek, &udp4_ptp); + if (ret) + goto out; + ret = __hellcreek_fdb_add(hellcreek, &udp6_ptp); + if (ret) + goto out; + ret = __hellcreek_fdb_add(hellcreek, &l2_p2p); + if (ret) + goto out; + ret = __hellcreek_fdb_add(hellcreek, &udp4_p2p); if (ret) goto out; - ret = __hellcreek_fdb_add(hellcreek, &p2p); + ret = __hellcreek_fdb_add(hellcreek, &udp6_p2p); if (ret) goto out; ret = __hellcreek_fdb_add(hellcreek, &stp); -- 2.34.1