Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1139372lqb; Thu, 18 Apr 2024 00:51:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWtqNIxd2YcdxUrgcgMzqi8NHkZ02dcqR1o14LHXceoJIMfyDfWE+5Eu3bWt9gZ7tWMJW4cubbuTDuDD0FiA9N890NKV5MyJBWrnPaNaA== X-Google-Smtp-Source: AGHT+IFOzn9KD+mjZGNzpck7pyOpNdwA0IDJYnxbwgOcmxUiTfHdLB/ru2JnytynII9Ln1F17ngH X-Received: by 2002:a17:906:a2d5:b0:a55:5c3d:57e0 with SMTP id by21-20020a170906a2d500b00a555c3d57e0mr1138217ejb.16.1713426683039; Thu, 18 Apr 2024 00:51:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713426683; cv=pass; d=google.com; s=arc-20160816; b=Cy1ioduWv4vUyhOfLH6/8P3/5LGfH9wxILdvZ4djY0FBIXZ3ad/l3SecamifDyxAJB GanJg/nFqIL8B40ARsl4b4Tzkg2RCiBIzlaWqpa44lhiw7OYlYl40r+EL0hu/P+qT2ub MeK2jf5cZCtagqBhcHppNCtklKz0SojIlu2voyKtdJejlMlEy5E5gYfVIaIsY8FaZ73V D1nAXsrUAf8MLVneEI/hDgIrv6RsVrvbu5suUZWAWRZCJo/hpnDwDmxE4226aUtnBaiS tYEpAgSkCj93W2bQ/WE+ZnPco2jDEUvZXyNpc95gL6diGIRKrPwiUT0dKb889pQu9xGo LgOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=ZuGl1wnCDLwiOGSyrlf2zvhkdEWmsKd/vvPbi9H709s=; fh=UQq7t8uvK2iUNO1MW2Ou8S2LAb+LVP9puPAKMbRd+Ns=; b=ht2jK2ETaMqE1r8w8Jk0AISo6R0ielFNXhGRt09QvOjcjId5R0+Vf+cRVvwdyHLcvr 2B4VHooBePnOfcY4tMfy9rWLpcv6C4WuskUzBjyq39a7HUhYV6wbLH8MQ3GvJGBvrXbK OgGOlA3A3ydTPfCQg6ag+6YhCfD1RFI8tUKyLiSWEhyRAJyYvRuv2h2hKPMHWDTSmR6j 1xE0MARgYIJexyXDZJfiQ54tdGrwWgNHAMfXXC5nNQKLnad5sbje9wgM3SXFVnVI/k5E 7fMENnlPHxdw0J7cLXmAaLM/L+nqIV2P6zbTLVOSiO+tzsM6K15yVR72jbg+qy4y5fWP lLbw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=loAR97z9; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-149677-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149677-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id md8-20020a170906ae8800b00a52362491a2si552451ejb.136.2024.04.18.00.51.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 00:51:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149677-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=loAR97z9; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-149677-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149677-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8A34F1F21D2A for ; Thu, 18 Apr 2024 07:51:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED6CA75804; Thu, 18 Apr 2024 07:51:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="loAR97z9" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A321F36B01; Thu, 18 Apr 2024 07:51:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713426670; cv=none; b=pxfRFWSPU615FFDPX8WwTf0cDxowdKF37mOGWgQgL+5pvLxWA4hc/mP2ld7yQb8EZsg11jitdy5juzmJkjsHnnutL/FImU+edvXOcjS2UWzhHUzFDQLBKfyvnOh0RqTF91wZdpIMfFLC2g7vh4lNHojzFHj/l4NaApEJ/ZrJb08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713426670; c=relaxed/simple; bh=UAUIMBoGKJ6QxfnS0oTaue67w/jDTN5ouNW6IIvNw2I=; h=From:Subject:Date:Message-ID:MIME-Version:Content-Type:To:CC; b=W2SN3rDBE/vRWdaa9Hqw66Ht3245/usr30oXsSWNmbxH33lZuKdYx+q128FjSQ4vwwXAH3CVTqv6EudUIh5oG3e+HN/c2sC6Tg7pXf2e8VwPfPbnrN9AQUC2kXmMyVT7krE5jWbhc5wDoRTLHrzVUjGcjndX3qjsXZ8CeZqDa+U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=loAR97z9; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1713426668; x=1744962668; h=from:subject:date:message-id:mime-version: content-transfer-encoding:to:cc; bh=UAUIMBoGKJ6QxfnS0oTaue67w/jDTN5ouNW6IIvNw2I=; b=loAR97z9hHrE3WLzyA+Y/4tX6aH+1ZaLG/ERFF6+2nPuXTrvmUH2kNtv BZU7J0Mhwh4TONGlVWXC5yRFxI9BuV3vOAO48aUBcnu+xLziNaG/ETQtv 16yganiCPqpJvwLEtydynqXJJjWVOvXYoyppIpXVoNCrFsrYENA4pifBq 2HkuA59V6EaLfb//3JFNT+ea19VdPp3WRZ+4CG/affp5e5UP0yjgq1cI5 UL0h9hWWR+rclsugxNE1TIyCPxeEzj9T4lqeY/u54J37gZlCd5fZpOTsF 5UtEr7U6PSExAcag9yX4pyPCKDtQ7GmUHpvp8QtToEOr+ARZPGk2GkMW3 A==; X-CSE-ConnectionGUID: Kx0F0lTSSFatiU+MgdlHCg== X-CSE-MsgGUID: ESsrYjbGRLCHbni16zxgpA== X-IronPort-AV: E=Sophos;i="6.07,211,1708412400"; d="scan'208";a="188859614" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 18 Apr 2024 00:49:59 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 18 Apr 2024 00:49:30 -0700 Received: from DEN-DL-M70577.microchip.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 18 Apr 2024 00:49:26 -0700 From: Daniel Machon Subject: [PATCH net-next 0/5] net: sparx5: add support for port mirroring Date: Thu, 18 Apr 2024 09:48:59 +0200 Message-ID: <20240418-port-mirroring-v1-0-e05c35007c55@microchip.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAGvQIGYC/x3MMQqAMAxA0atIZgNtVRSvIg6iac1gKmkRQby7x fEN/z+QSJkSjNUDShcnjlJg6wrWfZFAyFsxOONa0xqHZ9SMB6tGZQk42L7pbG9p9QuU6FTyfP/ DCYQyCt0Z5vf9ADnJiapqAAAA To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , "Steen Hegelund" , , Russell King CC: , , , Horatiu Vultur , "Russell King (Oracle)" , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Vladimir Oltean , Yue Haibing , Daniel Machon X-Mailer: b4 0.14-dev This series adds support for port mirroring, and port mirroring stats, through tc matchall action FLOW_ACTION_MIRRED. The hardware has three independent mirroring probes. Each probe can be configured with a separate set of filtering conditions that must be fulfilled before traffic is mirrored. A mirror probe can have up to 64 source ports and a single monitor port. The direction of a mirror probe determines if rx or tx traffic is mirrored from the source port to the monitor port. To: David S. Miller To: Eric Dumazet To: Jakub Kicinski To: Paolo Abeni To: Lars Povlsen To: Steen Hegelund To: UNGLinuxDriver@microchip.com To: Russell King Cc: netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: Horatiu Vultur Cc: Russell King (Oracle) Cc: Uwe Kleine-König Cc: Vladimir Oltean Cc: Yue Haibing Signed-off-by: Daniel Machon --- Daniel Machon (5): net: sparx5: add new register definitions net: sparx5: add bookkeeping code for matchall rules net: sparx5: add port mirroring implementation net: sparx5: add the tc glue to support port mirroring net: sparx5: add support for matchall mirror stats drivers/net/ethernet/microchip/sparx5/Makefile | 3 +- .../net/ethernet/microchip/sparx5/sparx5_main.c | 3 + .../net/ethernet/microchip/sparx5/sparx5_main.h | 25 +++ .../ethernet/microchip/sparx5/sparx5_main_regs.h | 68 ++++++ .../net/ethernet/microchip/sparx5/sparx5_mirror.c | 233 +++++++++++++++++++++ .../ethernet/microchip/sparx5/sparx5_tc_matchall.c | 123 ++++++++++- 6 files changed, 446 insertions(+), 9 deletions(-) --- base-commit: 1c25fe9a044d5334153a3585754b26553f8287b9 change-id: 20240402-port-mirroring-81735171ecfa Best regards, -- Daniel Machon