From patchwork Fri Dec 2 07:56:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 13062340 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E3A05C4332F for ; Fri, 2 Dec 2022 07:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4ai/d6lWA4Xj3XW3w/yWmtpUwvJRJqsldBiPokDoQQA=; b=p4DBMfib0FezjV mASjSstidYjZEeFuED7RHaIqQqieYhzQ4T1QHQw45dqjP0uzwYlniBjhywjntD148rT1gbwYaDEMb a/Je9xoghFXDIrn/VKW7wKP//P+ded/6OoMyrdXXdRo0EQwFQ0gkODiiVMSQa/ohlhfKeA1DgAbMz 4W7SzJFvMkfKfKsozs1Pmqa7HBH0qVKg7Mh+oR/M1ziX3ntWp7xPBHvED43BeN2KwoHrVJJDVUwej rB8JvM1m1ecnuSQ97SVxVo1vAfSKniSXTZBjrpZOy++0vvaVYfavpMnVdHPuzrdD8N/eiMvIDTDCf jJbHNUr1aeD3MxiZy04g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p10pa-00EG9l-SX; Fri, 02 Dec 2022 07:51:34 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p10pW-00EG6S-TY for linux-arm-kernel@lists.infradead.org; Fri, 02 Dec 2022 07:51:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1669967490; x=1701503490; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=rbRgJC5OGOpM1O9o3ILlJTLdncz7C20gbr77o1yERhk=; b=mq6SELJNi3eDuRBPEHLTCRF7nx2GoGbyKf6/qXzUdR7gcHY7hD3MWXbE vXZ8wijUEabj8LHsDp2oMd0e4FudVTK5PRt8fMxIjB1Sb2d2nrYa3y8wJ mQ8gMTm1hq15kS8w8JAE7Us+1qxVErGj+ZEEyIA7NjgcMw4o0W+LTrDU6 hnLZNApm8L3Wf6+UkW8gI2xfMkuDAGWColeW9cg2VSOwA/jiblzBF1r8N 3vQcE+nMC0FZdMmHRXTInj/lcK1fv+ri6Ede5diF9GWHvaGJpMIw26fYL NcAXB76d1pmqSiVOLE4HHv6t/9zLAnzoipAKNoiheQz9Pv+Y3QHnIuXXT A==; X-IronPort-AV: E=Sophos;i="5.96,210,1665471600"; d="scan'208";a="126141868" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Dec 2022 00:51:26 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 2 Dec 2022 00:51:24 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 2 Dec 2022 00:51:21 -0700 From: Horatiu Vultur To: , , CC: , , , , , , , , , , Horatiu Vultur Subject: [PATCH net-next v2 0/4] net: lan966x: Enable PTP on bridge interfaces Date: Fri, 2 Dec 2022 08:56:17 +0100 Message-ID: <20221202075621.1504908-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221201_235131_054956_5C8C659E X-CRM114-Status: GOOD ( 10.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Before it was not allowed to run ptp on ports that are part of a bridge because in case of transparent clock the HW will still forward the frames so there would be duplicate frames. Now that there is VCAP support, it is possible to add entries in the VCAP to trap frames to the CPU and the CPU will forward these frames. The first part of the patch series, extends the VCAP support to be able to modify and get the rule, while the last patch uses the VCAP to trap the ptp frames. v1->v2: - use PTP_EV_PORT and PTP_GEN_PORT instead of hardcoding the number - small alignment adjustments Horatiu Vultur (4): net: microchip: vcap: Add vcap_get_rule net: microchip: vcap: Add vcap_mod_rule net: microchip: vcap: Add vcap_rule_get_key_u32 net: lan966x: Add ptp trap rules .../ethernet/microchip/lan966x/lan966x_main.c | 19 +- .../ethernet/microchip/lan966x/lan966x_main.h | 14 + .../ethernet/microchip/lan966x/lan966x_ptp.c | 236 ++++- .../microchip/lan966x/lan966x_tc_flower.c | 8 - .../microchip/lan966x/lan966x_vcap_impl.c | 11 +- .../net/ethernet/microchip/vcap/vcap_api.c | 824 ++++++++++++++++++ .../ethernet/microchip/vcap/vcap_api_client.h | 8 + .../microchip/vcap/vcap_api_debugfs.c | 492 ++--------- .../microchip/vcap/vcap_api_private.h | 14 + 9 files changed, 1171 insertions(+), 455 deletions(-)