Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3344896rwb; Fri, 30 Sep 2022 02:05:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5rc/3fygj4bRqArUpafOR74Z/o98ZsnIZzdEWEAsP6nk1cUiSvjxDcE+wMxgyV5ugmelz4 X-Received: by 2002:a05:6402:350b:b0:452:2b68:90db with SMTP id b11-20020a056402350b00b004522b6890dbmr7132319edd.255.1664528725525; Fri, 30 Sep 2022 02:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664528725; cv=none; d=google.com; s=arc-20160816; b=BEevCs5xWTxU8F4qOp/V3/B+a70+qvuT8pa+uKVqhpQZ2aMra6YHWaDkmV/NLgyBBO I1SsOiJXbj2u6I1CCqvY+zu5NwEGjjQbT5bethZ5VgajczTc/Jc4qcTFthOV9ESWxvcJ 5EnssMNP1Nkf8VTHZAj4LfWNJ5aQmDYQgsGS4nRT7yVr6MaWhbwwmnSxYT68WKd2lHGH TYS5dlXVxr8cFb3phmR/FrAZIy+p4U4wGjgtXW9YCkj4YcpEBMVkqk5f/0oPzlgZbo1v kdLXH3+rgfQOEhFgoqFbi9AhX2DPxHr9DmSU2kPyaIrcMSDja3pZW0tlzIX8xlAslGdT 8oTw== 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=m2jq0OeWhMg+KIaN6zH68/vTIbdSRttwfGzN+F98s/s=; b=nEi19QQBRZJxhuwvApTu62PUJ7kSE4u4nqVyNsyzKI//Qp/U2HA2Uhx4yHd4Xv7iRa VemlBdd9JJ+BAc2y6zl3TU5SicmE1fl7cgATb1KMw35+tu4ZUSvmUKlmWpxbbWBWSknd AyBDqsv/r5Ngh4H2IzIEDgEoqi9QHw4AiyZuWroizvwz02t4zMFyuDumFviFJt2BtVM8 ZhzhY6ElfMJcPoAygPtAtANtFeS/M+i004O5dYxESyOXmlcNI3WyB5k+G54Xi5j7tX7l Z7qrGC+6bwA7xO9gYR3HdeT0hq09aHBePnL+YOKexHcDHT9oe0+DLD1wQhXKqKE8wB1L nhyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=UyWKhOxu; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wy4-20020a170906fe0400b0078009f425efsi1613264ejb.138.2022.09.30.02.04.59; Fri, 30 Sep 2022 02:05:25 -0700 (PDT) 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=UyWKhOxu; 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 S229498AbiI3Ici (ORCPT + 99 others); Fri, 30 Sep 2022 04:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230256AbiI3Icd (ORCPT ); Fri, 30 Sep 2022 04:32:33 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E7903AE7C; Fri, 30 Sep 2022 01:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1664526750; x=1696062750; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=V8b0GVjrIXaRPpRlaBUOD4E08uZuA6csHqP34esyS3w=; b=UyWKhOxuvzu+1rjgLrBcH48fg5kfeGtt0o/E7SHjDgrE1F7RHbHGzidj XyWdq46R/iSjB4dhib46DzDHN1kwXObvJgZbVNvc/Kcm5f0PDYaCrH0US 4wV3IqiOe+1BDRVThNqed2pmy8/I8ds+PNpT4Tpc9wK8M5T62zkmRVzhd +8epDskvP36of9EcqVO50k5Fd8krgFB3VUP4qwsig0GuD27aDzeYfwsa8 lppQGGoSs7quByXQUliTdC/AgtbAhxcvduMjmRaR6ydoTyILTF9IlIdkc QNnGNhfLk1d2VKMlV+KQc8Spu4CkVhSicC3biyPtdtuWsjujjU9vQU+Gw Q==; X-IronPort-AV: E=Sophos;i="5.93,357,1654585200"; d="scan'208";a="116203006" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 30 Sep 2022 01:32:28 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 30 Sep 2022 01:32:29 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 30 Sep 2022 01:32:27 -0700 From: Horatiu Vultur To: , CC: , , , , , , Horatiu Vultur Subject: [PATCH net-next 0/2] net: lan966x: Add police and mirror using tc-matchall Date: Fri, 30 Sep 2022 10:35:38 +0200 Message-ID: <20220930083540.347686-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 Add tc-matchall classifier offload support both for ingress and egress. For this add support for the port police and port mirroring action support. Port police can happen only on ingress while port mirroring is supported both on ingress and egress Horatiu Vultur (2): net: lan966x: Add port police support using tc-matchall net: lan966x: Add port mirroring support using tc-matchall .../net/ethernet/microchip/lan966x/Makefile | 3 +- .../ethernet/microchip/lan966x/lan966x_main.h | 44 ++++ .../microchip/lan966x/lan966x_mirror.c | 138 ++++++++++ .../microchip/lan966x/lan966x_police.c | 235 ++++++++++++++++++ .../ethernet/microchip/lan966x/lan966x_regs.h | 96 +++++++ .../ethernet/microchip/lan966x/lan966x_tc.c | 50 ++++ .../microchip/lan966x/lan966x_tc_matchall.c | 95 +++++++ 7 files changed, 660 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ethernet/microchip/lan966x/lan966x_mirror.c create mode 100644 drivers/net/ethernet/microchip/lan966x/lan966x_police.c create mode 100644 drivers/net/ethernet/microchip/lan966x/lan966x_tc_matchall.c -- 2.33.0