From nobody Sun Nov 24 22:57:25 2024 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 E7B511537A8; Fri, 1 Nov 2024 07:10:12 +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=1730445015; cv=none; b=JdO9fsy77h3G9G23fYtvNl0jtlHrSzBE1PmybX3ORneB73v7xQZILixJeY6Nm9TVtXDKyUL9GcBN7ufQQle3T48sAA8614iwaTXgK/7CZCOiq36dEfd36BklDjiG7UD05wBxfIOnDIemhqpGCD/7Y+4mxQ1Tn1R0sY9O55BImgc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730445015; c=relaxed/simple; bh=PoUpoiqh15WbBGv3obiAOp0I0e8/k6KBOM9i6jG/LjA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=OVaa3k/hShLlAXbNBGC5tjje/urwjvgPbOpcMDyoQX/6x9I7zwzT/OuRbueARro6DrQ31U9ipvXRWEi/2kLxXAB+lEv4pVfx6B+Ewq4xo1pcnc7Qx5Bo8C+OFjDbKekh4qTVOfAvoMyntwsdTfGvYAKgB1tqOjlhxYFCrsK0ah8= 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=YoRJ3O6X; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="YoRJ3O6X" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1730445012; x=1761981012; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=PoUpoiqh15WbBGv3obiAOp0I0e8/k6KBOM9i6jG/LjA=; b=YoRJ3O6XvFapqrl/YMUQW4e1vLJBXK19HOlFNGr6z0R1oQj0Iqob2R/0 VDjB9p4JrQ97/djj9n4Rg+A2NGI3Ogk5gjKMcdoz9uv4wN0q/ZYmvQecR yFCf+Okn8Leg9JfuS5z+CVSkA0DLeP/zBHdTePCmknFBLPnUY9p27YE88 07h/YrLndw4Swb9/fseZXuctVgInV/kR0U2WuXnHPyU+qU5Kyc1DQklj0 k+JFrp/9LsJUU4KcAA1jIJm4N7GOlsot8h4ddu60hq3DDc79JtmkIDTHR 7yrJ54aIBQT4hI4GHLQjmvjmPoSWcJ38KlOsLc+P+xlRf+kmCElSw96/l A==; X-CSE-ConnectionGUID: NPrwf/hMSSa00KPy6thoyw== X-CSE-MsgGUID: r7VsTCbOQcaA3FloD0sZgQ== X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="201180320" 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; 01 Nov 2024 00:10:04 -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; Fri, 1 Nov 2024 00:09:54 -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; Fri, 1 Nov 2024 00:09:52 -0700 From: Daniel Machon Date: Fri, 1 Nov 2024 08:09:07 +0100 Subject: [PATCH net-next 1/6] net: sparx5: expose some sparx5 VCAP symbols 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: quoted-printable Message-ID: <20241101-sparx5-lan969x-switch-driver-3-v1-1-3c76f22f4bfa@microchip.com> References: <20241101-sparx5-lan969x-switch-driver-3-v1-0-3c76f22f4bfa@microchip.com> In-Reply-To: <20241101-sparx5-lan969x-switch-driver-3-v1-0-3c76f22f4bfa@microchip.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , =?utf-8?q?Jens_Emil_Schulz_=C3=98stergaard?= , , , CC: , , X-Mailer: b4 0.14-dev In preparation for lan969x VCAP support, expose the following symbols for use by the lan969x VCAP implementation: - The symbols SPARX5_*_LOOKUPS defines the number of lookups in each VCAP instance. These are the same for lan969x. Move them to the header file. - The struct sparx5_vcap_inst encapsulates information about a single VCAP instance. Move this struct to the header file and declare the sparx5_vcap_inst_cfg as extern. Reviewed-by: Steen Hegelund Reviewed-by: Jens Emil Schulz =C3=98stergaard Signed-off-by: Daniel Machon --- .../ethernet/microchip/sparx5/sparx5_vcap_impl.c | 18 +----------------- .../ethernet/microchip/sparx5/sparx5_vcap_impl.h | 21 +++++++++++++++++= ++++ 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c b/dri= vers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c index 967c8621c250..0bdf7a378892 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c @@ -17,7 +17,6 @@ #define SUPER_VCAP_BLK_SIZE 3072 /* addresses per Super VCAP block */ #define STREAMSIZE (64 * 4) /* bytes in the VCAP cache area */ =20 -#define SPARX5_IS2_LOOKUPS 4 #define VCAP_IS2_KEYSEL(_ena, _noneth, _v4_mc, _v4_uc, _v6_mc, _v6_uc, _ar= p) \ (ANA_ACL_VCAP_S2_KEY_SEL_KEY_SEL_ENA_SET(_ena) | \ ANA_ACL_VCAP_S2_KEY_SEL_NON_ETH_KEY_SEL_SET(_noneth) | \ @@ -27,7 +26,6 @@ ANA_ACL_VCAP_S2_KEY_SEL_IP6_UC_KEY_SEL_SET(_v6_uc) | \ ANA_ACL_VCAP_S2_KEY_SEL_ARP_KEY_SEL_SET(_arp)) =20 -#define SPARX5_IS0_LOOKUPS 6 #define VCAP_IS0_KEYSEL(_ena, _etype, _ipv4, _ipv6, _mpls_uc, _mpls_mc, _m= lbs) \ (ANA_CL_ADV_CL_CFG_LOOKUP_ENA_SET(_ena) | \ ANA_CL_ADV_CL_CFG_ETYPE_CLM_KEY_SEL_SET(_etype) | \ @@ -37,31 +35,17 @@ ANA_CL_ADV_CL_CFG_MPLS_MC_CLM_KEY_SEL_SET(_mpls_mc) | \ ANA_CL_ADV_CL_CFG_MLBS_CLM_KEY_SEL_SET(_mlbs)) =20 -#define SPARX5_ES0_LOOKUPS 1 #define VCAP_ES0_KEYSEL(_key) (REW_RTAG_ETAG_CTRL_ES0_ISDX_KEY_ENA_SET(_ke= y)) #define SPARX5_STAT_ESDX_GRN_PKTS 0x300 #define SPARX5_STAT_ESDX_YEL_PKTS 0x301 =20 -#define SPARX5_ES2_LOOKUPS 2 #define VCAP_ES2_KEYSEL(_ena, _arp, _ipv4, _ipv6) \ (EACL_VCAP_ES2_KEY_SEL_KEY_ENA_SET(_ena) | \ EACL_VCAP_ES2_KEY_SEL_ARP_KEY_SEL_SET(_arp) | \ EACL_VCAP_ES2_KEY_SEL_IP4_KEY_SEL_SET(_ipv4) | \ EACL_VCAP_ES2_KEY_SEL_IP6_KEY_SEL_SET(_ipv6)) =20 -static struct sparx5_vcap_inst { - enum vcap_type vtype; /* type of vcap */ - int vinst; /* instance number within the same type */ - int lookups; /* number of lookups in this vcap type */ - int lookups_per_instance; /* number of lookups in this instance */ - int first_cid; /* first chain id in this vcap */ - int last_cid; /* last chain id in this vcap */ - int count; /* number of available addresses, not in super vcap */ - int map_id; /* id in the super vcap block mapping (if applicable) */ - int blockno; /* starting block in super vcap (if applicable) */ - int blocks; /* number of blocks in super vcap (if applicable) */ - bool ingress; /* is vcap in the ingress path */ -} sparx5_vcap_inst_cfg[] =3D { +const struct sparx5_vcap_inst sparx5_vcap_inst_cfg[] =3D { { .vtype =3D VCAP_TYPE_IS0, /* CLM-0 */ .vinst =3D 0, diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.h b/dri= vers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.h index 2684d9199b05..d0a42406bf26 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.h +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.h @@ -16,6 +16,11 @@ #include "vcap_api.h" #include "vcap_api_client.h" =20 +#define SPARX5_IS2_LOOKUPS 4 +#define SPARX5_IS0_LOOKUPS 6 +#define SPARX5_ES0_LOOKUPS 1 +#define SPARX5_ES2_LOOKUPS 2 + #define SPARX5_VCAP_CID_IS0_L0 VCAP_CID_INGRESS_L0 /* IS0/CLM lookup 0 */ #define SPARX5_VCAP_CID_IS0_L1 VCAP_CID_INGRESS_L1 /* IS0/CLM lookup 1 */ #define SPARX5_VCAP_CID_IS0_L2 VCAP_CID_INGRESS_L2 /* IS0/CLM lookup 2 */ @@ -40,6 +45,22 @@ #define SPARX5_VCAP_CID_ES2_MAX \ (VCAP_CID_EGRESS_STAGE2_L1 + VCAP_CID_LOOKUP_SIZE - 1) /* ES2 Max */ =20 +struct sparx5_vcap_inst { + enum vcap_type vtype; /* type of vcap */ + int vinst; /* instance number within the same type */ + int lookups; /* number of lookups in this vcap type */ + int lookups_per_instance; /* number of lookups in this instance */ + int first_cid; /* first chain id in this vcap */ + int last_cid; /* last chain id in this vcap */ + int count; /* number of available addresses, not in super vcap */ + int map_id; /* id in the super vcap block mapping (if applicable) */ + int blockno; /* starting block in super vcap (if applicable) */ + int blocks; /* number of blocks in super vcap (if applicable) */ + bool ingress; /* is vcap in the ingress path */ +}; + +extern const struct sparx5_vcap_inst sparx5_vcap_inst_cfg[]; + /* IS0 port keyset selection control */ =20 /* IS0 ethernet, IPv4, IPv6 traffic type keyset generation */ --=20 2.34.1 From nobody Sun Nov 24 22:57:25 2024 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (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 8CFA614F9F8; Fri, 1 Nov 2024 07:10:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730445008; cv=none; b=b1V/6qjGBtkaZZFixqnl+sBrnoBHYVUmqEbQFxXQ3E2T+y0OJBt5yLd4IoOEFUc1zMjTRBOyqa5aU1TL7ECNJSuKCBcf2YcPVfrVQlMzGGZxsd+U/K4g2TSaVo+/xSEtte6q0c7+uY5AGP7hWe0B8rkiTnZceMnrBnBSU+c0+iM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730445008; c=relaxed/simple; bh=bNDvHwGZPuV+jga52Bz0VxfXArVfgtjiFjQDUPKRnEw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=WR5d5rAeMoxrrg9OmIxkiHup92xQ2ibL86EydkkaZsP+/CIXhHnztIs9u+FN05qvMDYMx/JzDJ1NPSNofDB7s7bnzfCl18TENYMzb2h4FuPB/VORUolzhUZaiI6DlGsBv3J03hDRVTDaeUwJyPW0AOwPnA/RfRkTYhY0Mm/T4Go= 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=meA3DhTs; arc=none smtp.client-ip=68.232.153.233 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="meA3DhTs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1730445005; x=1761981005; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=bNDvHwGZPuV+jga52Bz0VxfXArVfgtjiFjQDUPKRnEw=; b=meA3DhTshUlWYcgDngRgAZv0KHHCYx0OZ6/xtwdS5vzSk1w7iAcJcKsk EeKVPcwgnX6n6NLh8OXIFmEcNeR2p166fHd3ZkF5IqS+Ogw4ZslxOSbn7 OX+koBwhR7RHdvgqaKVTLtD35dDTrRc2kQsgQudTPjaE9ZNA9LPgYtX2B pBMKlmVAPw6neF0vLflE6fCU5AR3EZs9K7iwZ4yg7afp3NUiB+Z23LKlM /ocNpei3XjhjsZA7e4U6ADJikK+arRYofwf+UyAfjc9d7NiGSqvstklPs E0UK1ewJhWOLm1RSnYDCaB1b2fUqxGChmpNROAz9kkjPBBUkWKB91RcVS g==; X-CSE-ConnectionGUID: LaL60DmvQP6I/WsdV/7gQA== X-CSE-MsgGUID: ACGpuLYZRUqqf5TabdThyw== X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="37215414" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 01 Nov 2024 00:09:59 -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.35; Fri, 1 Nov 2024 00:09:57 -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; Fri, 1 Nov 2024 00:09:55 -0700 From: Daniel Machon Date: Fri, 1 Nov 2024 08:09:08 +0100 Subject: [PATCH net-next 2/6] net: sparx5: replace SPX5_PORTS with n_ports 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: quoted-printable Message-ID: <20241101-sparx5-lan969x-switch-driver-3-v1-2-3c76f22f4bfa@microchip.com> References: <20241101-sparx5-lan969x-switch-driver-3-v1-0-3c76f22f4bfa@microchip.com> In-Reply-To: <20241101-sparx5-lan969x-switch-driver-3-v1-0-3c76f22f4bfa@microchip.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , =?utf-8?q?Jens_Emil_Schulz_=C3=98stergaard?= , , , CC: , , X-Mailer: b4 0.14-dev The Sparx5 VCAP implementation uses the SPX5_PORTS symbol to iterate over the 65 front ports of Sparx5. Replace the use with the n_ports constant from the match data, which translates to 65 of Sparx5 and 30 on lan969x. Reviewed-by: Steen Hegelund Reviewed-by: Jens Emil Schulz =C3=98stergaard Signed-off-by: Daniel Machon --- .../ethernet/microchip/sparx5/sparx5_vcap_impl.c | 24 ++++++++++++++----= ---- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c b/dri= vers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c index 0bdf7a378892..bbff8158a3de 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c @@ -1777,6 +1777,7 @@ void sparx5_vcap_set_port_keyset(struct net_device *n= dev, static void sparx5_vcap_is0_port_key_selection(struct sparx5 *sparx5, struct vcap_admin *admin) { + const struct sparx5_consts *consts =3D sparx5->data->consts; int portno, lookup; u32 keysel; =20 @@ -1788,7 +1789,7 @@ static void sparx5_vcap_is0_port_key_selection(struct= sparx5 *sparx5, VCAP_IS0_PS_MPLS_FOLLOW_ETYPE, VCAP_IS0_PS_MLBS_FOLLOW_ETYPE); for (lookup =3D 0; lookup < admin->lookups; ++lookup) { - for (portno =3D 0; portno < SPX5_PORTS; ++portno) { + for (portno =3D 0; portno < consts->n_ports; ++portno) { spx5_wr(keysel, sparx5, ANA_CL_ADV_CL_CFG(portno, lookup)); spx5_rmw(ANA_CL_ADV_CL_CFG_LOOKUP_ENA, @@ -1803,6 +1804,7 @@ static void sparx5_vcap_is0_port_key_selection(struct= sparx5 *sparx5, static void sparx5_vcap_is2_port_key_selection(struct sparx5 *sparx5, struct vcap_admin *admin) { + const struct sparx5_consts *consts =3D sparx5->data->consts; int portno, lookup; u32 keysel; =20 @@ -1813,13 +1815,13 @@ static void sparx5_vcap_is2_port_key_selection(stru= ct sparx5 *sparx5, VCAP_IS2_PS_IPV6_UC_IP_7TUPLE, VCAP_IS2_PS_ARP_ARP); for (lookup =3D 0; lookup < admin->lookups; ++lookup) { - for (portno =3D 0; portno < SPX5_PORTS; ++portno) { + for (portno =3D 0; portno < consts->n_ports; ++portno) { spx5_wr(keysel, sparx5, ANA_ACL_VCAP_S2_KEY_SEL(portno, lookup)); } } /* IS2 lookups are in bit 0:3 */ - for (portno =3D 0; portno < SPX5_PORTS; ++portno) + for (portno =3D 0; portno < consts->n_ports; ++portno) spx5_rmw(ANA_ACL_VCAP_S2_CFG_SEC_ENA_SET(0xf), ANA_ACL_VCAP_S2_CFG_SEC_ENA, sparx5, @@ -1830,11 +1832,12 @@ static void sparx5_vcap_is2_port_key_selection(stru= ct sparx5 *sparx5, static void sparx5_vcap_es0_port_key_selection(struct sparx5 *sparx5, struct vcap_admin *admin) { + const struct sparx5_consts *consts =3D sparx5->data->consts; int portno; u32 keysel; =20 keysel =3D VCAP_ES0_KEYSEL(VCAP_ES0_PS_FORCE_ISDX_LOOKUPS); - for (portno =3D 0; portno < SPX5_PORTS; ++portno) + for (portno =3D 0; portno < consts->n_ports; ++portno) spx5_rmw(keysel, REW_RTAG_ETAG_CTRL_ES0_ISDX_KEY_ENA, sparx5, REW_RTAG_ETAG_CTRL(portno)); =20 @@ -1846,6 +1849,7 @@ static void sparx5_vcap_es0_port_key_selection(struct= sparx5 *sparx5, static void sparx5_vcap_es2_port_key_selection(struct sparx5 *sparx5, struct vcap_admin *admin) { + const struct sparx5_consts *consts =3D sparx5->data->consts; int portno, lookup; u32 keysel; =20 @@ -1853,7 +1857,7 @@ static void sparx5_vcap_es2_port_key_selection(struct= sparx5 *sparx5, VCAP_ES2_PS_IPV4_IP4_TCP_UDP_OTHER, VCAP_ES2_PS_IPV6_IP_7TUPLE); for (lookup =3D 0; lookup < admin->lookups; ++lookup) - for (portno =3D 0; portno < SPX5_PORTS; ++portno) + for (portno =3D 0; portno < consts->n_ports; ++portno) spx5_wr(keysel, sparx5, EACL_VCAP_ES2_KEY_SEL(portno, lookup)); } @@ -1885,19 +1889,20 @@ static void sparx5_vcap_port_key_selection(struct s= parx5 *sparx5, static void sparx5_vcap_port_key_deselection(struct sparx5 *sparx5, struct vcap_admin *admin) { + const struct sparx5_consts *consts =3D sparx5->data->consts; int portno, lookup; =20 switch (admin->vtype) { case VCAP_TYPE_IS0: for (lookup =3D 0; lookup < admin->lookups; ++lookup) - for (portno =3D 0; portno < SPX5_PORTS; ++portno) + for (portno =3D 0; portno < consts->n_ports; ++portno) spx5_rmw(ANA_CL_ADV_CL_CFG_LOOKUP_ENA_SET(0), ANA_CL_ADV_CL_CFG_LOOKUP_ENA, sparx5, ANA_CL_ADV_CL_CFG(portno, lookup)); break; case VCAP_TYPE_IS2: - for (portno =3D 0; portno < SPX5_PORTS; ++portno) + for (portno =3D 0; portno < consts->n_ports; ++portno) spx5_rmw(ANA_ACL_VCAP_S2_CFG_SEC_ENA_SET(0), ANA_ACL_VCAP_S2_CFG_SEC_ENA, sparx5, @@ -1909,7 +1914,7 @@ static void sparx5_vcap_port_key_deselection(struct s= parx5 *sparx5, break; case VCAP_TYPE_ES2: for (lookup =3D 0; lookup < admin->lookups; ++lookup) - for (portno =3D 0; portno < SPX5_PORTS; ++portno) + for (portno =3D 0; portno < consts->n_ports; ++portno) spx5_rmw(EACL_VCAP_ES2_KEY_SEL_KEY_ENA_SET(0), EACL_VCAP_ES2_KEY_SEL_KEY_ENA, sparx5, @@ -2026,6 +2031,7 @@ static void sparx5_vcap_block_alloc(struct sparx5 *sp= arx5, /* Allocate a vcap control and vcap instances and configure the system */ int sparx5_vcap_init(struct sparx5 *sparx5) { + const struct sparx5_consts *consts =3D sparx5->data->consts; const struct sparx5_vcap_inst *cfg; struct vcap_control *ctrl; struct vcap_admin *admin; @@ -2069,7 +2075,7 @@ int sparx5_vcap_init(struct sparx5 *sparx5) list_add_tail(&admin->list, &ctrl->list); } dir =3D vcap_debugfs(sparx5->dev, sparx5->debugfs_root, ctrl); - for (idx =3D 0; idx < SPX5_PORTS; ++idx) + for (idx =3D 0; idx < consts->n_ports; ++idx) if (sparx5->ports[idx]) vcap_port_debugfs(sparx5->dev, dir, ctrl, sparx5->ports[idx]->ndev); --=20 2.34.1 From nobody Sun Nov 24 22:57:25 2024 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (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 B5AD01527B4; Fri, 1 Nov 2024 07:10:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730445033; cv=none; b=OJJRL25Ff03cIJhmb+XOHCz1icUkFiBvzltJiPdVM9viU4O7hlH0Yv4NYVlksaPVdcR0LIpp1h22xY2RCLGN1FgC13zZ4zQNASBQGxAR4OubaIska3d3mN5aK5x/7c6PwNkR2NCictJDlakc7dxjMpzsAj6fUqIU/jw5UKnTKh0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730445033; c=relaxed/simple; bh=NO8D57jjFPDxrbgYyw5Mvi+zlor1VX7LknLSSD3o+GY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=iYn0xD27mVM0nfZ1AjFiV2+0sqK63cHArI4B27Kuz3V+DWt4QAnkUTRZPPtwdBl7ljDdIbFah/WXtjkql2DWnoKHfH65hby3RHoDSHKyJjBJKQdlBqrFvhLSyN8WS73tUmwO1sMwqnZB2iByjdcqWRmkDLV0I7FcUWRzPqRXfvk= 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=OK4UBul+; arc=none smtp.client-ip=68.232.153.233 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="OK4UBul+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1730445031; x=1761981031; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=NO8D57jjFPDxrbgYyw5Mvi+zlor1VX7LknLSSD3o+GY=; b=OK4UBul+DFFWwugnCO8jwoc5wHDMlsb1B3ueWB2PN5k67RYhtWMwz5Xa c2I5RwMehtDI869yOze5zfXhqU4x4XNIbD5K3OhkUxGAeEDv+ZPH6jEOX eIINRuK5MbNNdBAtbn2cZmOtbhjndy2eiPVZw1UAyeAcuhrxyW4e7lzr5 clBzjNTLMMGE/r5Qw88h0yv+lcr9V8ZDhSo2xnrVtfJ9GzSuGVINUg7C3 KzkezyqlPQkpiIpFebcbmAhaYO3NePJefP/DfDtN/SSL+anmWoC42ftAa 0jDNKgRMgqLyGoSocC9zyAh1Mo5rEmLewx4rUbyRWsEpF1Pqu7vNCCvye A==; X-CSE-ConnectionGUID: j3YBXS8JS+qztkz9gl3BFg== X-CSE-MsgGUID: t5VuQJaGQ7qXXZt/aEIsqg== X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="264868811" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 01 Nov 2024 00:10:31 -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.35; Fri, 1 Nov 2024 00:10:00 -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; Fri, 1 Nov 2024 00:09:57 -0700 From: Daniel Machon Date: Fri, 1 Nov 2024 08:09:09 +0100 Subject: [PATCH net-next 3/6] net: sparx5: add new VCAP constants to match data 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: quoted-printable Message-ID: <20241101-sparx5-lan969x-switch-driver-3-v1-3-3c76f22f4bfa@microchip.com> References: <20241101-sparx5-lan969x-switch-driver-3-v1-0-3c76f22f4bfa@microchip.com> In-Reply-To: <20241101-sparx5-lan969x-switch-driver-3-v1-0-3c76f22f4bfa@microchip.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , =?utf-8?q?Jens_Emil_Schulz_=C3=98stergaard?= , , , CC: , , X-Mailer: b4 0.14-dev In preparation for lan969x VCAP support, add the following three new VCAP constants to match data: - vcaps_cfg (contains configuration data for each VCAP). - vcaps (contains auto-generated information about VCAP keys and actions). - vcap_stats: (contains auto-generated string names of all the keys and actions) Add these constants to the Sparx5 match data constants and use them to initialize the VCAP's in sparx5_vcap_init(). Reviewed-by: Steen Hegelund Reviewed-by: Jens Emil Schulz =C3=98stergaard Signed-off-by: Daniel Machon --- drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 5 +++++ drivers/net/ethernet/microchip/sparx5/sparx5_main.h | 3 +++ drivers/net/ethernet/microchip/sparx5/sparx5_vcap_ag_api.h | 2 ++ drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c | 6 +++--- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/= net/ethernet/microchip/sparx5/sparx5_main.c index 4f2d5413a64f..bac87e885bf1 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c @@ -30,6 +30,8 @@ #include "sparx5_main.h" #include "sparx5_port.h" #include "sparx5_qos.h" +#include "sparx5_vcap_ag_api.h" +#include "sparx5_vcap_impl.h" =20 const struct sparx5_regs *regs; =20 @@ -1063,6 +1065,9 @@ static const struct sparx5_consts sparx5_consts =3D { .qres_max_prio_idx =3D 630, .qres_max_colour_idx =3D 638, .tod_pin =3D 4, + .vcaps =3D sparx5_vcaps, + .vcaps_cfg =3D sparx5_vcap_inst_cfg, + .vcap_stats =3D &sparx5_vcap_stats, }; =20 static const struct sparx5_ops sparx5_ops =3D { diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h b/drivers/= net/ethernet/microchip/sparx5/sparx5_main.h index 146bdc938adc..d5dd953b0a71 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h @@ -303,6 +303,9 @@ struct sparx5_consts { u32 qres_max_prio_idx; /* Maximum QRES prio index */ u32 qres_max_colour_idx; /* Maximum QRES colour index */ u32 tod_pin; /* PTP TOD pin */ + const struct sparx5_vcap_inst *vcaps_cfg; + const struct vcap_info *vcaps; + const struct vcap_statistics *vcap_stats; }; =20 struct sparx5_ops { diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_ag_api.h b/d= rivers/net/ethernet/microchip/sparx5/sparx5_vcap_ag_api.h index 7d106f1276fe..e68f5639a40a 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_ag_api.h +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_ag_api.h @@ -10,6 +10,8 @@ #ifndef __SPARX5_VCAP_AG_API_H__ #define __SPARX5_VCAP_AG_API_H__ =20 +#include "vcap_api.h" + /* VCAPs */ extern const struct vcap_info sparx5_vcaps[]; extern const struct vcap_statistics sparx5_vcap_stats; diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c b/dri= vers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c index bbff8158a3de..25066ddb8d4d 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c @@ -2053,14 +2053,14 @@ int sparx5_vcap_init(struct sparx5 *sparx5) =20 sparx5->vcap_ctrl =3D ctrl; /* select the sparx5 VCAP model */ - ctrl->vcaps =3D sparx5_vcaps; - ctrl->stats =3D &sparx5_vcap_stats; + ctrl->vcaps =3D consts->vcaps; + ctrl->stats =3D consts->vcap_stats; /* Setup callbacks to allow the API to use the VCAP HW */ ctrl->ops =3D &sparx5_vcap_ops; =20 INIT_LIST_HEAD(&ctrl->list); for (idx =3D 0; idx < ARRAY_SIZE(sparx5_vcap_inst_cfg); ++idx) { - cfg =3D &sparx5_vcap_inst_cfg[idx]; + cfg =3D &consts->vcaps_cfg[idx]; admin =3D sparx5_vcap_admin_alloc(sparx5, ctrl, cfg); if (IS_ERR(admin)) { err =3D PTR_ERR(admin); --=20 2.34.1 From nobody Sun Nov 24 22:57:25 2024 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (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 5FE7815359A; Fri, 1 Nov 2024 07:10:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730445014; cv=none; b=arT6xPW/wcLZTkcmWU1MChNWdhC2KxJ6HAtlvfhkC/ZKT0S2qQKpHljDepntIzkR2zL/+8lVwq9g1ufSLlFMwpoq5X68pIBtPil2GL69rxT6n2YnoF9OjtRkvBRx6oHQXX2qkyem+sqpNRDzEaQmb9mwyBzAZXUVkmiJgSkySD0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730445014; c=relaxed/simple; bh=qo3EIWZzPe6jD1iFKFUqHh6rrb9GVbIt3i3my3FIISw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=ZE5mVlgFZ23OH4FeZU/HQttQCUFywhw24TZuZCs7m6DDIOyWhaeC5WC1zizEwTV+4qdFWTzNqAvHXrvJTuxvN+uxB2TZ35Y6sBPYvf09IaRdnu0OLlIa8wNc1vQjYlEERCtJgPe7JtZmvaUuIq7hXlD7V7F0O9JZPuXdVBj+kEA= 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=X/LEM9qj; arc=none smtp.client-ip=68.232.153.233 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="X/LEM9qj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1730445012; x=1761981012; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=qo3EIWZzPe6jD1iFKFUqHh6rrb9GVbIt3i3my3FIISw=; b=X/LEM9qjJ8p7awe89lT0CGrNpusMkE2MzKiJ5pEfVUpS9KcpOyfbXGWI IJibjoGEX9ms/8cyikdF9UQna0OuNhjJS9yvgTLISVRyX9etUC2XD1KFM TnVGV+kLjZ15SQuADVwxP5b+bo9nVUkRPxRjEtXzM+BB+yMdUh+yrGfEw sQ3GeBPj1yEDgf74MuLxpaRfomfes6Bb03zsRdMwhpFiWrGYLyJ9H+qJs 8VMkJioliCYQDGr0gAb+kdCFmvdx7dh2HbJRycrGiA/OoDWvYESLgJA+B mWTp7zEL/SKNOz0A/Z7mQbDDsQBnodyDgB7Ueh1Uj3wYj6qCieDnD5wBf g==; X-CSE-ConnectionGUID: cK9dq03ZTAa62dxLS6SkZA== X-CSE-MsgGUID: VKcxEam4TJ2pSH5+vhY3Sg== X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="33754105" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 01 Nov 2024 00:10:11 -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.35; Fri, 1 Nov 2024 00:10:02 -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; Fri, 1 Nov 2024 00:10:00 -0700 From: Daniel Machon Date: Fri, 1 Nov 2024 08:09:10 +0100 Subject: [PATCH net-next 4/6] net: sparx5: execute sparx5_vcap_init() on lan969x 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: quoted-printable Message-ID: <20241101-sparx5-lan969x-switch-driver-3-v1-4-3c76f22f4bfa@microchip.com> References: <20241101-sparx5-lan969x-switch-driver-3-v1-0-3c76f22f4bfa@microchip.com> In-Reply-To: <20241101-sparx5-lan969x-switch-driver-3-v1-0-3c76f22f4bfa@microchip.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , =?utf-8?q?Jens_Emil_Schulz_=C3=98stergaard?= , , , CC: , , X-Mailer: b4 0.14-dev The is_sparx5() check was introduced in an earlier series, to make sure the sparx5_vcap_init() was not executed on lan969x, as it was not implemented there yet. Now that it is, remove that check. Reviewed-by: Steen Hegelund Reviewed-by: Jens Emil Schulz =C3=98stergaard Signed-off-by: Daniel Machon --- drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/= net/ethernet/microchip/sparx5/sparx5_main.c index bac87e885bf1..2f1013f870fb 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c @@ -770,12 +770,10 @@ static int sparx5_start(struct sparx5 *sparx5) if (err) return err; =20 - if (is_sparx5(sparx5)) { - err =3D sparx5_vcap_init(sparx5); - if (err) { - sparx5_unregister_notifier_blocks(sparx5); - return err; - } + err =3D sparx5_vcap_init(sparx5); + if (err) { + sparx5_unregister_notifier_blocks(sparx5); + return err; } =20 /* Start Frame DMA with fallback to register based INJ/XTR */ --=20 2.34.1 From nobody Sun Nov 24 22:57:25 2024 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (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 C2B205D8F0; Fri, 1 Nov 2024 07:10:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730445040; cv=none; b=ggDvc6WrOnfZqsqeKXAhgVbZQleNM/a0/vJ0lnzOwWm/5HKV9MvCUROJB083gFzO76IZ4pPhx8IRUq5TtDu1s0IH7jwN9bHq9QZbuBGR+9m0RVoxMK+OT7k5w5vEEre6unpsbICFJXbPz5xrViCHcrQGQ++zzbtFaClX1CHWxqo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730445040; c=relaxed/simple; bh=yCEiD1fSKVYVBKnay6M7zI4FI8mv2M02DwwcBGReapE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=o+fbPZN7Tovc/4Cg6aBFA1A7+K04FGVf3CkUM5F5jxZuaeO77P37S8t4D9DSAvhhyo/iXu/FmG+DdMN0229usH1teCvOb0GxtVUfB+r/UJUdYq64MxDExjicBXZcg68iFU4ePecER721oNzwxhscvSVE/bno/OiMDW1H2iWm03Q= 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=1n/Umr4u; arc=none smtp.client-ip=68.232.153.233 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="1n/Umr4u" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1730445033; x=1761981033; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=yCEiD1fSKVYVBKnay6M7zI4FI8mv2M02DwwcBGReapE=; b=1n/Umr4uvJZUKZZU6R85vrfca76jTsvXJGyw6H+owJlbQ54IqqzcX/sw Gkww8FrIKW4KR7Y5xBQzTvbuMJcy6JYE6xppiPighVN5VLrqprs0IGy4l NXMiCAvXCO4PARqM/2gl9ZMf4pj52XGnvpEL521CJat2QLWK0ifm1hE/5 qnbDNaFExocnrkJ3S++Tf4vPTgaFQPIoclxUJ876+/9V0WLbIKPnpjXMx QuAFksdyKGNx7HjKcBqoZhCP+58mXWTmChN+yLEuyoupbqB49zZJJBUA8 g4K0eOA+yoBK8eZdOaZ4jLZlIDxl6sS1YPrOfuGiv0ImPdPRk5bqODR+r A==; X-CSE-ConnectionGUID: j3YBXS8JS+qztkz9gl3BFg== X-CSE-MsgGUID: 1RhtrmrdR36dzeZpfiKfcA== X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="264868825" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 01 Nov 2024 00:10:31 -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.35; Fri, 1 Nov 2024 00:10:05 -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; Fri, 1 Nov 2024 00:10:03 -0700 From: Daniel Machon Date: Fri, 1 Nov 2024 08:09:11 +0100 Subject: [PATCH net-next 5/6] net: lan969x: add autogenerated VCAP information 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: quoted-printable Message-ID: <20241101-sparx5-lan969x-switch-driver-3-v1-5-3c76f22f4bfa@microchip.com> References: <20241101-sparx5-lan969x-switch-driver-3-v1-0-3c76f22f4bfa@microchip.com> In-Reply-To: <20241101-sparx5-lan969x-switch-driver-3-v1-0-3c76f22f4bfa@microchip.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , =?utf-8?q?Jens_Emil_Schulz_=C3=98stergaard?= , , , CC: , , X-Mailer: b4 0.14-dev Platform VCAP data for each VCAP instance is auto-generated using an internal Microchip tool. The generated VCAP data contains information about keyfields, keyfield sets, actionfields, actionfield sets and typegroups, which in combination are used to encode and decode rules in the VCAP. Add the auto-generated VCAP file lan969x_vcap_ag_api.c and assign the two structs: lan969x_vcaps and lan969x_vcap_stats to the match data. Reviewed-by: Steen Hegelund Reviewed-by: Jens Emil Schulz =C3=98stergaard Signed-off-by: Daniel Machon --- drivers/net/ethernet/microchip/lan969x/Makefile | 3 +- drivers/net/ethernet/microchip/lan969x/lan969x.c | 2 + drivers/net/ethernet/microchip/lan969x/lan969x.h | 5 + .../microchip/lan969x/lan969x_vcap_ag_api.c | 3843 ++++++++++++++++= ++++ 4 files changed, 3852 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/microchip/lan969x/Makefile b/drivers/net/= ethernet/microchip/lan969x/Makefile index 82d318a7219c..3ea560e08a21 100644 --- a/drivers/net/ethernet/microchip/lan969x/Makefile +++ b/drivers/net/ethernet/microchip/lan969x/Makefile @@ -5,7 +5,8 @@ =20 obj-$(CONFIG_LAN969X_SWITCH) +=3D lan969x-switch.o =20 -lan969x-switch-y :=3D lan969x_regs.o lan969x.o lan969x_calendar.o +lan969x-switch-y :=3D lan969x_regs.o lan969x.o lan969x_calendar.o \ + lan969x_vcap_ag_api.o =20 # Provide include files ccflags-y +=3D -I$(srctree)/drivers/net/ethernet/microchip/fdma diff --git a/drivers/net/ethernet/microchip/lan969x/lan969x.c b/drivers/net= /ethernet/microchip/lan969x/lan969x.c index 79e5bcefbd73..0cb9ec1d2054 100644 --- a/drivers/net/ethernet/microchip/lan969x/lan969x.c +++ b/drivers/net/ethernet/microchip/lan969x/lan969x.c @@ -319,6 +319,8 @@ static const struct sparx5_consts lan969x_consts =3D { .qres_max_prio_idx =3D 315, .qres_max_colour_idx =3D 323, .tod_pin =3D 4, + .vcaps =3D lan969x_vcaps, + .vcap_stats =3D &lan969x_vcap_stats, }; =20 static const struct sparx5_ops lan969x_ops =3D { diff --git a/drivers/net/ethernet/microchip/lan969x/lan969x.h b/drivers/net= /ethernet/microchip/lan969x/lan969x.h index 7ce047ad9ca4..167281d99c50 100644 --- a/drivers/net/ethernet/microchip/lan969x/lan969x.h +++ b/drivers/net/ethernet/microchip/lan969x/lan969x.h @@ -9,10 +9,15 @@ =20 #include "../sparx5/sparx5_main.h" #include "../sparx5/sparx5_regs.h" +#include "../sparx5/sparx5_vcap_impl.h" =20 /* lan969x.c */ extern const struct sparx5_match_data lan969x_desc; =20 +/* lan969x_vcap_ag_api.c */ +extern const struct vcap_statistics lan969x_vcap_stats; +extern const struct vcap_info lan969x_vcaps[]; + /* lan969x_regs.c */ extern const unsigned int lan969x_tsize[TSIZE_LAST]; extern const unsigned int lan969x_raddr[RADDR_LAST]; diff --git a/drivers/net/ethernet/microchip/lan969x/lan969x_vcap_ag_api.c b= /drivers/net/ethernet/microchip/lan969x/lan969x_vcap_ag_api.c new file mode 100644 index 000000000000..7acc5bcf337a --- /dev/null +++ b/drivers/net/ethernet/microchip/lan969x/lan969x_vcap_ag_api.c @@ -0,0 +1,3843 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* Copyright (C) 2024 Microchip Technology Inc. and its subsidiaries. + * Microchip VCAP API + */ + +/* This file is autogenerated by cml-utils 2024-10-07 11:10:56 +0200. + * Commit ID: b5ddc8e244eb2481a9524f1ddc630a8b41e7c391 + */ + +#include +#include + +#include "lan969x.h" + +/* keyfields */ +static const struct vcap_field is0_normal_7tuple_keyfield[] =3D { + [VCAP_KF_TYPE] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 0, + .width =3D 1, + }, + [VCAP_KF_LOOKUP_FIRST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 1, + .width =3D 1, + }, + [VCAP_KF_LOOKUP_GEN_IDX_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 2, + .width =3D 2, + }, + [VCAP_KF_LOOKUP_GEN_IDX] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 4, + .width =3D 10, + }, + [VCAP_KF_IF_IGR_PORT_MASK_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 14, + .width =3D 2, + }, + [VCAP_KF_IF_IGR_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U72, + .offset =3D 16, + .width =3D 65, + }, + [VCAP_KF_L2_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 81, + .width =3D 1, + }, + [VCAP_KF_L2_BC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 82, + .width =3D 1, + }, + [VCAP_KF_8021Q_VLAN_TAGS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 83, + .width =3D 3, + }, + [VCAP_KF_8021Q_TPID0] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 86, + .width =3D 3, + }, + [VCAP_KF_8021Q_PCP0] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 89, + .width =3D 3, + }, + [VCAP_KF_8021Q_DEI0] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 92, + .width =3D 1, + }, + [VCAP_KF_8021Q_VID0] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 93, + .width =3D 12, + }, + [VCAP_KF_8021Q_TPID1] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 105, + .width =3D 3, + }, + [VCAP_KF_8021Q_PCP1] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 108, + .width =3D 3, + }, + [VCAP_KF_8021Q_DEI1] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 111, + .width =3D 1, + }, + [VCAP_KF_8021Q_VID1] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 112, + .width =3D 12, + }, + [VCAP_KF_8021Q_TPID2] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 124, + .width =3D 3, + }, + [VCAP_KF_8021Q_PCP2] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 127, + .width =3D 3, + }, + [VCAP_KF_8021Q_DEI2] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 130, + .width =3D 1, + }, + [VCAP_KF_8021Q_VID2] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 131, + .width =3D 12, + }, + [VCAP_KF_L2_DMAC] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 144, + .width =3D 48, + }, + [VCAP_KF_L2_SMAC] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 192, + .width =3D 48, + }, + [VCAP_KF_IP_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 240, + .width =3D 1, + }, + [VCAP_KF_ETYPE_LEN_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 241, + .width =3D 1, + }, + [VCAP_KF_ETYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 242, + .width =3D 16, + }, + [VCAP_KF_IP_SNAP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 258, + .width =3D 1, + }, + [VCAP_KF_IP4_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 259, + .width =3D 1, + }, + [VCAP_KF_L3_FRAGMENT_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 260, + .width =3D 2, + }, + [VCAP_KF_L3_FRAG_INVLD_L4_LEN] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 262, + .width =3D 1, + }, + [VCAP_KF_L3_OPTIONS_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 263, + .width =3D 1, + }, + [VCAP_KF_L3_DSCP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 264, + .width =3D 6, + }, + [VCAP_KF_L3_IP6_DIP] =3D { + .type =3D VCAP_FIELD_U128, + .offset =3D 270, + .width =3D 128, + }, + [VCAP_KF_L3_IP6_SIP] =3D { + .type =3D VCAP_FIELD_U128, + .offset =3D 398, + .width =3D 128, + }, + [VCAP_KF_TCP_UDP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 526, + .width =3D 1, + }, + [VCAP_KF_TCP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 527, + .width =3D 1, + }, + [VCAP_KF_L4_SPORT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 528, + .width =3D 16, + }, + [VCAP_KF_L4_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 544, + .width =3D 8, + }, +}; + +static const struct vcap_field is0_normal_5tuple_ip4_keyfield[] =3D { + [VCAP_KF_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 0, + .width =3D 2, + }, + [VCAP_KF_LOOKUP_FIRST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 2, + .width =3D 1, + }, + [VCAP_KF_LOOKUP_GEN_IDX_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 3, + .width =3D 2, + }, + [VCAP_KF_LOOKUP_GEN_IDX] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 5, + .width =3D 10, + }, + [VCAP_KF_IF_IGR_PORT_MASK_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 15, + .width =3D 2, + }, + [VCAP_KF_IF_IGR_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U72, + .offset =3D 17, + .width =3D 65, + }, + [VCAP_KF_L2_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 82, + .width =3D 1, + }, + [VCAP_KF_L2_BC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 83, + .width =3D 1, + }, + [VCAP_KF_8021Q_VLAN_TAGS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 84, + .width =3D 3, + }, + [VCAP_KF_8021Q_TPID0] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 87, + .width =3D 3, + }, + [VCAP_KF_8021Q_PCP0] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 90, + .width =3D 3, + }, + [VCAP_KF_8021Q_DEI0] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 93, + .width =3D 1, + }, + [VCAP_KF_8021Q_VID0] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 94, + .width =3D 12, + }, + [VCAP_KF_8021Q_TPID1] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 106, + .width =3D 3, + }, + [VCAP_KF_8021Q_PCP1] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 109, + .width =3D 3, + }, + [VCAP_KF_8021Q_DEI1] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 112, + .width =3D 1, + }, + [VCAP_KF_8021Q_VID1] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 113, + .width =3D 12, + }, + [VCAP_KF_8021Q_TPID2] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 125, + .width =3D 3, + }, + [VCAP_KF_8021Q_PCP2] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 128, + .width =3D 3, + }, + [VCAP_KF_8021Q_DEI2] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 131, + .width =3D 1, + }, + [VCAP_KF_8021Q_VID2] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 132, + .width =3D 12, + }, + [VCAP_KF_IP_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 145, + .width =3D 1, + }, + [VCAP_KF_IP4_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 146, + .width =3D 1, + }, + [VCAP_KF_L3_FRAGMENT_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 147, + .width =3D 2, + }, + [VCAP_KF_L3_FRAG_INVLD_L4_LEN] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 149, + .width =3D 1, + }, + [VCAP_KF_L3_OPTIONS_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 150, + .width =3D 1, + }, + [VCAP_KF_L3_DSCP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 151, + .width =3D 6, + }, + [VCAP_KF_L3_IP4_DIP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 157, + .width =3D 32, + }, + [VCAP_KF_L3_IP4_SIP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 189, + .width =3D 32, + }, + [VCAP_KF_L3_IP_PROTO] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 221, + .width =3D 8, + }, + [VCAP_KF_TCP_UDP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 229, + .width =3D 1, + }, + [VCAP_KF_TCP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 230, + .width =3D 1, + }, + [VCAP_KF_L4_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 231, + .width =3D 8, + }, + [VCAP_KF_IP_PAYLOAD_5TUPLE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 239, + .width =3D 32, + }, +}; + +static const struct vcap_field is2_mac_etype_keyfield[] =3D { + [VCAP_KF_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 0, + .width =3D 4, + }, + [VCAP_KF_LOOKUP_FIRST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 4, + .width =3D 1, + }, + [VCAP_KF_LOOKUP_PAG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 5, + .width =3D 8, + }, + [VCAP_KF_IF_IGR_PORT_MASK_L3] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 13, + .width =3D 1, + }, + [VCAP_KF_IF_IGR_PORT_MASK_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 14, + .width =3D 4, + }, + [VCAP_KF_IF_IGR_PORT_MASK_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 18, + .width =3D 2, + }, + [VCAP_KF_IF_IGR_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 20, + .width =3D 32, + }, + [VCAP_KF_L2_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 52, + .width =3D 1, + }, + [VCAP_KF_L2_BC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 53, + .width =3D 1, + }, + [VCAP_KF_8021Q_VLAN_TAGGED_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 54, + .width =3D 1, + }, + [VCAP_KF_ISDX_GT0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 56, + .width =3D 1, + }, + [VCAP_KF_ISDX_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 57, + .width =3D 10, + }, + [VCAP_KF_8021Q_VID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 67, + .width =3D 13, + }, + [VCAP_KF_8021Q_DEI_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 80, + .width =3D 1, + }, + [VCAP_KF_8021Q_PCP_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 81, + .width =3D 3, + }, + [VCAP_KF_L2_FWD_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 84, + .width =3D 1, + }, + [VCAP_KF_L3_RT_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 87, + .width =3D 1, + }, + [VCAP_KF_L3_DST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 88, + .width =3D 1, + }, + [VCAP_KF_L2_DMAC] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 89, + .width =3D 48, + }, + [VCAP_KF_L2_SMAC] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 137, + .width =3D 48, + }, + [VCAP_KF_ETYPE_LEN_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 185, + .width =3D 1, + }, + [VCAP_KF_ETYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 186, + .width =3D 16, + }, + [VCAP_KF_L2_PAYLOAD_ETYPE] =3D { + .type =3D VCAP_FIELD_U64, + .offset =3D 202, + .width =3D 64, + }, + [VCAP_KF_L4_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 266, + .width =3D 16, + }, + [VCAP_KF_OAM_CCM_CNTS_EQ0] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 282, + .width =3D 1, + }, + [VCAP_KF_OAM_Y1731_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 283, + .width =3D 1, + }, +}; + +static const struct vcap_field is2_arp_keyfield[] =3D { + [VCAP_KF_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 0, + .width =3D 4, + }, + [VCAP_KF_LOOKUP_FIRST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 4, + .width =3D 1, + }, + [VCAP_KF_LOOKUP_PAG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 5, + .width =3D 8, + }, + [VCAP_KF_IF_IGR_PORT_MASK_L3] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 13, + .width =3D 1, + }, + [VCAP_KF_IF_IGR_PORT_MASK_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 14, + .width =3D 4, + }, + [VCAP_KF_IF_IGR_PORT_MASK_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 18, + .width =3D 2, + }, + [VCAP_KF_IF_IGR_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 20, + .width =3D 32, + }, + [VCAP_KF_L2_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 52, + .width =3D 1, + }, + [VCAP_KF_L2_BC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 53, + .width =3D 1, + }, + [VCAP_KF_8021Q_VLAN_TAGGED_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 54, + .width =3D 1, + }, + [VCAP_KF_ISDX_GT0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 56, + .width =3D 1, + }, + [VCAP_KF_ISDX_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 57, + .width =3D 10, + }, + [VCAP_KF_8021Q_VID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 67, + .width =3D 13, + }, + [VCAP_KF_8021Q_DEI_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 80, + .width =3D 1, + }, + [VCAP_KF_8021Q_PCP_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 81, + .width =3D 3, + }, + [VCAP_KF_L2_FWD_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 84, + .width =3D 1, + }, + [VCAP_KF_L2_SMAC] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 85, + .width =3D 48, + }, + [VCAP_KF_ARP_ADDR_SPACE_OK_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 133, + .width =3D 1, + }, + [VCAP_KF_ARP_PROTO_SPACE_OK_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 134, + .width =3D 1, + }, + [VCAP_KF_ARP_LEN_OK_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 135, + .width =3D 1, + }, + [VCAP_KF_ARP_TGT_MATCH_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 136, + .width =3D 1, + }, + [VCAP_KF_ARP_SENDER_MATCH_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 137, + .width =3D 1, + }, + [VCAP_KF_ARP_OPCODE_UNKNOWN_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 138, + .width =3D 1, + }, + [VCAP_KF_ARP_OPCODE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 139, + .width =3D 2, + }, + [VCAP_KF_L3_IP4_DIP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 141, + .width =3D 32, + }, + [VCAP_KF_L3_IP4_SIP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 173, + .width =3D 32, + }, + [VCAP_KF_L3_DIP_EQ_SIP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 205, + .width =3D 1, + }, + [VCAP_KF_L4_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 206, + .width =3D 16, + }, +}; + +static const struct vcap_field is2_ip4_tcp_udp_keyfield[] =3D { + [VCAP_KF_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 0, + .width =3D 4, + }, + [VCAP_KF_LOOKUP_FIRST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 4, + .width =3D 1, + }, + [VCAP_KF_LOOKUP_PAG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 5, + .width =3D 8, + }, + [VCAP_KF_IF_IGR_PORT_MASK_L3] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 13, + .width =3D 1, + }, + [VCAP_KF_IF_IGR_PORT_MASK_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 14, + .width =3D 4, + }, + [VCAP_KF_IF_IGR_PORT_MASK_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 18, + .width =3D 2, + }, + [VCAP_KF_IF_IGR_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 20, + .width =3D 32, + }, + [VCAP_KF_L2_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 52, + .width =3D 1, + }, + [VCAP_KF_L2_BC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 53, + .width =3D 1, + }, + [VCAP_KF_8021Q_VLAN_TAGGED_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 54, + .width =3D 1, + }, + [VCAP_KF_ISDX_GT0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 56, + .width =3D 1, + }, + [VCAP_KF_ISDX_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 57, + .width =3D 10, + }, + [VCAP_KF_8021Q_VID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 67, + .width =3D 13, + }, + [VCAP_KF_8021Q_DEI_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 80, + .width =3D 1, + }, + [VCAP_KF_8021Q_PCP_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 81, + .width =3D 3, + }, + [VCAP_KF_L2_FWD_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 84, + .width =3D 1, + }, + [VCAP_KF_L3_RT_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 87, + .width =3D 1, + }, + [VCAP_KF_L3_DST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 88, + .width =3D 1, + }, + [VCAP_KF_IP4_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 89, + .width =3D 1, + }, + [VCAP_KF_L3_FRAGMENT_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 90, + .width =3D 2, + }, + [VCAP_KF_L3_FRAG_INVLD_L4_LEN] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 92, + .width =3D 1, + }, + [VCAP_KF_L3_OPTIONS_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 93, + .width =3D 1, + }, + [VCAP_KF_L3_TTL_GT0] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 94, + .width =3D 1, + }, + [VCAP_KF_L3_TOS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 95, + .width =3D 8, + }, + [VCAP_KF_L3_IP4_DIP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 103, + .width =3D 32, + }, + [VCAP_KF_L3_IP4_SIP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 135, + .width =3D 32, + }, + [VCAP_KF_L3_DIP_EQ_SIP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 167, + .width =3D 1, + }, + [VCAP_KF_TCP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 168, + .width =3D 1, + }, + [VCAP_KF_L4_DPORT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 169, + .width =3D 16, + }, + [VCAP_KF_L4_SPORT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 185, + .width =3D 16, + }, + [VCAP_KF_L4_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 201, + .width =3D 16, + }, + [VCAP_KF_L4_SPORT_EQ_DPORT_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 217, + .width =3D 1, + }, + [VCAP_KF_L4_SEQUENCE_EQ0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 218, + .width =3D 1, + }, + [VCAP_KF_L4_FIN] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 219, + .width =3D 1, + }, + [VCAP_KF_L4_SYN] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 220, + .width =3D 1, + }, + [VCAP_KF_L4_RST] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 221, + .width =3D 1, + }, + [VCAP_KF_L4_PSH] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 222, + .width =3D 1, + }, + [VCAP_KF_L4_ACK] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 223, + .width =3D 1, + }, + [VCAP_KF_L4_URG] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 224, + .width =3D 1, + }, + [VCAP_KF_L4_PAYLOAD] =3D { + .type =3D VCAP_FIELD_U64, + .offset =3D 225, + .width =3D 64, + }, +}; + +static const struct vcap_field is2_ip4_other_keyfield[] =3D { + [VCAP_KF_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 0, + .width =3D 4, + }, + [VCAP_KF_LOOKUP_FIRST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 4, + .width =3D 1, + }, + [VCAP_KF_LOOKUP_PAG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 5, + .width =3D 8, + }, + [VCAP_KF_IF_IGR_PORT_MASK_L3] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 13, + .width =3D 1, + }, + [VCAP_KF_IF_IGR_PORT_MASK_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 14, + .width =3D 4, + }, + [VCAP_KF_IF_IGR_PORT_MASK_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 18, + .width =3D 2, + }, + [VCAP_KF_IF_IGR_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 20, + .width =3D 32, + }, + [VCAP_KF_L2_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 52, + .width =3D 1, + }, + [VCAP_KF_L2_BC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 53, + .width =3D 1, + }, + [VCAP_KF_8021Q_VLAN_TAGGED_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 54, + .width =3D 1, + }, + [VCAP_KF_ISDX_GT0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 56, + .width =3D 1, + }, + [VCAP_KF_ISDX_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 57, + .width =3D 10, + }, + [VCAP_KF_8021Q_VID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 67, + .width =3D 13, + }, + [VCAP_KF_8021Q_DEI_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 80, + .width =3D 1, + }, + [VCAP_KF_8021Q_PCP_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 81, + .width =3D 3, + }, + [VCAP_KF_L2_FWD_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 84, + .width =3D 1, + }, + [VCAP_KF_L3_RT_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 87, + .width =3D 1, + }, + [VCAP_KF_L3_DST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 88, + .width =3D 1, + }, + [VCAP_KF_IP4_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 89, + .width =3D 1, + }, + [VCAP_KF_L3_FRAGMENT_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 90, + .width =3D 2, + }, + [VCAP_KF_L3_FRAG_INVLD_L4_LEN] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 92, + .width =3D 1, + }, + [VCAP_KF_L3_OPTIONS_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 93, + .width =3D 1, + }, + [VCAP_KF_L3_TTL_GT0] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 94, + .width =3D 1, + }, + [VCAP_KF_L3_TOS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 95, + .width =3D 8, + }, + [VCAP_KF_L3_IP4_DIP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 103, + .width =3D 32, + }, + [VCAP_KF_L3_IP4_SIP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 135, + .width =3D 32, + }, + [VCAP_KF_L3_DIP_EQ_SIP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 167, + .width =3D 1, + }, + [VCAP_KF_L3_IP_PROTO] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 168, + .width =3D 8, + }, + [VCAP_KF_L4_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 176, + .width =3D 16, + }, + [VCAP_KF_L3_PAYLOAD] =3D { + .type =3D VCAP_FIELD_U112, + .offset =3D 192, + .width =3D 96, + }, +}; + +static const struct vcap_field is2_ip6_std_keyfield[] =3D { + [VCAP_KF_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 0, + .width =3D 4, + }, + [VCAP_KF_LOOKUP_FIRST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 4, + .width =3D 1, + }, + [VCAP_KF_LOOKUP_PAG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 5, + .width =3D 8, + }, + [VCAP_KF_IF_IGR_PORT_MASK_L3] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 13, + .width =3D 1, + }, + [VCAP_KF_IF_IGR_PORT_MASK_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 14, + .width =3D 4, + }, + [VCAP_KF_IF_IGR_PORT_MASK_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 18, + .width =3D 2, + }, + [VCAP_KF_IF_IGR_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 20, + .width =3D 32, + }, + [VCAP_KF_L2_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 52, + .width =3D 1, + }, + [VCAP_KF_L2_BC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 53, + .width =3D 1, + }, + [VCAP_KF_8021Q_VLAN_TAGGED_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 54, + .width =3D 1, + }, + [VCAP_KF_ISDX_GT0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 56, + .width =3D 1, + }, + [VCAP_KF_ISDX_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 57, + .width =3D 10, + }, + [VCAP_KF_8021Q_VID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 67, + .width =3D 13, + }, + [VCAP_KF_8021Q_DEI_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 80, + .width =3D 1, + }, + [VCAP_KF_8021Q_PCP_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 81, + .width =3D 3, + }, + [VCAP_KF_L2_FWD_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 84, + .width =3D 1, + }, + [VCAP_KF_L3_RT_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 87, + .width =3D 1, + }, + [VCAP_KF_L3_TTL_GT0] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 89, + .width =3D 1, + }, + [VCAP_KF_L3_IP6_SIP] =3D { + .type =3D VCAP_FIELD_U128, + .offset =3D 90, + .width =3D 128, + }, + [VCAP_KF_L3_DIP_EQ_SIP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 218, + .width =3D 1, + }, + [VCAP_KF_L3_IP_PROTO] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 219, + .width =3D 8, + }, + [VCAP_KF_L4_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 227, + .width =3D 16, + }, + [VCAP_KF_L3_PAYLOAD] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 243, + .width =3D 40, + }, +}; + +static const struct vcap_field is2_ip_7tuple_keyfield[] =3D { + [VCAP_KF_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 0, + .width =3D 2, + }, + [VCAP_KF_LOOKUP_FIRST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 2, + .width =3D 1, + }, + [VCAP_KF_LOOKUP_PAG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 3, + .width =3D 8, + }, + [VCAP_KF_IF_IGR_PORT_MASK_L3] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 11, + .width =3D 1, + }, + [VCAP_KF_IF_IGR_PORT_MASK_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 12, + .width =3D 4, + }, + [VCAP_KF_IF_IGR_PORT_MASK_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 16, + .width =3D 2, + }, + [VCAP_KF_IF_IGR_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U72, + .offset =3D 18, + .width =3D 65, + }, + [VCAP_KF_L2_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 83, + .width =3D 1, + }, + [VCAP_KF_L2_BC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 84, + .width =3D 1, + }, + [VCAP_KF_8021Q_VLAN_TAGGED_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 85, + .width =3D 1, + }, + [VCAP_KF_ISDX_GT0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 87, + .width =3D 1, + }, + [VCAP_KF_ISDX_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 88, + .width =3D 10, + }, + [VCAP_KF_8021Q_VID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 98, + .width =3D 13, + }, + [VCAP_KF_8021Q_DEI_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 111, + .width =3D 1, + }, + [VCAP_KF_8021Q_PCP_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 112, + .width =3D 3, + }, + [VCAP_KF_L2_FWD_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 115, + .width =3D 1, + }, + [VCAP_KF_L3_RT_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 118, + .width =3D 1, + }, + [VCAP_KF_L3_DST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 119, + .width =3D 1, + }, + [VCAP_KF_L2_DMAC] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 120, + .width =3D 48, + }, + [VCAP_KF_L2_SMAC] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 168, + .width =3D 48, + }, + [VCAP_KF_IP4_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 218, + .width =3D 1, + }, + [VCAP_KF_L3_TTL_GT0] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 219, + .width =3D 1, + }, + [VCAP_KF_L3_TOS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 220, + .width =3D 8, + }, + [VCAP_KF_L3_IP6_DIP] =3D { + .type =3D VCAP_FIELD_U128, + .offset =3D 228, + .width =3D 128, + }, + [VCAP_KF_L3_IP6_SIP] =3D { + .type =3D VCAP_FIELD_U128, + .offset =3D 356, + .width =3D 128, + }, + [VCAP_KF_L3_DIP_EQ_SIP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 484, + .width =3D 1, + }, + [VCAP_KF_TCP_UDP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 485, + .width =3D 1, + }, + [VCAP_KF_TCP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 486, + .width =3D 1, + }, + [VCAP_KF_L4_DPORT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 487, + .width =3D 16, + }, + [VCAP_KF_L4_SPORT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 503, + .width =3D 16, + }, + [VCAP_KF_L4_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 519, + .width =3D 16, + }, + [VCAP_KF_L4_SPORT_EQ_DPORT_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 535, + .width =3D 1, + }, + [VCAP_KF_L4_SEQUENCE_EQ0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 536, + .width =3D 1, + }, + [VCAP_KF_L4_FIN] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 537, + .width =3D 1, + }, + [VCAP_KF_L4_SYN] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 538, + .width =3D 1, + }, + [VCAP_KF_L4_RST] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 539, + .width =3D 1, + }, + [VCAP_KF_L4_PSH] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 540, + .width =3D 1, + }, + [VCAP_KF_L4_ACK] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 541, + .width =3D 1, + }, + [VCAP_KF_L4_URG] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 542, + .width =3D 1, + }, + [VCAP_KF_L4_PAYLOAD] =3D { + .type =3D VCAP_FIELD_U64, + .offset =3D 543, + .width =3D 64, + }, +}; + +static const struct vcap_field es0_isdx_keyfield[] =3D { + [VCAP_KF_TYPE] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 0, + .width =3D 1, + }, + [VCAP_KF_IF_EGR_PORT_NO] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 1, + .width =3D 6, + }, + [VCAP_KF_8021Q_VID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 7, + .width =3D 13, + }, + [VCAP_KF_COSID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 20, + .width =3D 3, + }, + [VCAP_KF_8021Q_TPID] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 23, + .width =3D 3, + }, + [VCAP_KF_L3_DPL_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 26, + .width =3D 1, + }, + [VCAP_KF_ISDX_GT0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 27, + .width =3D 1, + }, + [VCAP_KF_PROT_ACTIVE] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 28, + .width =3D 1, + }, + [VCAP_KF_ISDX_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 38, + .width =3D 10, + }, +}; + +static const struct vcap_field es2_mac_etype_keyfield[] =3D { + [VCAP_KF_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 0, + .width =3D 3, + }, + [VCAP_KF_LOOKUP_FIRST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 3, + .width =3D 1, + }, + [VCAP_KF_L2_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 13, + .width =3D 1, + }, + [VCAP_KF_L2_BC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 14, + .width =3D 1, + }, + [VCAP_KF_ISDX_GT0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 15, + .width =3D 1, + }, + [VCAP_KF_ISDX_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 16, + .width =3D 10, + }, + [VCAP_KF_8021Q_VLAN_TAGGED_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 26, + .width =3D 1, + }, + [VCAP_KF_8021Q_VID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 28, + .width =3D 13, + }, + [VCAP_KF_IF_EGR_PORT_MASK_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 41, + .width =3D 3, + }, + [VCAP_KF_IF_EGR_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 44, + .width =3D 32, + }, + [VCAP_KF_IF_IGR_PORT_SEL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 76, + .width =3D 1, + }, + [VCAP_KF_IF_IGR_PORT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 77, + .width =3D 7, + }, + [VCAP_KF_8021Q_PCP_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 84, + .width =3D 3, + }, + [VCAP_KF_8021Q_DEI_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 87, + .width =3D 1, + }, + [VCAP_KF_COSID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 88, + .width =3D 3, + }, + [VCAP_KF_L3_DPL_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 91, + .width =3D 1, + }, + [VCAP_KF_L3_RT_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 92, + .width =3D 1, + }, + [VCAP_KF_L2_DMAC] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 96, + .width =3D 48, + }, + [VCAP_KF_L2_SMAC] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 144, + .width =3D 48, + }, + [VCAP_KF_ETYPE_LEN_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 192, + .width =3D 1, + }, + [VCAP_KF_ETYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 193, + .width =3D 16, + }, + [VCAP_KF_L2_PAYLOAD_ETYPE] =3D { + .type =3D VCAP_FIELD_U64, + .offset =3D 209, + .width =3D 64, + }, + [VCAP_KF_OAM_CCM_CNTS_EQ0] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 273, + .width =3D 1, + }, + [VCAP_KF_OAM_Y1731_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 274, + .width =3D 1, + }, +}; + +static const struct vcap_field es2_arp_keyfield[] =3D { + [VCAP_KF_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 0, + .width =3D 3, + }, + [VCAP_KF_LOOKUP_FIRST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 3, + .width =3D 1, + }, + [VCAP_KF_L2_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 13, + .width =3D 1, + }, + [VCAP_KF_L2_BC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 14, + .width =3D 1, + }, + [VCAP_KF_ISDX_GT0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 15, + .width =3D 1, + }, + [VCAP_KF_ISDX_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 16, + .width =3D 10, + }, + [VCAP_KF_8021Q_VLAN_TAGGED_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 26, + .width =3D 1, + }, + [VCAP_KF_8021Q_VID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 28, + .width =3D 13, + }, + [VCAP_KF_IF_EGR_PORT_MASK_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 41, + .width =3D 3, + }, + [VCAP_KF_IF_EGR_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 44, + .width =3D 32, + }, + [VCAP_KF_IF_IGR_PORT_SEL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 76, + .width =3D 1, + }, + [VCAP_KF_IF_IGR_PORT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 77, + .width =3D 7, + }, + [VCAP_KF_8021Q_PCP_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 84, + .width =3D 3, + }, + [VCAP_KF_8021Q_DEI_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 87, + .width =3D 1, + }, + [VCAP_KF_COSID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 88, + .width =3D 3, + }, + [VCAP_KF_L3_DPL_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 91, + .width =3D 1, + }, + [VCAP_KF_L2_SMAC] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 95, + .width =3D 48, + }, + [VCAP_KF_ARP_ADDR_SPACE_OK_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 143, + .width =3D 1, + }, + [VCAP_KF_ARP_PROTO_SPACE_OK_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 144, + .width =3D 1, + }, + [VCAP_KF_ARP_LEN_OK_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 145, + .width =3D 1, + }, + [VCAP_KF_ARP_TGT_MATCH_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 146, + .width =3D 1, + }, + [VCAP_KF_ARP_SENDER_MATCH_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 147, + .width =3D 1, + }, + [VCAP_KF_ARP_OPCODE_UNKNOWN_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 148, + .width =3D 1, + }, + [VCAP_KF_ARP_OPCODE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 149, + .width =3D 2, + }, + [VCAP_KF_L3_IP4_DIP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 151, + .width =3D 32, + }, + [VCAP_KF_L3_IP4_SIP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 183, + .width =3D 32, + }, + [VCAP_KF_L3_DIP_EQ_SIP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 215, + .width =3D 1, + }, +}; + +static const struct vcap_field es2_ip4_tcp_udp_keyfield[] =3D { + [VCAP_KF_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 0, + .width =3D 3, + }, + [VCAP_KF_LOOKUP_FIRST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 3, + .width =3D 1, + }, + [VCAP_KF_L2_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 13, + .width =3D 1, + }, + [VCAP_KF_L2_BC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 14, + .width =3D 1, + }, + [VCAP_KF_ISDX_GT0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 15, + .width =3D 1, + }, + [VCAP_KF_ISDX_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 16, + .width =3D 10, + }, + [VCAP_KF_8021Q_VLAN_TAGGED_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 26, + .width =3D 1, + }, + [VCAP_KF_8021Q_VID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 28, + .width =3D 13, + }, + [VCAP_KF_IF_EGR_PORT_MASK_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 41, + .width =3D 3, + }, + [VCAP_KF_IF_EGR_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 44, + .width =3D 32, + }, + [VCAP_KF_IF_IGR_PORT_SEL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 76, + .width =3D 1, + }, + [VCAP_KF_IF_IGR_PORT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 77, + .width =3D 7, + }, + [VCAP_KF_8021Q_PCP_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 84, + .width =3D 3, + }, + [VCAP_KF_8021Q_DEI_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 87, + .width =3D 1, + }, + [VCAP_KF_COSID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 88, + .width =3D 3, + }, + [VCAP_KF_L3_DPL_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 91, + .width =3D 1, + }, + [VCAP_KF_L3_RT_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 92, + .width =3D 1, + }, + [VCAP_KF_IP4_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 96, + .width =3D 1, + }, + [VCAP_KF_L3_FRAGMENT_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 97, + .width =3D 2, + }, + [VCAP_KF_L3_OPTIONS_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 99, + .width =3D 1, + }, + [VCAP_KF_L3_TTL_GT0] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 100, + .width =3D 1, + }, + [VCAP_KF_L3_TOS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 101, + .width =3D 8, + }, + [VCAP_KF_L3_IP4_DIP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 109, + .width =3D 32, + }, + [VCAP_KF_L3_IP4_SIP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 141, + .width =3D 32, + }, + [VCAP_KF_L3_DIP_EQ_SIP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 173, + .width =3D 1, + }, + [VCAP_KF_TCP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 174, + .width =3D 1, + }, + [VCAP_KF_L4_DPORT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 175, + .width =3D 16, + }, + [VCAP_KF_L4_SPORT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 191, + .width =3D 16, + }, + [VCAP_KF_L4_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 207, + .width =3D 16, + }, + [VCAP_KF_L4_SPORT_EQ_DPORT_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 223, + .width =3D 1, + }, + [VCAP_KF_L4_SEQUENCE_EQ0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 224, + .width =3D 1, + }, + [VCAP_KF_L4_FIN] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 225, + .width =3D 1, + }, + [VCAP_KF_L4_SYN] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 226, + .width =3D 1, + }, + [VCAP_KF_L4_RST] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 227, + .width =3D 1, + }, + [VCAP_KF_L4_PSH] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 228, + .width =3D 1, + }, + [VCAP_KF_L4_ACK] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 229, + .width =3D 1, + }, + [VCAP_KF_L4_URG] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 230, + .width =3D 1, + }, + [VCAP_KF_L4_PAYLOAD] =3D { + .type =3D VCAP_FIELD_U64, + .offset =3D 231, + .width =3D 64, + }, +}; + +static const struct vcap_field es2_ip4_other_keyfield[] =3D { + [VCAP_KF_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 0, + .width =3D 3, + }, + [VCAP_KF_LOOKUP_FIRST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 3, + .width =3D 1, + }, + [VCAP_KF_L2_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 13, + .width =3D 1, + }, + [VCAP_KF_L2_BC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 14, + .width =3D 1, + }, + [VCAP_KF_ISDX_GT0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 15, + .width =3D 1, + }, + [VCAP_KF_ISDX_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 16, + .width =3D 10, + }, + [VCAP_KF_8021Q_VLAN_TAGGED_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 26, + .width =3D 1, + }, + [VCAP_KF_8021Q_VID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 28, + .width =3D 13, + }, + [VCAP_KF_IF_EGR_PORT_MASK_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 41, + .width =3D 3, + }, + [VCAP_KF_IF_EGR_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 44, + .width =3D 32, + }, + [VCAP_KF_IF_IGR_PORT_SEL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 76, + .width =3D 1, + }, + [VCAP_KF_IF_IGR_PORT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 77, + .width =3D 7, + }, + [VCAP_KF_8021Q_PCP_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 84, + .width =3D 3, + }, + [VCAP_KF_8021Q_DEI_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 87, + .width =3D 1, + }, + [VCAP_KF_COSID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 88, + .width =3D 3, + }, + [VCAP_KF_L3_DPL_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 91, + .width =3D 1, + }, + [VCAP_KF_L3_RT_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 92, + .width =3D 1, + }, + [VCAP_KF_IP4_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 96, + .width =3D 1, + }, + [VCAP_KF_L3_FRAGMENT_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 97, + .width =3D 2, + }, + [VCAP_KF_L3_OPTIONS_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 99, + .width =3D 1, + }, + [VCAP_KF_L3_TTL_GT0] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 100, + .width =3D 1, + }, + [VCAP_KF_L3_TOS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 101, + .width =3D 8, + }, + [VCAP_KF_L3_IP4_DIP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 109, + .width =3D 32, + }, + [VCAP_KF_L3_IP4_SIP] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 141, + .width =3D 32, + }, + [VCAP_KF_L3_DIP_EQ_SIP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 173, + .width =3D 1, + }, + [VCAP_KF_L3_IP_PROTO] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 174, + .width =3D 8, + }, + [VCAP_KF_L3_PAYLOAD] =3D { + .type =3D VCAP_FIELD_U112, + .offset =3D 182, + .width =3D 96, + }, +}; + +static const struct vcap_field es2_ip_7tuple_keyfield[] =3D { + [VCAP_KF_LOOKUP_FIRST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 0, + .width =3D 1, + }, + [VCAP_KF_L2_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 10, + .width =3D 1, + }, + [VCAP_KF_L2_BC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 11, + .width =3D 1, + }, + [VCAP_KF_ISDX_GT0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 12, + .width =3D 1, + }, + [VCAP_KF_ISDX_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 13, + .width =3D 10, + }, + [VCAP_KF_8021Q_VLAN_TAGGED_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 23, + .width =3D 1, + }, + [VCAP_KF_8021Q_VID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 25, + .width =3D 13, + }, + [VCAP_KF_IF_EGR_PORT_MASK_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 38, + .width =3D 3, + }, + [VCAP_KF_IF_EGR_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 41, + .width =3D 32, + }, + [VCAP_KF_IF_IGR_PORT_SEL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 73, + .width =3D 1, + }, + [VCAP_KF_IF_IGR_PORT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 74, + .width =3D 7, + }, + [VCAP_KF_8021Q_PCP_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 81, + .width =3D 3, + }, + [VCAP_KF_8021Q_DEI_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 84, + .width =3D 1, + }, + [VCAP_KF_COSID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 85, + .width =3D 3, + }, + [VCAP_KF_L3_DPL_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 88, + .width =3D 1, + }, + [VCAP_KF_L3_RT_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 89, + .width =3D 1, + }, + [VCAP_KF_L2_DMAC] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 93, + .width =3D 48, + }, + [VCAP_KF_L2_SMAC] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 141, + .width =3D 48, + }, + [VCAP_KF_IP4_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 191, + .width =3D 1, + }, + [VCAP_KF_L3_TTL_GT0] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 192, + .width =3D 1, + }, + [VCAP_KF_L3_TOS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 193, + .width =3D 8, + }, + [VCAP_KF_L3_IP6_DIP] =3D { + .type =3D VCAP_FIELD_U128, + .offset =3D 201, + .width =3D 128, + }, + [VCAP_KF_L3_IP6_SIP] =3D { + .type =3D VCAP_FIELD_U128, + .offset =3D 329, + .width =3D 128, + }, + [VCAP_KF_L3_DIP_EQ_SIP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 457, + .width =3D 1, + }, + [VCAP_KF_TCP_UDP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 458, + .width =3D 1, + }, + [VCAP_KF_TCP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 459, + .width =3D 1, + }, + [VCAP_KF_L4_DPORT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 460, + .width =3D 16, + }, + [VCAP_KF_L4_SPORT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 476, + .width =3D 16, + }, + [VCAP_KF_L4_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 492, + .width =3D 16, + }, + [VCAP_KF_L4_SPORT_EQ_DPORT_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 508, + .width =3D 1, + }, + [VCAP_KF_L4_SEQUENCE_EQ0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 509, + .width =3D 1, + }, + [VCAP_KF_L4_FIN] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 510, + .width =3D 1, + }, + [VCAP_KF_L4_SYN] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 511, + .width =3D 1, + }, + [VCAP_KF_L4_RST] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 512, + .width =3D 1, + }, + [VCAP_KF_L4_PSH] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 513, + .width =3D 1, + }, + [VCAP_KF_L4_ACK] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 514, + .width =3D 1, + }, + [VCAP_KF_L4_URG] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 515, + .width =3D 1, + }, + [VCAP_KF_L4_PAYLOAD] =3D { + .type =3D VCAP_FIELD_U64, + .offset =3D 516, + .width =3D 64, + }, +}; + +static const struct vcap_field es2_ip6_std_keyfield[] =3D { + [VCAP_KF_TYPE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 0, + .width =3D 3, + }, + [VCAP_KF_LOOKUP_FIRST_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 3, + .width =3D 1, + }, + [VCAP_KF_L2_MC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 13, + .width =3D 1, + }, + [VCAP_KF_L2_BC_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 14, + .width =3D 1, + }, + [VCAP_KF_ISDX_GT0_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 15, + .width =3D 1, + }, + [VCAP_KF_ISDX_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 16, + .width =3D 10, + }, + [VCAP_KF_8021Q_VLAN_TAGGED_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 26, + .width =3D 1, + }, + [VCAP_KF_8021Q_VID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 28, + .width =3D 13, + }, + [VCAP_KF_IF_EGR_PORT_MASK_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 41, + .width =3D 3, + }, + [VCAP_KF_IF_EGR_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 44, + .width =3D 32, + }, + [VCAP_KF_IF_IGR_PORT_SEL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 76, + .width =3D 1, + }, + [VCAP_KF_IF_IGR_PORT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 77, + .width =3D 7, + }, + [VCAP_KF_8021Q_PCP_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 84, + .width =3D 3, + }, + [VCAP_KF_8021Q_DEI_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 87, + .width =3D 1, + }, + [VCAP_KF_COSID_CLS] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 88, + .width =3D 3, + }, + [VCAP_KF_L3_DPL_CLS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 91, + .width =3D 1, + }, + [VCAP_KF_L3_RT_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 92, + .width =3D 1, + }, + [VCAP_KF_L3_TTL_GT0] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 96, + .width =3D 1, + }, + [VCAP_KF_L3_IP6_SIP] =3D { + .type =3D VCAP_FIELD_U128, + .offset =3D 97, + .width =3D 128, + }, + [VCAP_KF_L3_DIP_EQ_SIP_IS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 225, + .width =3D 1, + }, + [VCAP_KF_L3_IP_PROTO] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 226, + .width =3D 8, + }, + [VCAP_KF_L4_RNG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 234, + .width =3D 16, + }, + [VCAP_KF_L3_PAYLOAD] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 250, + .width =3D 40, + }, +}; + +/* keyfield_set */ +static const struct vcap_set is0_keyfield_set[] =3D { + [VCAP_KFS_NORMAL_7TUPLE] =3D { + .type_id =3D 0, + .sw_per_item =3D 12, + .sw_cnt =3D 1, + }, + [VCAP_KFS_NORMAL_5TUPLE_IP4] =3D { + .type_id =3D 2, + .sw_per_item =3D 6, + .sw_cnt =3D 2, + }, +}; + +static const struct vcap_set is2_keyfield_set[] =3D { + [VCAP_KFS_MAC_ETYPE] =3D { + .type_id =3D 0, + .sw_per_item =3D 6, + .sw_cnt =3D 2, + }, + [VCAP_KFS_ARP] =3D { + .type_id =3D 3, + .sw_per_item =3D 6, + .sw_cnt =3D 2, + }, + [VCAP_KFS_IP4_TCP_UDP] =3D { + .type_id =3D 4, + .sw_per_item =3D 6, + .sw_cnt =3D 2, + }, + [VCAP_KFS_IP4_OTHER] =3D { + .type_id =3D 5, + .sw_per_item =3D 6, + .sw_cnt =3D 2, + }, + [VCAP_KFS_IP6_STD] =3D { + .type_id =3D 6, + .sw_per_item =3D 6, + .sw_cnt =3D 2, + }, + [VCAP_KFS_IP_7TUPLE] =3D { + .type_id =3D 1, + .sw_per_item =3D 12, + .sw_cnt =3D 1, + }, +}; + +static const struct vcap_set es0_keyfield_set[] =3D { + [VCAP_KFS_ISDX] =3D { + .type_id =3D 0, + .sw_per_item =3D 1, + .sw_cnt =3D 1, + }, +}; + +static const struct vcap_set es2_keyfield_set[] =3D { + [VCAP_KFS_MAC_ETYPE] =3D { + .type_id =3D 0, + .sw_per_item =3D 6, + .sw_cnt =3D 2, + }, + [VCAP_KFS_ARP] =3D { + .type_id =3D 1, + .sw_per_item =3D 6, + .sw_cnt =3D 2, + }, + [VCAP_KFS_IP4_TCP_UDP] =3D { + .type_id =3D 2, + .sw_per_item =3D 6, + .sw_cnt =3D 2, + }, + [VCAP_KFS_IP4_OTHER] =3D { + .type_id =3D 3, + .sw_per_item =3D 6, + .sw_cnt =3D 2, + }, + [VCAP_KFS_IP_7TUPLE] =3D { + .type_id =3D -1, + .sw_per_item =3D 12, + .sw_cnt =3D 1, + }, + [VCAP_KFS_IP6_STD] =3D { + .type_id =3D 4, + .sw_per_item =3D 6, + .sw_cnt =3D 2, + }, +}; + +/* keyfield_set map */ +static const struct vcap_field *is0_keyfield_set_map[] =3D { + [VCAP_KFS_NORMAL_7TUPLE] =3D is0_normal_7tuple_keyfield, + [VCAP_KFS_NORMAL_5TUPLE_IP4] =3D is0_normal_5tuple_ip4_keyfield, +}; + +static const struct vcap_field *is2_keyfield_set_map[] =3D { + [VCAP_KFS_MAC_ETYPE] =3D is2_mac_etype_keyfield, + [VCAP_KFS_ARP] =3D is2_arp_keyfield, + [VCAP_KFS_IP4_TCP_UDP] =3D is2_ip4_tcp_udp_keyfield, + [VCAP_KFS_IP4_OTHER] =3D is2_ip4_other_keyfield, + [VCAP_KFS_IP6_STD] =3D is2_ip6_std_keyfield, + [VCAP_KFS_IP_7TUPLE] =3D is2_ip_7tuple_keyfield, +}; + +static const struct vcap_field *es0_keyfield_set_map[] =3D { + [VCAP_KFS_ISDX] =3D es0_isdx_keyfield, +}; + +static const struct vcap_field *es2_keyfield_set_map[] =3D { + [VCAP_KFS_MAC_ETYPE] =3D es2_mac_etype_keyfield, + [VCAP_KFS_ARP] =3D es2_arp_keyfield, + [VCAP_KFS_IP4_TCP_UDP] =3D es2_ip4_tcp_udp_keyfield, + [VCAP_KFS_IP4_OTHER] =3D es2_ip4_other_keyfield, + [VCAP_KFS_IP_7TUPLE] =3D es2_ip_7tuple_keyfield, + [VCAP_KFS_IP6_STD] =3D es2_ip6_std_keyfield, +}; + +/* keyfield_set map sizes */ +static int is0_keyfield_set_map_size[] =3D { + [VCAP_KFS_NORMAL_7TUPLE] =3D ARRAY_SIZE(is0_normal_7tuple_keyfield), + [VCAP_KFS_NORMAL_5TUPLE_IP4] =3D ARRAY_SIZE(is0_normal_5tuple_ip4_keyfiel= d), +}; + +static int is2_keyfield_set_map_size[] =3D { + [VCAP_KFS_MAC_ETYPE] =3D ARRAY_SIZE(is2_mac_etype_keyfield), + [VCAP_KFS_ARP] =3D ARRAY_SIZE(is2_arp_keyfield), + [VCAP_KFS_IP4_TCP_UDP] =3D ARRAY_SIZE(is2_ip4_tcp_udp_keyfield), + [VCAP_KFS_IP4_OTHER] =3D ARRAY_SIZE(is2_ip4_other_keyfield), + [VCAP_KFS_IP6_STD] =3D ARRAY_SIZE(is2_ip6_std_keyfield), + [VCAP_KFS_IP_7TUPLE] =3D ARRAY_SIZE(is2_ip_7tuple_keyfield), +}; + +static int es0_keyfield_set_map_size[] =3D { + [VCAP_KFS_ISDX] =3D ARRAY_SIZE(es0_isdx_keyfield), +}; + +static int es2_keyfield_set_map_size[] =3D { + [VCAP_KFS_MAC_ETYPE] =3D ARRAY_SIZE(es2_mac_etype_keyfield), + [VCAP_KFS_ARP] =3D ARRAY_SIZE(es2_arp_keyfield), + [VCAP_KFS_IP4_TCP_UDP] =3D ARRAY_SIZE(es2_ip4_tcp_udp_keyfield), + [VCAP_KFS_IP4_OTHER] =3D ARRAY_SIZE(es2_ip4_other_keyfield), + [VCAP_KFS_IP_7TUPLE] =3D ARRAY_SIZE(es2_ip_7tuple_keyfield), + [VCAP_KFS_IP6_STD] =3D ARRAY_SIZE(es2_ip6_std_keyfield), +}; + +/* actionfields */ +static const struct vcap_field is0_classification_actionfield[] =3D { + [VCAP_AF_TYPE] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 0, + .width =3D 1, + }, + [VCAP_AF_DSCP_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 1, + .width =3D 1, + }, + [VCAP_AF_DSCP_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 2, + .width =3D 6, + }, + [VCAP_AF_QOS_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 12, + .width =3D 1, + }, + [VCAP_AF_QOS_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 13, + .width =3D 3, + }, + [VCAP_AF_DP_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 16, + .width =3D 1, + }, + [VCAP_AF_DP_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 17, + .width =3D 2, + }, + [VCAP_AF_DEI_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 19, + .width =3D 1, + }, + [VCAP_AF_DEI_VAL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 20, + .width =3D 1, + }, + [VCAP_AF_PCP_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 21, + .width =3D 1, + }, + [VCAP_AF_PCP_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 22, + .width =3D 3, + }, + [VCAP_AF_MAP_LOOKUP_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 25, + .width =3D 2, + }, + [VCAP_AF_MAP_KEY] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 27, + .width =3D 3, + }, + [VCAP_AF_MAP_IDX] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 30, + .width =3D 7, + }, + [VCAP_AF_CLS_VID_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 37, + .width =3D 3, + }, + [VCAP_AF_VID_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 43, + .width =3D 13, + }, + [VCAP_AF_ISDX_ADD_REPLACE_SEL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 66, + .width =3D 1, + }, + [VCAP_AF_ISDX_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 67, + .width =3D 10, + }, + [VCAP_AF_PAG_OVERRIDE_MASK] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 107, + .width =3D 8, + }, + [VCAP_AF_PAG_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 115, + .width =3D 8, + }, + [VCAP_AF_NXT_IDX_CTRL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 167, + .width =3D 3, + }, + [VCAP_AF_NXT_IDX] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 170, + .width =3D 10, + }, +}; + +static const struct vcap_field is0_full_actionfield[] =3D { + [VCAP_AF_DSCP_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 0, + .width =3D 1, + }, + [VCAP_AF_DSCP_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 1, + .width =3D 6, + }, + [VCAP_AF_QOS_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 11, + .width =3D 1, + }, + [VCAP_AF_QOS_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 12, + .width =3D 3, + }, + [VCAP_AF_DP_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 15, + .width =3D 1, + }, + [VCAP_AF_DP_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 16, + .width =3D 2, + }, + [VCAP_AF_DEI_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 18, + .width =3D 1, + }, + [VCAP_AF_DEI_VAL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 19, + .width =3D 1, + }, + [VCAP_AF_PCP_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 20, + .width =3D 1, + }, + [VCAP_AF_PCP_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 21, + .width =3D 3, + }, + [VCAP_AF_MAP_LOOKUP_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 24, + .width =3D 2, + }, + [VCAP_AF_MAP_KEY] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 26, + .width =3D 3, + }, + [VCAP_AF_MAP_IDX] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 29, + .width =3D 7, + }, + [VCAP_AF_CLS_VID_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 36, + .width =3D 3, + }, + [VCAP_AF_VID_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 42, + .width =3D 13, + }, + [VCAP_AF_ISDX_ADD_REPLACE_SEL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 65, + .width =3D 1, + }, + [VCAP_AF_ISDX_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 66, + .width =3D 10, + }, + [VCAP_AF_MASK_MODE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 76, + .width =3D 3, + }, + [VCAP_AF_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 79, + .width =3D 37, + }, + [VCAP_AF_PAG_OVERRIDE_MASK] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 174, + .width =3D 8, + }, + [VCAP_AF_PAG_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 182, + .width =3D 8, + }, + [VCAP_AF_NXT_IDX_CTRL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 266, + .width =3D 3, + }, + [VCAP_AF_NXT_IDX] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 269, + .width =3D 10, + }, +}; + +static const struct vcap_field is0_class_reduced_actionfield[] =3D { + [VCAP_AF_TYPE] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 0, + .width =3D 1, + }, + [VCAP_AF_QOS_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 5, + .width =3D 1, + }, + [VCAP_AF_QOS_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 6, + .width =3D 3, + }, + [VCAP_AF_DP_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 9, + .width =3D 1, + }, + [VCAP_AF_DP_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 10, + .width =3D 2, + }, + [VCAP_AF_MAP_LOOKUP_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 12, + .width =3D 2, + }, + [VCAP_AF_MAP_KEY] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 14, + .width =3D 3, + }, + [VCAP_AF_CLS_VID_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 17, + .width =3D 3, + }, + [VCAP_AF_VID_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 23, + .width =3D 13, + }, + [VCAP_AF_ISDX_ADD_REPLACE_SEL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 46, + .width =3D 1, + }, + [VCAP_AF_ISDX_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 47, + .width =3D 10, + }, + [VCAP_AF_NXT_IDX_CTRL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 89, + .width =3D 3, + }, + [VCAP_AF_NXT_IDX] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 92, + .width =3D 10, + }, +}; + +static const struct vcap_field is2_base_type_actionfield[] =3D { + [VCAP_AF_PIPELINE_FORCE_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 1, + .width =3D 1, + }, + [VCAP_AF_PIPELINE_PT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 2, + .width =3D 5, + }, + [VCAP_AF_HIT_ME_ONCE] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 7, + .width =3D 1, + }, + [VCAP_AF_INTR_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 8, + .width =3D 1, + }, + [VCAP_AF_CPU_COPY_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 9, + .width =3D 1, + }, + [VCAP_AF_CPU_QUEUE_NUM] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 10, + .width =3D 3, + }, + [VCAP_AF_LRN_DIS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 15, + .width =3D 1, + }, + [VCAP_AF_RT_DIS] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 16, + .width =3D 1, + }, + [VCAP_AF_POLICE_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 17, + .width =3D 1, + }, + [VCAP_AF_POLICE_IDX] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 18, + .width =3D 5, + }, + [VCAP_AF_IGNORE_PIPELINE_CTRL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 23, + .width =3D 1, + }, + [VCAP_AF_MASK_MODE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 27, + .width =3D 3, + }, + [VCAP_AF_PORT_MASK] =3D { + .type =3D VCAP_FIELD_U48, + .offset =3D 30, + .width =3D 37, + }, + [VCAP_AF_MIRROR_PROBE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 78, + .width =3D 2, + }, + [VCAP_AF_MATCH_ID] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 131, + .width =3D 16, + }, + [VCAP_AF_MATCH_ID_MASK] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 147, + .width =3D 16, + }, + [VCAP_AF_CNT_ID] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 163, + .width =3D 10, + }, +}; + +static const struct vcap_field es0_es0_actionfield[] =3D { + [VCAP_AF_PUSH_OUTER_TAG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 0, + .width =3D 2, + }, + [VCAP_AF_PUSH_INNER_TAG] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 2, + .width =3D 1, + }, + [VCAP_AF_TAG_A_TPID_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 3, + .width =3D 3, + }, + [VCAP_AF_TAG_A_VID_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 6, + .width =3D 2, + }, + [VCAP_AF_TAG_A_PCP_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 8, + .width =3D 3, + }, + [VCAP_AF_TAG_A_DEI_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 11, + .width =3D 3, + }, + [VCAP_AF_TAG_B_TPID_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 14, + .width =3D 3, + }, + [VCAP_AF_TAG_B_VID_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 17, + .width =3D 2, + }, + [VCAP_AF_TAG_B_PCP_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 19, + .width =3D 3, + }, + [VCAP_AF_TAG_B_DEI_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 22, + .width =3D 3, + }, + [VCAP_AF_TAG_C_TPID_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 25, + .width =3D 3, + }, + [VCAP_AF_TAG_C_PCP_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 28, + .width =3D 3, + }, + [VCAP_AF_TAG_C_DEI_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 31, + .width =3D 3, + }, + [VCAP_AF_VID_A_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 34, + .width =3D 12, + }, + [VCAP_AF_PCP_A_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 46, + .width =3D 3, + }, + [VCAP_AF_DEI_A_VAL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 49, + .width =3D 1, + }, + [VCAP_AF_VID_B_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 50, + .width =3D 12, + }, + [VCAP_AF_PCP_B_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 62, + .width =3D 3, + }, + [VCAP_AF_DEI_B_VAL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 65, + .width =3D 1, + }, + [VCAP_AF_VID_C_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 66, + .width =3D 12, + }, + [VCAP_AF_PCP_C_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 78, + .width =3D 3, + }, + [VCAP_AF_DEI_C_VAL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 81, + .width =3D 1, + }, + [VCAP_AF_POP_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 82, + .width =3D 2, + }, + [VCAP_AF_UNTAG_VID_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 84, + .width =3D 1, + }, + [VCAP_AF_PUSH_CUSTOMER_TAG] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 85, + .width =3D 2, + }, + [VCAP_AF_TAG_C_VID_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 87, + .width =3D 2, + }, + [VCAP_AF_DSCP_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 127, + .width =3D 3, + }, + [VCAP_AF_DSCP_VAL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 130, + .width =3D 6, + }, + [VCAP_AF_ESDX] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 319, + .width =3D 10, + }, + [VCAP_AF_FWD_SEL] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 438, + .width =3D 2, + }, + [VCAP_AF_CPU_QU] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 440, + .width =3D 3, + }, + [VCAP_AF_PIPELINE_PT] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 443, + .width =3D 2, + }, + [VCAP_AF_PIPELINE_ACT] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 445, + .width =3D 1, + }, + [VCAP_AF_SWAP_MACS_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 454, + .width =3D 1, + }, + [VCAP_AF_LOOP_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 455, + .width =3D 1, + }, +}; + +static const struct vcap_field es2_base_type_actionfield[] =3D { + [VCAP_AF_HIT_ME_ONCE] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 0, + .width =3D 1, + }, + [VCAP_AF_INTR_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 1, + .width =3D 1, + }, + [VCAP_AF_FWD_MODE] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 2, + .width =3D 2, + }, + [VCAP_AF_COPY_QUEUE_NUM] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 4, + .width =3D 14, + }, + [VCAP_AF_COPY_PORT_NUM] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 18, + .width =3D 6, + }, + [VCAP_AF_MIRROR_PROBE_ID] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 24, + .width =3D 2, + }, + [VCAP_AF_CPU_COPY_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 26, + .width =3D 1, + }, + [VCAP_AF_CPU_QUEUE_NUM] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 27, + .width =3D 3, + }, + [VCAP_AF_POLICE_ENA] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 30, + .width =3D 1, + }, + [VCAP_AF_POLICE_REMARK] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 31, + .width =3D 1, + }, + [VCAP_AF_POLICE_IDX] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 32, + .width =3D 5, + }, + [VCAP_AF_ES2_REW_CMD] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 37, + .width =3D 3, + }, + [VCAP_AF_CNT_ID] =3D { + .type =3D VCAP_FIELD_U32, + .offset =3D 40, + .width =3D 9, + }, + [VCAP_AF_IGNORE_PIPELINE_CTRL] =3D { + .type =3D VCAP_FIELD_BIT, + .offset =3D 49, + .width =3D 1, + }, +}; + +/* actionfield_set */ +static const struct vcap_set is0_actionfield_set[] =3D { + [VCAP_AFS_CLASSIFICATION] =3D { + .type_id =3D 1, + .sw_per_item =3D 2, + .sw_cnt =3D 6, + }, + [VCAP_AFS_FULL] =3D { + .type_id =3D -1, + .sw_per_item =3D 3, + .sw_cnt =3D 4, + }, + [VCAP_AFS_CLASS_REDUCED] =3D { + .type_id =3D 1, + .sw_per_item =3D 1, + .sw_cnt =3D 12, + }, +}; + +static const struct vcap_set is2_actionfield_set[] =3D { + [VCAP_AFS_BASE_TYPE] =3D { + .type_id =3D -1, + .sw_per_item =3D 3, + .sw_cnt =3D 4, + }, +}; + +static const struct vcap_set es0_actionfield_set[] =3D { + [VCAP_AFS_ES0] =3D { + .type_id =3D -1, + .sw_per_item =3D 1, + .sw_cnt =3D 1, + }, +}; + +static const struct vcap_set es2_actionfield_set[] =3D { + [VCAP_AFS_BASE_TYPE] =3D { + .type_id =3D -1, + .sw_per_item =3D 3, + .sw_cnt =3D 4, + }, +}; + +/* actionfield_set map */ +static const struct vcap_field *is0_actionfield_set_map[] =3D { + [VCAP_AFS_CLASSIFICATION] =3D is0_classification_actionfield, + [VCAP_AFS_FULL] =3D is0_full_actionfield, + [VCAP_AFS_CLASS_REDUCED] =3D is0_class_reduced_actionfield, +}; + +static const struct vcap_field *is2_actionfield_set_map[] =3D { + [VCAP_AFS_BASE_TYPE] =3D is2_base_type_actionfield, +}; + +static const struct vcap_field *es0_actionfield_set_map[] =3D { + [VCAP_AFS_ES0] =3D es0_es0_actionfield, +}; + +static const struct vcap_field *es2_actionfield_set_map[] =3D { + [VCAP_AFS_BASE_TYPE] =3D es2_base_type_actionfield, +}; + +/* actionfield_set map size */ +static int is0_actionfield_set_map_size[] =3D { + [VCAP_AFS_CLASSIFICATION] =3D ARRAY_SIZE(is0_classification_actionfield), + [VCAP_AFS_FULL] =3D ARRAY_SIZE(is0_full_actionfield), + [VCAP_AFS_CLASS_REDUCED] =3D ARRAY_SIZE(is0_class_reduced_actionfield), +}; + +static int is2_actionfield_set_map_size[] =3D { + [VCAP_AFS_BASE_TYPE] =3D ARRAY_SIZE(is2_base_type_actionfield), +}; + +static int es0_actionfield_set_map_size[] =3D { + [VCAP_AFS_ES0] =3D ARRAY_SIZE(es0_es0_actionfield), +}; + +static int es2_actionfield_set_map_size[] =3D { + [VCAP_AFS_BASE_TYPE] =3D ARRAY_SIZE(es2_base_type_actionfield), +}; + +/* Type Groups */ +static const struct vcap_typegroup is0_x12_keyfield_set_typegroups[] =3D { + { + .offset =3D 0, + .width =3D 5, + .value =3D 16, + }, + { + .offset =3D 52, + .width =3D 1, + .value =3D 0, + }, + { + .offset =3D 104, + .width =3D 2, + .value =3D 0, + }, + { + .offset =3D 156, + .width =3D 3, + .value =3D 0, + }, + { + .offset =3D 208, + .width =3D 2, + .value =3D 0, + }, + { + .offset =3D 260, + .width =3D 1, + .value =3D 0, + }, + { + .offset =3D 312, + .width =3D 4, + .value =3D 0, + }, + { + .offset =3D 364, + .width =3D 1, + .value =3D 0, + }, + { + .offset =3D 416, + .width =3D 2, + .value =3D 0, + }, + { + .offset =3D 468, + .width =3D 3, + .value =3D 0, + }, + { + .offset =3D 520, + .width =3D 2, + .value =3D 0, + }, + { + .offset =3D 572, + .width =3D 1, + .value =3D 0, + }, + {} +}; + +static const struct vcap_typegroup is0_x6_keyfield_set_typegroups[] =3D { + { + .offset =3D 0, + .width =3D 4, + .value =3D 8, + }, + { + .offset =3D 52, + .width =3D 1, + .value =3D 0, + }, + { + .offset =3D 104, + .width =3D 2, + .value =3D 0, + }, + { + .offset =3D 156, + .width =3D 3, + .value =3D 0, + }, + { + .offset =3D 208, + .width =3D 2, + .value =3D 0, + }, + { + .offset =3D 260, + .width =3D 1, + .value =3D 0, + }, + {} +}; + +static const struct vcap_typegroup is0_x3_keyfield_set_typegroups[] =3D { + {} +}; + +static const struct vcap_typegroup is0_x2_keyfield_set_typegroups[] =3D { + {} +}; + +static const struct vcap_typegroup is0_x1_keyfield_set_typegroups[] =3D { + {} +}; + +static const struct vcap_typegroup is2_x12_keyfield_set_typegroups[] =3D { + { + .offset =3D 0, + .width =3D 3, + .value =3D 4, + }, + { + .offset =3D 156, + .width =3D 1, + .value =3D 0, + }, + { + .offset =3D 312, + .width =3D 2, + .value =3D 0, + }, + { + .offset =3D 468, + .width =3D 1, + .value =3D 0, + }, + {} +}; + +static const struct vcap_typegroup is2_x6_keyfield_set_typegroups[] =3D { + { + .offset =3D 0, + .width =3D 2, + .value =3D 2, + }, + { + .offset =3D 156, + .width =3D 1, + .value =3D 0, + }, + {} +}; + +static const struct vcap_typegroup is2_x3_keyfield_set_typegroups[] =3D { + {} +}; + +static const struct vcap_typegroup is2_x1_keyfield_set_typegroups[] =3D { + {} +}; + +static const struct vcap_typegroup es0_x1_keyfield_set_typegroups[] =3D { + {} +}; + +static const struct vcap_typegroup es2_x12_keyfield_set_typegroups[] =3D { + { + .offset =3D 0, + .width =3D 3, + .value =3D 4, + }, + { + .offset =3D 156, + .width =3D 1, + .value =3D 0, + }, + { + .offset =3D 312, + .width =3D 2, + .value =3D 0, + }, + { + .offset =3D 468, + .width =3D 1, + .value =3D 0, + }, + {} +}; + +static const struct vcap_typegroup es2_x6_keyfield_set_typegroups[] =3D { + { + .offset =3D 0, + .width =3D 2, + .value =3D 2, + }, + { + .offset =3D 156, + .width =3D 1, + .value =3D 0, + }, + {} +}; + +static const struct vcap_typegroup es2_x3_keyfield_set_typegroups[] =3D { + {} +}; + +static const struct vcap_typegroup es2_x1_keyfield_set_typegroups[] =3D { + {} +}; + +static const struct vcap_typegroup *is0_keyfield_set_typegroups[] =3D { + [12] =3D is0_x12_keyfield_set_typegroups, + [6] =3D is0_x6_keyfield_set_typegroups, + [3] =3D is0_x3_keyfield_set_typegroups, + [2] =3D is0_x2_keyfield_set_typegroups, + [1] =3D is0_x1_keyfield_set_typegroups, + [13] =3D NULL, +}; + +static const struct vcap_typegroup *is2_keyfield_set_typegroups[] =3D { + [12] =3D is2_x12_keyfield_set_typegroups, + [6] =3D is2_x6_keyfield_set_typegroups, + [3] =3D is2_x3_keyfield_set_typegroups, + [1] =3D is2_x1_keyfield_set_typegroups, + [13] =3D NULL, +}; + +static const struct vcap_typegroup *es0_keyfield_set_typegroups[] =3D { + [1] =3D es0_x1_keyfield_set_typegroups, + [2] =3D NULL, +}; + +static const struct vcap_typegroup *es2_keyfield_set_typegroups[] =3D { + [12] =3D es2_x12_keyfield_set_typegroups, + [6] =3D es2_x6_keyfield_set_typegroups, + [3] =3D es2_x3_keyfield_set_typegroups, + [1] =3D es2_x1_keyfield_set_typegroups, + [13] =3D NULL, +}; + +static const struct vcap_typegroup is0_x3_actionfield_set_typegroups[] =3D= { + { + .offset =3D 0, + .width =3D 3, + .value =3D 4, + }, + { + .offset =3D 103, + .width =3D 2, + .value =3D 0, + }, + { + .offset =3D 206, + .width =3D 2, + .value =3D 0, + }, + {} +}; + +static const struct vcap_typegroup is0_x2_actionfield_set_typegroups[] =3D= { + { + .offset =3D 0, + .width =3D 2, + .value =3D 2, + }, + { + .offset =3D 103, + .width =3D 1, + .value =3D 0, + }, + {} +}; + +static const struct vcap_typegroup is0_x1_actionfield_set_typegroups[] =3D= { + { + .offset =3D 0, + .width =3D 1, + .value =3D 1, + }, + {} +}; + +static const struct vcap_typegroup is2_x3_actionfield_set_typegroups[] =3D= { + { + .offset =3D 0, + .width =3D 2, + .value =3D 2, + }, + { + .offset =3D 95, + .width =3D 1, + .value =3D 0, + }, + { + .offset =3D 190, + .width =3D 1, + .value =3D 0, + }, + {} +}; + +static const struct vcap_typegroup is2_x1_actionfield_set_typegroups[] =3D= { + {} +}; + +static const struct vcap_typegroup es0_x1_actionfield_set_typegroups[] =3D= { + {} +}; + +static const struct vcap_typegroup es2_x3_actionfield_set_typegroups[] =3D= { + { + .offset =3D 0, + .width =3D 2, + .value =3D 2, + }, + { + .offset =3D 19, + .width =3D 1, + .value =3D 0, + }, + { + .offset =3D 38, + .width =3D 1, + .value =3D 0, + }, + {} +}; + +static const struct vcap_typegroup es2_x1_actionfield_set_typegroups[] =3D= { + {} +}; + +static const struct vcap_typegroup *is0_actionfield_set_typegroups[] =3D { + [3] =3D is0_x3_actionfield_set_typegroups, + [2] =3D is0_x2_actionfield_set_typegroups, + [1] =3D is0_x1_actionfield_set_typegroups, + [13] =3D NULL, +}; + +static const struct vcap_typegroup *is2_actionfield_set_typegroups[] =3D { + [3] =3D is2_x3_actionfield_set_typegroups, + [1] =3D is2_x1_actionfield_set_typegroups, + [13] =3D NULL, +}; + +static const struct vcap_typegroup *es0_actionfield_set_typegroups[] =3D { + [1] =3D es0_x1_actionfield_set_typegroups, + [2] =3D NULL, +}; + +static const struct vcap_typegroup *es2_actionfield_set_typegroups[] =3D { + [3] =3D es2_x3_actionfield_set_typegroups, + [1] =3D es2_x1_actionfield_set_typegroups, + [13] =3D NULL, +}; + +/* Keyfieldset names */ +static const char * const vcap_keyfield_set_names[] =3D { + [VCAP_KFS_NO_VALUE] =3D "(None)", + [VCAP_KFS_ARP] =3D "VCAP_KFS_ARP", + [VCAP_KFS_ETAG] =3D "VCAP_KFS_ETAG", + [VCAP_KFS_IP4_OTHER] =3D "VCAP_KFS_IP4_OTHER", + [VCAP_KFS_IP4_TCP_UDP] =3D "VCAP_KFS_IP4_TCP_UDP", + [VCAP_KFS_IP4_VID] =3D "VCAP_KFS_IP4_VID", + [VCAP_KFS_IP6_OTHER] =3D "VCAP_KFS_IP6_OTHER", + [VCAP_KFS_IP6_STD] =3D "VCAP_KFS_IP6_STD", + [VCAP_KFS_IP6_TCP_UDP] =3D "VCAP_KFS_IP6_TCP_UDP", + [VCAP_KFS_IP6_VID] =3D "VCAP_KFS_IP6_VID", + [VCAP_KFS_IP_7TUPLE] =3D "VCAP_KFS_IP_7TUPLE", + [VCAP_KFS_ISDX] =3D "VCAP_KFS_ISDX", + [VCAP_KFS_LL_FULL] =3D "VCAP_KFS_LL_FULL", + [VCAP_KFS_MAC_ETYPE] =3D "VCAP_KFS_MAC_ETYPE", + [VCAP_KFS_MAC_LLC] =3D "VCAP_KFS_MAC_LLC", + [VCAP_KFS_MAC_SNAP] =3D "VCAP_KFS_MAC_SNAP", + [VCAP_KFS_NORMAL_5TUPLE_IP4] =3D "VCAP_KFS_NORMAL_5TUPLE_IP4= ", + [VCAP_KFS_NORMAL_7TUPLE] =3D "VCAP_KFS_NORMAL_7TUPLE", + [VCAP_KFS_OAM] =3D "VCAP_KFS_OAM", + [VCAP_KFS_PURE_5TUPLE_IP4] =3D "VCAP_KFS_PURE_5TUPLE_IP4", + [VCAP_KFS_SMAC_SIP4] =3D "VCAP_KFS_SMAC_SIP4", + [VCAP_KFS_SMAC_SIP6] =3D "VCAP_KFS_SMAC_SIP6", +}; + +/* Actionfieldset names */ +static const char * const vcap_actionfield_set_names[] =3D { + [VCAP_AFS_NO_VALUE] =3D "(None)", + [VCAP_AFS_BASE_TYPE] =3D "VCAP_AFS_BASE_TYPE", + [VCAP_AFS_CLASSIFICATION] =3D "VCAP_AFS_CLASSIFICATION", + [VCAP_AFS_CLASS_REDUCED] =3D "VCAP_AFS_CLASS_REDUCED", + [VCAP_AFS_ES0] =3D "VCAP_AFS_ES0", + [VCAP_AFS_FULL] =3D "VCAP_AFS_FULL", + [VCAP_AFS_SMAC_SIP] =3D "VCAP_AFS_SMAC_SIP", +}; + +/* Keyfield names */ +static const char * const vcap_keyfield_names[] =3D { + [VCAP_KF_NO_VALUE] =3D "(None)", + [VCAP_KF_8021BR_ECID_BASE] =3D "8021BR_ECID_BASE", + [VCAP_KF_8021BR_ECID_EXT] =3D "8021BR_ECID_EXT", + [VCAP_KF_8021BR_E_TAGGED] =3D "8021BR_E_TAGGED", + [VCAP_KF_8021BR_GRP] =3D "8021BR_GRP", + [VCAP_KF_8021BR_IGR_ECID_BASE] =3D "8021BR_IGR_ECID_BASE", + [VCAP_KF_8021BR_IGR_ECID_EXT] =3D "8021BR_IGR_ECID_EXT", + [VCAP_KF_8021Q_DEI0] =3D "8021Q_DEI0", + [VCAP_KF_8021Q_DEI1] =3D "8021Q_DEI1", + [VCAP_KF_8021Q_DEI2] =3D "8021Q_DEI2", + [VCAP_KF_8021Q_DEI_CLS] =3D "8021Q_DEI_CLS", + [VCAP_KF_8021Q_PCP0] =3D "8021Q_PCP0", + [VCAP_KF_8021Q_PCP1] =3D "8021Q_PCP1", + [VCAP_KF_8021Q_PCP2] =3D "8021Q_PCP2", + [VCAP_KF_8021Q_PCP_CLS] =3D "8021Q_PCP_CLS", + [VCAP_KF_8021Q_TPID] =3D "8021Q_TPID", + [VCAP_KF_8021Q_TPID0] =3D "8021Q_TPID0", + [VCAP_KF_8021Q_TPID1] =3D "8021Q_TPID1", + [VCAP_KF_8021Q_TPID2] =3D "8021Q_TPID2", + [VCAP_KF_8021Q_VID0] =3D "8021Q_VID0", + [VCAP_KF_8021Q_VID1] =3D "8021Q_VID1", + [VCAP_KF_8021Q_VID2] =3D "8021Q_VID2", + [VCAP_KF_8021Q_VID_CLS] =3D "8021Q_VID_CLS", + [VCAP_KF_8021Q_VLAN_TAGGED_IS] =3D "8021Q_VLAN_TAGGED_IS", + [VCAP_KF_8021Q_VLAN_TAGS] =3D "8021Q_VLAN_TAGS", + [VCAP_KF_ACL_GRP_ID] =3D "ACL_GRP_ID", + [VCAP_KF_ARP_ADDR_SPACE_OK_IS] =3D "ARP_ADDR_SPACE_OK_IS", + [VCAP_KF_ARP_LEN_OK_IS] =3D "ARP_LEN_OK_IS", + [VCAP_KF_ARP_OPCODE] =3D "ARP_OPCODE", + [VCAP_KF_ARP_OPCODE_UNKNOWN_IS] =3D "ARP_OPCODE_UNKNOWN_IS", + [VCAP_KF_ARP_PROTO_SPACE_OK_IS] =3D "ARP_PROTO_SPACE_OK_IS", + [VCAP_KF_ARP_SENDER_MATCH_IS] =3D "ARP_SENDER_MATCH_IS", + [VCAP_KF_ARP_TGT_MATCH_IS] =3D "ARP_TGT_MATCH_IS", + [VCAP_KF_COSID_CLS] =3D "COSID_CLS", + [VCAP_KF_ES0_ISDX_KEY_ENA] =3D "ES0_ISDX_KEY_ENA", + [VCAP_KF_ETYPE] =3D "ETYPE", + [VCAP_KF_ETYPE_LEN_IS] =3D "ETYPE_LEN_IS", + [VCAP_KF_HOST_MATCH] =3D "HOST_MATCH", + [VCAP_KF_IF_EGR_PORT_MASK] =3D "IF_EGR_PORT_MASK", + [VCAP_KF_IF_EGR_PORT_MASK_RNG] =3D "IF_EGR_PORT_MASK_RNG", + [VCAP_KF_IF_EGR_PORT_NO] =3D "IF_EGR_PORT_NO", + [VCAP_KF_IF_IGR_PORT] =3D "IF_IGR_PORT", + [VCAP_KF_IF_IGR_PORT_MASK] =3D "IF_IGR_PORT_MASK", + [VCAP_KF_IF_IGR_PORT_MASK_L3] =3D "IF_IGR_PORT_MASK_L3", + [VCAP_KF_IF_IGR_PORT_MASK_RNG] =3D "IF_IGR_PORT_MASK_RNG", + [VCAP_KF_IF_IGR_PORT_MASK_SEL] =3D "IF_IGR_PORT_MASK_SEL", + [VCAP_KF_IF_IGR_PORT_SEL] =3D "IF_IGR_PORT_SEL", + [VCAP_KF_IP4_IS] =3D "IP4_IS", + [VCAP_KF_IP_MC_IS] =3D "IP_MC_IS", + [VCAP_KF_IP_PAYLOAD_5TUPLE] =3D "IP_PAYLOAD_5TUPLE", + [VCAP_KF_IP_SNAP_IS] =3D "IP_SNAP_IS", + [VCAP_KF_ISDX_CLS] =3D "ISDX_CLS", + [VCAP_KF_ISDX_GT0_IS] =3D "ISDX_GT0_IS", + [VCAP_KF_L2_BC_IS] =3D "L2_BC_IS", + [VCAP_KF_L2_DMAC] =3D "L2_DMAC", + [VCAP_KF_L2_FRM_TYPE] =3D "L2_FRM_TYPE", + [VCAP_KF_L2_FWD_IS] =3D "L2_FWD_IS", + [VCAP_KF_L2_LLC] =3D "L2_LLC", + [VCAP_KF_L2_MC_IS] =3D "L2_MC_IS", + [VCAP_KF_L2_PAYLOAD0] =3D "L2_PAYLOAD0", + [VCAP_KF_L2_PAYLOAD1] =3D "L2_PAYLOAD1", + [VCAP_KF_L2_PAYLOAD2] =3D "L2_PAYLOAD2", + [VCAP_KF_L2_PAYLOAD_ETYPE] =3D "L2_PAYLOAD_ETYPE", + [VCAP_KF_L2_SMAC] =3D "L2_SMAC", + [VCAP_KF_L2_SNAP] =3D "L2_SNAP", + [VCAP_KF_L3_DIP_EQ_SIP_IS] =3D "L3_DIP_EQ_SIP_IS", + [VCAP_KF_L3_DPL_CLS] =3D "L3_DPL_CLS", + [VCAP_KF_L3_DSCP] =3D "L3_DSCP", + [VCAP_KF_L3_DST_IS] =3D "L3_DST_IS", + [VCAP_KF_L3_FRAGMENT] =3D "L3_FRAGMENT", + [VCAP_KF_L3_FRAGMENT_TYPE] =3D "L3_FRAGMENT_TYPE", + [VCAP_KF_L3_FRAG_INVLD_L4_LEN] =3D "L3_FRAG_INVLD_L4_LEN", + [VCAP_KF_L3_FRAG_OFS_GT0] =3D "L3_FRAG_OFS_GT0", + [VCAP_KF_L3_IP4_DIP] =3D "L3_IP4_DIP", + [VCAP_KF_L3_IP4_SIP] =3D "L3_IP4_SIP", + [VCAP_KF_L3_IP6_DIP] =3D "L3_IP6_DIP", + [VCAP_KF_L3_IP6_SIP] =3D "L3_IP6_SIP", + [VCAP_KF_L3_IP_PROTO] =3D "L3_IP_PROTO", + [VCAP_KF_L3_OPTIONS_IS] =3D "L3_OPTIONS_IS", + [VCAP_KF_L3_PAYLOAD] =3D "L3_PAYLOAD", + [VCAP_KF_L3_RT_IS] =3D "L3_RT_IS", + [VCAP_KF_L3_TOS] =3D "L3_TOS", + [VCAP_KF_L3_TTL_GT0] =3D "L3_TTL_GT0", + [VCAP_KF_L4_1588_DOM] =3D "L4_1588_DOM", + [VCAP_KF_L4_1588_VER] =3D "L4_1588_VER", + [VCAP_KF_L4_ACK] =3D "L4_ACK", + [VCAP_KF_L4_DPORT] =3D "L4_DPORT", + [VCAP_KF_L4_FIN] =3D "L4_FIN", + [VCAP_KF_L4_PAYLOAD] =3D "L4_PAYLOAD", + [VCAP_KF_L4_PSH] =3D "L4_PSH", + [VCAP_KF_L4_RNG] =3D "L4_RNG", + [VCAP_KF_L4_RST] =3D "L4_RST", + [VCAP_KF_L4_SEQUENCE_EQ0_IS] =3D "L4_SEQUENCE_EQ0_IS", + [VCAP_KF_L4_SPORT] =3D "L4_SPORT", + [VCAP_KF_L4_SPORT_EQ_DPORT_IS] =3D "L4_SPORT_EQ_DPORT_IS", + [VCAP_KF_L4_SYN] =3D "L4_SYN", + [VCAP_KF_L4_URG] =3D "L4_URG", + [VCAP_KF_LOOKUP_FIRST_IS] =3D "LOOKUP_FIRST_IS", + [VCAP_KF_LOOKUP_GEN_IDX] =3D "LOOKUP_GEN_IDX", + [VCAP_KF_LOOKUP_GEN_IDX_SEL] =3D "LOOKUP_GEN_IDX_SEL", + [VCAP_KF_LOOKUP_PAG] =3D "LOOKUP_PAG", + [VCAP_KF_MIRROR_PROBE] =3D "MIRROR_PROBE", + [VCAP_KF_OAM_CCM_CNTS_EQ0] =3D "OAM_CCM_CNTS_EQ0", + [VCAP_KF_OAM_DETECTED] =3D "OAM_DETECTED", + [VCAP_KF_OAM_FLAGS] =3D "OAM_FLAGS", + [VCAP_KF_OAM_MEL_FLAGS] =3D "OAM_MEL_FLAGS", + [VCAP_KF_OAM_MEPID] =3D "OAM_MEPID", + [VCAP_KF_OAM_OPCODE] =3D "OAM_OPCODE", + [VCAP_KF_OAM_VER] =3D "OAM_VER", + [VCAP_KF_OAM_Y1731_IS] =3D "OAM_Y1731_IS", + [VCAP_KF_PROT_ACTIVE] =3D "PROT_ACTIVE", + [VCAP_KF_TCP_IS] =3D "TCP_IS", + [VCAP_KF_TCP_UDP_IS] =3D "TCP_UDP_IS", + [VCAP_KF_TYPE] =3D "TYPE", +}; + +/* Actionfield names */ +static const char * const vcap_actionfield_names[] =3D { + [VCAP_AF_NO_VALUE] =3D "(None)", + [VCAP_AF_ACL_ID] =3D "ACL_ID", + [VCAP_AF_CLS_VID_SEL] =3D "CLS_VID_SEL", + [VCAP_AF_CNT_ID] =3D "CNT_ID", + [VCAP_AF_COPY_PORT_NUM] =3D "COPY_PORT_NUM", + [VCAP_AF_COPY_QUEUE_NUM] =3D "COPY_QUEUE_NUM", + [VCAP_AF_CPU_COPY_ENA] =3D "CPU_COPY_ENA", + [VCAP_AF_CPU_QU] =3D "CPU_QU", + [VCAP_AF_CPU_QUEUE_NUM] =3D "CPU_QUEUE_NUM", + [VCAP_AF_DEI_A_VAL] =3D "DEI_A_VAL", + [VCAP_AF_DEI_B_VAL] =3D "DEI_B_VAL", + [VCAP_AF_DEI_C_VAL] =3D "DEI_C_VAL", + [VCAP_AF_DEI_ENA] =3D "DEI_ENA", + [VCAP_AF_DEI_VAL] =3D "DEI_VAL", + [VCAP_AF_DP_ENA] =3D "DP_ENA", + [VCAP_AF_DP_VAL] =3D "DP_VAL", + [VCAP_AF_DSCP_ENA] =3D "DSCP_ENA", + [VCAP_AF_DSCP_SEL] =3D "DSCP_SEL", + [VCAP_AF_DSCP_VAL] =3D "DSCP_VAL", + [VCAP_AF_ES2_REW_CMD] =3D "ES2_REW_CMD", + [VCAP_AF_ESDX] =3D "ESDX", + [VCAP_AF_FWD_KILL_ENA] =3D "FWD_KILL_ENA", + [VCAP_AF_FWD_MODE] =3D "FWD_MODE", + [VCAP_AF_FWD_SEL] =3D "FWD_SEL", + [VCAP_AF_HIT_ME_ONCE] =3D "HIT_ME_ONCE", + [VCAP_AF_HOST_MATCH] =3D "HOST_MATCH", + [VCAP_AF_IGNORE_PIPELINE_CTRL] =3D "IGNORE_PIPELINE_CTRL", + [VCAP_AF_INTR_ENA] =3D "INTR_ENA", + [VCAP_AF_ISDX_ADD_REPLACE_SEL] =3D "ISDX_ADD_REPLACE_SEL", + [VCAP_AF_ISDX_ENA] =3D "ISDX_ENA", + [VCAP_AF_ISDX_VAL] =3D "ISDX_VAL", + [VCAP_AF_LOOP_ENA] =3D "LOOP_ENA", + [VCAP_AF_LRN_DIS] =3D "LRN_DIS", + [VCAP_AF_MAP_IDX] =3D "MAP_IDX", + [VCAP_AF_MAP_KEY] =3D "MAP_KEY", + [VCAP_AF_MAP_LOOKUP_SEL] =3D "MAP_LOOKUP_SEL", + [VCAP_AF_MASK_MODE] =3D "MASK_MODE", + [VCAP_AF_MATCH_ID] =3D "MATCH_ID", + [VCAP_AF_MATCH_ID_MASK] =3D "MATCH_ID_MASK", + [VCAP_AF_MIRROR_ENA] =3D "MIRROR_ENA", + [VCAP_AF_MIRROR_PROBE] =3D "MIRROR_PROBE", + [VCAP_AF_MIRROR_PROBE_ID] =3D "MIRROR_PROBE_ID", + [VCAP_AF_NXT_IDX] =3D "NXT_IDX", + [VCAP_AF_NXT_IDX_CTRL] =3D "NXT_IDX_CTRL", + [VCAP_AF_PAG_OVERRIDE_MASK] =3D "PAG_OVERRIDE_MASK", + [VCAP_AF_PAG_VAL] =3D "PAG_VAL", + [VCAP_AF_PCP_A_VAL] =3D "PCP_A_VAL", + [VCAP_AF_PCP_B_VAL] =3D "PCP_B_VAL", + [VCAP_AF_PCP_C_VAL] =3D "PCP_C_VAL", + [VCAP_AF_PCP_ENA] =3D "PCP_ENA", + [VCAP_AF_PCP_VAL] =3D "PCP_VAL", + [VCAP_AF_PIPELINE_ACT] =3D "PIPELINE_ACT", + [VCAP_AF_PIPELINE_FORCE_ENA] =3D "PIPELINE_FORCE_ENA", + [VCAP_AF_PIPELINE_PT] =3D "PIPELINE_PT", + [VCAP_AF_POLICE_ENA] =3D "POLICE_ENA", + [VCAP_AF_POLICE_IDX] =3D "POLICE_IDX", + [VCAP_AF_POLICE_REMARK] =3D "POLICE_REMARK", + [VCAP_AF_POLICE_VCAP_ONLY] =3D "POLICE_VCAP_ONLY", + [VCAP_AF_POP_VAL] =3D "POP_VAL", + [VCAP_AF_PORT_MASK] =3D "PORT_MASK", + [VCAP_AF_PUSH_CUSTOMER_TAG] =3D "PUSH_CUSTOMER_TAG", + [VCAP_AF_PUSH_INNER_TAG] =3D "PUSH_INNER_TAG", + [VCAP_AF_PUSH_OUTER_TAG] =3D "PUSH_OUTER_TAG", + [VCAP_AF_QOS_ENA] =3D "QOS_ENA", + [VCAP_AF_QOS_VAL] =3D "QOS_VAL", + [VCAP_AF_REW_OP] =3D "REW_OP", + [VCAP_AF_RT_DIS] =3D "RT_DIS", + [VCAP_AF_SWAP_MACS_ENA] =3D "SWAP_MACS_ENA", + [VCAP_AF_TAG_A_DEI_SEL] =3D "TAG_A_DEI_SEL", + [VCAP_AF_TAG_A_PCP_SEL] =3D "TAG_A_PCP_SEL", + [VCAP_AF_TAG_A_TPID_SEL] =3D "TAG_A_TPID_SEL", + [VCAP_AF_TAG_A_VID_SEL] =3D "TAG_A_VID_SEL", + [VCAP_AF_TAG_B_DEI_SEL] =3D "TAG_B_DEI_SEL", + [VCAP_AF_TAG_B_PCP_SEL] =3D "TAG_B_PCP_SEL", + [VCAP_AF_TAG_B_TPID_SEL] =3D "TAG_B_TPID_SEL", + [VCAP_AF_TAG_B_VID_SEL] =3D "TAG_B_VID_SEL", + [VCAP_AF_TAG_C_DEI_SEL] =3D "TAG_C_DEI_SEL", + [VCAP_AF_TAG_C_PCP_SEL] =3D "TAG_C_PCP_SEL", + [VCAP_AF_TAG_C_TPID_SEL] =3D "TAG_C_TPID_SEL", + [VCAP_AF_TAG_C_VID_SEL] =3D "TAG_C_VID_SEL", + [VCAP_AF_TYPE] =3D "TYPE", + [VCAP_AF_UNTAG_VID_ENA] =3D "UNTAG_VID_ENA", + [VCAP_AF_VID_A_VAL] =3D "VID_A_VAL", + [VCAP_AF_VID_B_VAL] =3D "VID_B_VAL", + [VCAP_AF_VID_C_VAL] =3D "VID_C_VAL", + [VCAP_AF_VID_VAL] =3D "VID_VAL", +}; + +/* VCAPs */ +const struct vcap_info lan969x_vcaps[] =3D { + [VCAP_TYPE_IS0] =3D { + .name =3D "is0", + .rows =3D 256, + .sw_count =3D 12, + .sw_width =3D 52, + .sticky_width =3D 1, + .act_width =3D 103, + .default_cnt =3D 70, + .require_cnt_dis =3D 0, + .version =3D 1, + .keyfield_set =3D is0_keyfield_set, + .keyfield_set_size =3D ARRAY_SIZE(is0_keyfield_set), + .actionfield_set =3D is0_actionfield_set, + .actionfield_set_size =3D ARRAY_SIZE(is0_actionfield_set), + .keyfield_set_map =3D is0_keyfield_set_map, + .keyfield_set_map_size =3D is0_keyfield_set_map_size, + .actionfield_set_map =3D is0_actionfield_set_map, + .actionfield_set_map_size =3D is0_actionfield_set_map_size, + .keyfield_set_typegroups =3D is0_keyfield_set_typegroups, + .actionfield_set_typegroups =3D is0_actionfield_set_typegroups, + }, + [VCAP_TYPE_IS2] =3D { + .name =3D "is2", + .rows =3D 256, + .sw_count =3D 12, + .sw_width =3D 52, + .sticky_width =3D 1, + .act_width =3D 103, + .default_cnt =3D 38, + .require_cnt_dis =3D 0, + .version =3D 1, + .keyfield_set =3D is2_keyfield_set, + .keyfield_set_size =3D ARRAY_SIZE(is2_keyfield_set), + .actionfield_set =3D is2_actionfield_set, + .actionfield_set_size =3D ARRAY_SIZE(is2_actionfield_set), + .keyfield_set_map =3D is2_keyfield_set_map, + .keyfield_set_map_size =3D is2_keyfield_set_map_size, + .actionfield_set_map =3D is2_actionfield_set_map, + .actionfield_set_map_size =3D is2_actionfield_set_map_size, + .keyfield_set_typegroups =3D is2_keyfield_set_typegroups, + .actionfield_set_typegroups =3D is2_actionfield_set_typegroups, + }, + [VCAP_TYPE_ES0] =3D { + .name =3D "es0", + .rows =3D 1536, + .sw_count =3D 1, + .sw_width =3D 51, + .sticky_width =3D 1, + .act_width =3D 469, + .default_cnt =3D 35, + .require_cnt_dis =3D 0, + .version =3D 1, + .keyfield_set =3D es0_keyfield_set, + .keyfield_set_size =3D ARRAY_SIZE(es0_keyfield_set), + .actionfield_set =3D es0_actionfield_set, + .actionfield_set_size =3D ARRAY_SIZE(es0_actionfield_set), + .keyfield_set_map =3D es0_keyfield_set_map, + .keyfield_set_map_size =3D es0_keyfield_set_map_size, + .actionfield_set_map =3D es0_actionfield_set_map, + .actionfield_set_map_size =3D es0_actionfield_set_map_size, + .keyfield_set_typegroups =3D es0_keyfield_set_typegroups, + .actionfield_set_typegroups =3D es0_actionfield_set_typegroups, + }, + [VCAP_TYPE_ES2] =3D { + .name =3D "es2", + .rows =3D 256, + .sw_count =3D 12, + .sw_width =3D 52, + .sticky_width =3D 1, + .act_width =3D 19, + .default_cnt =3D 39, + .require_cnt_dis =3D 0, + .version =3D 1, + .keyfield_set =3D es2_keyfield_set, + .keyfield_set_size =3D ARRAY_SIZE(es2_keyfield_set), + .actionfield_set =3D es2_actionfield_set, + .actionfield_set_size =3D ARRAY_SIZE(es2_actionfield_set), + .keyfield_set_map =3D es2_keyfield_set_map, + .keyfield_set_map_size =3D es2_keyfield_set_map_size, + .actionfield_set_map =3D es2_actionfield_set_map, + .actionfield_set_map_size =3D es2_actionfield_set_map_size, + .keyfield_set_typegroups =3D es2_keyfield_set_typegroups, + .actionfield_set_typegroups =3D es2_actionfield_set_typegroups, + }, +}; + +const struct vcap_statistics lan969x_vcap_stats =3D { + .name =3D "lan969x", + .count =3D 4, + .keyfield_set_names =3D vcap_keyfield_set_names, + .actionfield_set_names =3D vcap_actionfield_set_names, + .keyfield_names =3D vcap_keyfield_names, + .actionfield_names =3D vcap_actionfield_names, +}; --=20 2.34.1 From nobody Sun Nov 24 22:57:25 2024 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (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 E08941531C2; Fri, 1 Nov 2024 07:10:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730445036; cv=none; b=ZnVviozOy1hDLB8tS05sCLq7PsmnApWVV//Kws76FG85SJG2NEgXKHQnOKNOLyY79ajUv7KtlCdvI81Te86OCIRXvY2t0xr9TxCO0J02Rj6zNVsVdyd/QJctDGgkvcbJ+OqeHDM1OCRhzTWWRMPBvqr8sQnzbxKDxQjXDDq0cGY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730445036; c=relaxed/simple; bh=QoxEepSpxIzxiW268nfycWfp/ZCANVoZdj/L2K/PPzM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=SZxAwWH7FB6qAnsmEDPhMwc9Lni5eTfX7qnCqQQrGtXnmfHLFG+cEs6OQcw7eNeBKNQrcGWDMIKZEYZklVkdL1iX82CxAC7146jGDmCYLdAEp4Yll3UudgBPap3G7pOdF3ZNmvpBmnEPZh85M0pyWHJQDwms+H5HdkTqDMmQjcg= 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=StR7S5Hq; arc=none smtp.client-ip=68.232.153.233 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="StR7S5Hq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1730445034; x=1761981034; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=QoxEepSpxIzxiW268nfycWfp/ZCANVoZdj/L2K/PPzM=; b=StR7S5HqXsyhgnRSJPTufkga0basMfKQSdmpmRpgh8zogqnnaYmy5xCN JEZ0pL5EhP+Tpa0EZXhT0zXjNO0pt6HGCz7DWlOmcUUiEqKYQ6P+2JGlQ DQ7zVrzODItd4349LFOIhYLjk9fp+WyffxL6VgWLLEIyIeFXVGbYieRs1 T+XQ5J+yz+SZij6wV8pBQTJyFx2CVQpNlnTQsXGL87+N7BsE1VnUOK2jm 9ly+ZKACvq0KxvmWQbI0Vqt3Wp1O6e4weGlQVFZFjxcYVavCjLLWyeGZQ fAv/Y1VlrcP00E7LObPWq3qnvZaHip0Oh5MLJsPKytC6I06Vn1asFf/i9 w==; X-CSE-ConnectionGUID: j3YBXS8JS+qztkz9gl3BFg== X-CSE-MsgGUID: AIVyQYU1TU63uRNfiH9Lrg== X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="264868831" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 01 Nov 2024 00:10:32 -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.35; Fri, 1 Nov 2024 00:10:08 -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; Fri, 1 Nov 2024 00:10:05 -0700 From: Daniel Machon Date: Fri, 1 Nov 2024 08:09:12 +0100 Subject: [PATCH net-next 6/6] net: lan969x: add VCAP configuration data 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: quoted-printable Message-ID: <20241101-sparx5-lan969x-switch-driver-3-v1-6-3c76f22f4bfa@microchip.com> References: <20241101-sparx5-lan969x-switch-driver-3-v1-0-3c76f22f4bfa@microchip.com> In-Reply-To: <20241101-sparx5-lan969x-switch-driver-3-v1-0-3c76f22f4bfa@microchip.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , =?utf-8?q?Jens_Emil_Schulz_=C3=98stergaard?= , , , CC: , , X-Mailer: b4 0.14-dev Add configuration data (for consumption by the VCAP API) for the four VCAP's that we are going to support. The following VCAP's will be supported: - VCAP CLM: (also known as IS0) is part of the analyzer and enables frame classification using VCAP functionality. - VCAP IS2: is part of ANA_ACL and enables access control lists, using VCAP functionality. - VCAP ES0: is part of the rewriter and enables rewriting of frames using VCAP functionality. - VCAP ES2: is part of EACL and enables egress access control lists using VCAP functionality The two VCAP's: CLM and IS2 use shared resources from the SUPER VCAP. The SUPER VCAP is a shared pool of 6 blocks that can be distributed freely among CLM and IS2. Each block in the pool has 3,072 addresses with entries, actions, and counters. ES0 and ES2 does not use shared resources. In the configuration data for lan969x CLM uses blocks 2-4 with a total of 6 lookups. IS2 uses blocks 0-1 with a total of 4 lookups. Reviewed-by: Steen Hegelund Reviewed-by: Jens Emil Schulz =C3=98stergaard Signed-off-by: Daniel Machon --- drivers/net/ethernet/microchip/lan969x/Makefile | 2 +- drivers/net/ethernet/microchip/lan969x/lan969x.c | 1 + drivers/net/ethernet/microchip/lan969x/lan969x.h | 3 + .../ethernet/microchip/lan969x/lan969x_vcap_impl.c | 85 ++++++++++++++++++= ++++ 4 files changed, 90 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/microchip/lan969x/Makefile b/drivers/net/= ethernet/microchip/lan969x/Makefile index 3ea560e08a21..9a2351b4f111 100644 --- a/drivers/net/ethernet/microchip/lan969x/Makefile +++ b/drivers/net/ethernet/microchip/lan969x/Makefile @@ -6,7 +6,7 @@ obj-$(CONFIG_LAN969X_SWITCH) +=3D lan969x-switch.o =20 lan969x-switch-y :=3D lan969x_regs.o lan969x.o lan969x_calendar.o \ - lan969x_vcap_ag_api.o + lan969x_vcap_ag_api.o lan969x_vcap_impl.o =20 # Provide include files ccflags-y +=3D -I$(srctree)/drivers/net/ethernet/microchip/fdma diff --git a/drivers/net/ethernet/microchip/lan969x/lan969x.c b/drivers/net= /ethernet/microchip/lan969x/lan969x.c index 0cb9ec1d2054..ac37d0f74ee3 100644 --- a/drivers/net/ethernet/microchip/lan969x/lan969x.c +++ b/drivers/net/ethernet/microchip/lan969x/lan969x.c @@ -321,6 +321,7 @@ static const struct sparx5_consts lan969x_consts =3D { .tod_pin =3D 4, .vcaps =3D lan969x_vcaps, .vcap_stats =3D &lan969x_vcap_stats, + .vcaps_cfg =3D lan969x_vcap_inst_cfg, }; =20 static const struct sparx5_ops lan969x_ops =3D { diff --git a/drivers/net/ethernet/microchip/lan969x/lan969x.h b/drivers/net= /ethernet/microchip/lan969x/lan969x.h index 167281d99c50..2489d0d32dfd 100644 --- a/drivers/net/ethernet/microchip/lan969x/lan969x.h +++ b/drivers/net/ethernet/microchip/lan969x/lan969x.h @@ -18,6 +18,9 @@ extern const struct sparx5_match_data lan969x_desc; extern const struct vcap_statistics lan969x_vcap_stats; extern const struct vcap_info lan969x_vcaps[]; =20 +/* lan969x_vcap_impl.c */ +extern const struct sparx5_vcap_inst lan969x_vcap_inst_cfg[]; + /* lan969x_regs.c */ extern const unsigned int lan969x_tsize[TSIZE_LAST]; extern const unsigned int lan969x_raddr[RADDR_LAST]; diff --git a/drivers/net/ethernet/microchip/lan969x/lan969x_vcap_impl.c b/d= rivers/net/ethernet/microchip/lan969x/lan969x_vcap_impl.c new file mode 100644 index 000000000000..543a1f2bf6bd --- /dev/null +++ b/drivers/net/ethernet/microchip/lan969x/lan969x_vcap_impl.c @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: GPL-2.0+ + +#include "vcap_api.h" +#include "lan969x.h" + +const struct sparx5_vcap_inst lan969x_vcap_inst_cfg[] =3D { + { + .vtype =3D VCAP_TYPE_IS0, /* CLM-0 */ + .vinst =3D 0, + .map_id =3D 1, + .lookups =3D SPARX5_IS0_LOOKUPS, + .lookups_per_instance =3D SPARX5_IS0_LOOKUPS / 3, + .first_cid =3D SPARX5_VCAP_CID_IS0_L0, + .last_cid =3D SPARX5_VCAP_CID_IS0_L2 - 1, + .blockno =3D 2, + .blocks =3D 1, + .ingress =3D true, + }, + { + .vtype =3D VCAP_TYPE_IS0, /* CLM-1 */ + .vinst =3D 1, + .map_id =3D 2, + .lookups =3D SPARX5_IS0_LOOKUPS, + .lookups_per_instance =3D SPARX5_IS0_LOOKUPS / 3, + .first_cid =3D SPARX5_VCAP_CID_IS0_L2, + .last_cid =3D SPARX5_VCAP_CID_IS0_L4 - 1, + .blockno =3D 3, + .blocks =3D 1, + .ingress =3D true, + }, + { + .vtype =3D VCAP_TYPE_IS0, /* CLM-2 */ + .vinst =3D 2, + .map_id =3D 3, + .lookups =3D SPARX5_IS0_LOOKUPS, + .lookups_per_instance =3D SPARX5_IS0_LOOKUPS / 3, + .first_cid =3D SPARX5_VCAP_CID_IS0_L4, + .last_cid =3D SPARX5_VCAP_CID_IS0_MAX, + .blockno =3D 4, + .blocks =3D 1, + .ingress =3D true, + }, + { + .vtype =3D VCAP_TYPE_IS2, /* IS2-0 */ + .vinst =3D 0, + .map_id =3D 4, + .lookups =3D SPARX5_IS2_LOOKUPS, + .lookups_per_instance =3D SPARX5_IS2_LOOKUPS / 2, + .first_cid =3D SPARX5_VCAP_CID_IS2_L0, + .last_cid =3D SPARX5_VCAP_CID_IS2_L2 - 1, + .blockno =3D 0, + .blocks =3D 1, + .ingress =3D true, + }, + { + .vtype =3D VCAP_TYPE_IS2, /* IS2-1 */ + .vinst =3D 1, + .map_id =3D 5, + .lookups =3D SPARX5_IS2_LOOKUPS, + .lookups_per_instance =3D SPARX5_IS2_LOOKUPS / 2, + .first_cid =3D SPARX5_VCAP_CID_IS2_L2, + .last_cid =3D SPARX5_VCAP_CID_IS2_MAX, + .blockno =3D 1, + .blocks =3D 1, + .ingress =3D true, + }, + { + .vtype =3D VCAP_TYPE_ES0, + .lookups =3D SPARX5_ES0_LOOKUPS, + .lookups_per_instance =3D SPARX5_ES0_LOOKUPS, + .first_cid =3D SPARX5_VCAP_CID_ES0_L0, + .last_cid =3D SPARX5_VCAP_CID_ES0_MAX, + .count =3D 1536, + .ingress =3D false, + }, + { + .vtype =3D VCAP_TYPE_ES2, + .lookups =3D SPARX5_ES2_LOOKUPS, + .lookups_per_instance =3D SPARX5_ES2_LOOKUPS, + .first_cid =3D SPARX5_VCAP_CID_ES2_L0, + .last_cid =3D SPARX5_VCAP_CID_ES2_MAX, + .count =3D 1024, + .ingress =3D false, + }, +}; --=20 2.34.1