From patchwork Wed Nov 30 14:35:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 2430 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp960426wrr; Wed, 30 Nov 2022 06:35:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf7M1I8mVYW3mx/H1Czr3816t0JuYSyVCS0puiRDO+uO/loJNOfxx0CfD2jOKMm15JpBuglj X-Received: by 2002:a63:1e50:0:b0:46f:81cb:6d76 with SMTP id p16-20020a631e50000000b0046f81cb6d76mr36757345pgm.599.1669818949532; Wed, 30 Nov 2022 06:35:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669818949; cv=none; d=google.com; s=arc-20160816; b=UGxjANnhRgGJ5dvDI8R/Xf0gqEwIyuO/ziaZTKe/jCZjNmaG/6RaCSVDFNjJtMoUpx S+BneociMmtNSbpYvZmE9DEV2vegEEP6FKG5pLdBopEN108Dsh+AjdZe5D9I/YLd6nXg nnSjAFFC4Allpy1nrveFd+fA6UexOCYRcFbToxtuUNdwgQq52P67wdn8x2yyakYB1EEZ 83ndDdj8660IkUBFrSdcY8VdFp1OOvaYZ2rL6+85xIPtLzYMJmE1M7WEyVS/UU1NTzX7 cgSsZEe1PS5xGEnnVylEKShWSicZbbhFBr8gihHmdeqsxNxYg+mnonl5ZJtjhjA4cx8x /Ulg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=ikmLCxCkyQMK2jfYTfaM7Jt84Kni5U6l+OOAjbI3TDI=; b=LYpjxhbOa9zZsILypHGCR0+bamU+nKdO7XkJU2x0KrEndWUdTFEk8FLUnThwMRqMMr Gql90BpKQy7dkSoiylTOVcYCsLpITFb5DtYTsIYT+F+2mGjLnLuvIxCn3X5ZHYwlA7qu uR4jF7eOi6s8SIjAA+9/O14UTrF7XvbbI/yQuU2vSrOjOmoVEpJsZjB8rWlvZ3VRIfk5 nTRNsoeczQYHc+cMLS7nxu5KSm4xuxbi8yaSJnpGH20MiI/kB0z9Cn7Ze0FKjB8y5hKY deQ6vPNCw6LaQCVIyI4EKXQu57wUD6n28ZQzlD3YB/EBouVD7OI/9XinKURPn9yZdMUZ 8JqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=oxCRsjXM; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t20-20020a170902e1d400b00188d6e1b831si1264522pla.298.2022.11.30.06.35.36; Wed, 30 Nov 2022 06:35:49 -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; dkim=pass header.i=@microchip.com header.s=mchp header.b=oxCRsjXM; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229861AbiK3Ocv (ORCPT + 99 others); Wed, 30 Nov 2022 09:32:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229972AbiK3OcT (ORCPT ); Wed, 30 Nov 2022 09:32:19 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 127046177A; Wed, 30 Nov 2022 06:32:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1669818724; x=1701354724; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xNeeYKcuuL17q/h3xuxpvAFdAFsSZaH6f0KB/erzzB0=; b=oxCRsjXMXpGU2Jb0FDeL7UvACygGvcA7+OrAOyTOweNiGgB+FW1b0gpA j44I7pT92glRUo4/c120QIE4mTmhnycfnsc985YVGcabeso31xLuL/OLL n8CznLJPGkcvNIHR0Kgr+psiikcktz7cIy44DDIiBpwriOMgd8K8Xyg98 WGLm+m9SEdXw01vWGKtQ/H0TptdPQMcYT9xuLV+LeHJ+QMB80o6PlHPhI 4DafXul2h55wJQAl3qBokonaTkrBJn3b4n64vQ1dzuBGqux53rxXnymkb sp8oFbXaluA/YB8PXx2AgEvfyQp3onyuHJ9Rn3YDaVXK8HwikZXDIwP9m A==; X-IronPort-AV: E=Sophos;i="5.96,206,1665471600"; d="scan'208";a="191144748" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 30 Nov 2022 07:30:28 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Wed, 30 Nov 2022 07:30:29 -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; Wed, 30 Nov 2022 07:30:26 -0700 From: Horatiu Vultur To: , , CC: , , , , , , , , , Horatiu Vultur Subject: [PATCH net-next 0/4] net: lan966x: Enable PTP on bridge interfaces Date: Wed, 30 Nov 2022 15:35:21 +0100 Message-ID: <20221130143525.934906-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750932074408789553?= X-GMAIL-MSGID: =?utf-8?q?1750932074408789553?= 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. 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 | 237 ++++- .../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, 1172 insertions(+), 455 deletions(-)