From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06B49C48BD5 for ; Wed, 26 Jun 2019 03:00:16 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 9856C20883 for ; Wed, 26 Jun 2019 03:00:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9856C20883 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 562741B954; Wed, 26 Jun 2019 05:00:14 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 7ECDB1B464 for ; Wed, 26 Jun 2019 05:00:12 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jun 2019 20:00:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,418,1557212400"; d="scan'208";a="172581457" Received: from kmsmsx155.gar.corp.intel.com ([172.21.73.106]) by orsmga002.jf.intel.com with ESMTP; 25 Jun 2019 20:00:10 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.96]) by KMSMSX155.gar.corp.intel.com ([169.254.15.69]) with mapi id 14.03.0439.000; Wed, 26 Jun 2019 11:00:09 +0800 From: "Zhao1, Wei" To: "Rong, Leyi" , "Ye, Xiaolong" , "Yang, Qiming" CC: "dev@dpdk.org" , "Rong, Leyi" , "Nowlin, Dan" , "Stillwell Jr, Paul M" Thread-Topic: [dpdk-dev] [PATCH 2/3] net/ice/base: add support for ethertype switch filters Thread-Index: AQHVK8duWWC4HFO/xUmkxLTjRSo/eqatPsoA Date: Wed, 26 Jun 2019 03:00:08 +0000 Message-ID: References: <20190626023025.7039-1-leyi.rong@intel.com> <20190626023025.7039-3-leyi.rong@intel.com> In-Reply-To: <20190626023025.7039-3-leyi.rong@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 2/3] net/ice/base: add support for ethertype switch filters X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Tested-by: Wei Zhao > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Leyi Rong > Sent: Wednesday, June 26, 2019 10:30 AM > To: Ye, Xiaolong ; Yang, Qiming > > Cc: dev@dpdk.org; Rong, Leyi ; Nowlin, Dan > ; Stillwell Jr, Paul M > Subject: [dpdk-dev] [PATCH 2/3] net/ice/base: add support for ethertype s= witch > filters >=20 > Add protocol definitions for ethertype. > Add ice_ethtype_hdr structure definition into the ice_prot_hdr union. > Add ethtype offsets into the training packet maps. >=20 > Signed-off-by: Dan Nowlin > Signed-off-by: Paul M Stillwell Jr > Signed-off-by: Leyi Rong > --- > drivers/net/ice/base/ice_protocol_type.h | 6 +++++ > drivers/net/ice/base/ice_switch.c | 32 ++++++++++++++++++------ > 2 files changed, 31 insertions(+), 7 deletions(-) >=20 > diff --git a/drivers/net/ice/base/ice_protocol_type.h > b/drivers/net/ice/base/ice_protocol_type.h > index 368ab0d16..cfbe3fbfa 100644 > --- a/drivers/net/ice/base/ice_protocol_type.h > +++ b/drivers/net/ice/base/ice_protocol_type.h > @@ -30,6 +30,7 @@ > enum ice_protocol_type { > ICE_MAC_OFOS =3D 0, > ICE_MAC_IL, > + ICE_ETYPE_OL, > ICE_IPV4_OFOS, > ICE_IPV4_IL, > ICE_IPV6_OFOS, > @@ -108,6 +109,7 @@ enum ice_prot_id { >=20 > #define ICE_MAC_OFOS_HW 1 > #define ICE_MAC_IL_HW 4 > +#define ICE_ETYPE_OL_HW 9 > #define ICE_IPV4_OFOS_HW 32 > #define ICE_IPV4_IL_HW 33 > #define ICE_IPV6_OFOS_HW 40 > @@ -140,6 +142,9 @@ struct ice_protocol_entry { struct ice_ether_hdr { > u8 dst_addr[ETH_ALEN]; > u8 src_addr[ETH_ALEN]; > +}; > + > +struct ice_ethtype_hdr { > u16 ethtype_id; > }; >=20 > @@ -201,6 +206,7 @@ struct ice_nvgre { >=20 > union ice_prot_hdr { > struct ice_ether_hdr eth_hdr; > + struct ice_ethtype_hdr ethertype; > struct ice_ipv4_hdr ipv4_hdr; > struct ice_ipv6_hdr ipv6_hdr; > struct ice_l4_hdr l4_hdr; > diff --git a/drivers/net/ice/base/ice_switch.c > b/drivers/net/ice/base/ice_switch.c > index feacfa483..68c5d7d50 100644 > --- a/drivers/net/ice/base/ice_switch.c > +++ b/drivers/net/ice/base/ice_switch.c > @@ -61,6 +61,7 @@ struct ice_dummy_pkt_offsets { static const struct > ice_dummy_pkt_offsets dummy_gre_packet_offsets[] =3D { > { ICE_MAC_OFOS, 0 }, > + { ICE_ETYPE_OL, 12 }, > { ICE_IPV4_OFOS, 14 }, > { ICE_NVGRE, 34 }, > { ICE_MAC_IL, 42 }, > @@ -72,7 +73,7 @@ static const > u8 dummy_gre_packet[] =3D { 0, 0, 0, 0, /* ICE_MAC_OFOS 0 */ > 0, 0, 0, 0, > 0, 0, 0, 0, > - 0x08, 0, > + 0x08, 0, /* ICE_ETYPE_OL 12 */ > 0x45, 0, 0, 0x3E, /* ICE_IPV4_OFOS 14 */ > 0, 0, 0, 0, > 0, 0x2F, 0, 0, > @@ -94,6 +95,7 @@ u8 dummy_gre_packet[] =3D { 0, 0, 0, 0, /* > ICE_MAC_OFOS 0 */ > static const > struct ice_dummy_pkt_offsets dummy_udp_tun_tcp_packet_offsets[] =3D { > { ICE_MAC_OFOS, 0 }, > + { ICE_ETYPE_OL, 12 }, > { ICE_IPV4_OFOS, 14 }, > { ICE_UDP_OF, 34 }, > { ICE_VXLAN, 42 }, > @@ -108,7 +110,8 @@ u8 dummy_udp_tun_tcp_packet[] =3D { > 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ > 0x00, 0x00, 0x00, 0x00, > 0x00, 0x00, 0x00, 0x00, > - 0x08, 0x00, > + > + 0x08, 0x00, /* ICE_ETYPE_OL 12 */ >=20 > 0x45, 0x00, 0x00, 0x5a, /* ICE_IPV4_OFOS 14 */ > 0x00, 0x01, 0x00, 0x00, > @@ -143,6 +146,7 @@ u8 dummy_udp_tun_tcp_packet[] =3D { static const > struct ice_dummy_pkt_offsets dummy_udp_tun_udp_packet_offsets[] =3D { > { ICE_MAC_OFOS, 0 }, > + { ICE_ETYPE_OL, 12 }, > { ICE_IPV4_OFOS, 14 }, > { ICE_UDP_OF, 34 }, > { ICE_VXLAN, 42 }, > @@ -157,7 +161,8 @@ u8 dummy_udp_tun_udp_packet[] =3D { > 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ > 0x00, 0x00, 0x00, 0x00, > 0x00, 0x00, 0x00, 0x00, > - 0x08, 0x00, > + > + 0x08, 0x00, /* ICE_ETYPE_OL 12 */ >=20 > 0x45, 0x00, 0x00, 0x4e, /* ICE_IPV4_OFOS 14 */ > 0x00, 0x01, 0x00, 0x00, > @@ -189,6 +194,7 @@ u8 dummy_udp_tun_udp_packet[] =3D { static const > struct ice_dummy_pkt_offsets dummy_udp_packet_offsets[] =3D { > { ICE_MAC_OFOS, 0 }, > + { ICE_ETYPE_OL, 12 }, > { ICE_IPV4_OFOS, 14 }, > { ICE_UDP_ILOS, 34 }, > { ICE_PROTOCOL_LAST, 0 }, > @@ -199,7 +205,8 @@ dummy_udp_packet[] =3D { > 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ > 0x00, 0x00, 0x00, 0x00, > 0x00, 0x00, 0x00, 0x00, > - 0x08, 0x00, > + > + 0x08, 0x00, /* ICE_ETYPE_OL 12 */ >=20 > 0x45, 0x00, 0x00, 0x1c, /* ICE_IPV4_OFOS 14 */ > 0x00, 0x01, 0x00, 0x00, > @@ -216,6 +223,7 @@ dummy_udp_packet[] =3D { static const struct > ice_dummy_pkt_offsets dummy_tcp_packet_offsets[] =3D { > { ICE_MAC_OFOS, 0 }, > + { ICE_ETYPE_OL, 12 }, > { ICE_IPV4_OFOS, 14 }, > { ICE_TCP_IL, 34 }, > { ICE_PROTOCOL_LAST, 0 }, > @@ -226,7 +234,8 @@ dummy_tcp_packet[] =3D { > 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ > 0x00, 0x00, 0x00, 0x00, > 0x00, 0x00, 0x00, 0x00, > - 0x08, 0x00, > + > + 0x08, 0x00, /* ICE_ETYPE_OL 12 */ >=20 > 0x45, 0x00, 0x00, 0x28, /* ICE_IPV4_OFOS 14 */ > 0x00, 0x01, 0x00, 0x00, > @@ -246,6 +255,7 @@ dummy_tcp_packet[] =3D { static const struct > ice_dummy_pkt_offsets dummy_tcp_ipv6_packet_offsets[] =3D { > { ICE_MAC_OFOS, 0 }, > + { ICE_ETYPE_OL, 12 }, > { ICE_IPV6_OFOS, 14 }, > { ICE_TCP_IL, 54 }, > { ICE_PROTOCOL_LAST, 0 }, > @@ -256,7 +266,8 @@ dummy_tcp_ipv6_packet[] =3D { > 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ > 0x00, 0x00, 0x00, 0x00, > 0x00, 0x00, 0x00, 0x00, > - 0x86, 0xDD, > + > + 0x86, 0xDD, /* ICE_ETYPE_OL 12 */ >=20 > 0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 40 */ > 0x00, 0x14, 0x06, 0x00, /* Next header is TCP */ @@ -281,6 +292,7 > @@ dummy_tcp_ipv6_packet[] =3D { static const struct ice_dummy_pkt_offs= ets > dummy_udp_ipv6_packet_offsets[] =3D { > { ICE_MAC_OFOS, 0 }, > + { ICE_ETYPE_OL, 12 }, > { ICE_IPV6_OFOS, 14 }, > { ICE_UDP_ILOS, 54 }, > { ICE_PROTOCOL_LAST, 0 }, > @@ -291,7 +303,8 @@ dummy_udp_ipv6_packet[] =3D { > 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ > 0x00, 0x00, 0x00, 0x00, > 0x00, 0x00, 0x00, 0x00, > - 0x86, 0xDD, > + > + 0x86, 0xDD, /* ICE_ETYPE_OL 12 */ >=20 > 0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 40 */ > 0x00, 0x08, 0x11, 0x00, /* Next header UDP*/ @@ -4455,6 +4468,7 > @@ ice_add_mac_with_counter(struct ice_hw *hw, struct ice_fltr_info *f_in= fo) > static const struct ice_prot_ext_tbl_entry ice_prot_ext[] =3D { > { ICE_MAC_OFOS, { 0, 2, 4, 6, 8, 10, 12 } }, > { ICE_MAC_IL, { 0, 2, 4, 6, 8, 10, 12 } }, > + { ICE_ETYPE_OL, { 0 } }, > { ICE_IPV4_OFOS, { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18 } }, > { ICE_IPV4_IL, { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18 } }, > { ICE_IPV6_IL, { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, > @@ -4492,6 +4506,7 @@ static const struct ice_pref_recipe_group > ice_recipe_pack[] =3D { static const struct ice_protocol_entry ice_prot_= id_tbl[] =3D > { > { ICE_MAC_OFOS, ICE_MAC_OFOS_HW }, > { ICE_MAC_IL, ICE_MAC_IL_HW }, > + { ICE_ETYPE_OL, ICE_ETYPE_OL_HW }, > { ICE_IPV4_OFOS, ICE_IPV4_OFOS_HW }, > { ICE_IPV4_IL, ICE_IPV4_IL_HW }, > { ICE_IPV6_OFOS, ICE_IPV6_OFOS_HW }, > @@ -5450,6 +5465,9 @@ ice_fill_adv_dummy_packet(struct > ice_adv_lkup_elem *lkups, u16 lkups_cnt, > case ICE_MAC_IL: > len =3D sizeof(struct ice_ether_hdr); > break; > + case ICE_ETYPE_OL: > + len =3D sizeof(struct ice_ethtype_hdr); > + break; > case ICE_IPV4_OFOS: > case ICE_IPV4_IL: > len =3D sizeof(struct ice_ipv4_hdr); > -- > 2.17.1