From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1F976A0519; Fri, 3 Jul 2020 16:24:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A153B1DBD4; Fri, 3 Jul 2020 16:24:33 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 136501DB90 for ; Fri, 3 Jul 2020 16:24:30 +0200 (CEST) IronPort-SDR: eAkp0HDet7SeIFmx55A6LqkNHWrw15cKNeUXMvVU5sk/CjOUrUTcx16FZPkOUDXDmcGQ/bmp/f dIHTraVOZe1Q== X-IronPort-AV: E=McAfee;i="6000,8403,9670"; a="165213797" X-IronPort-AV: E=Sophos;i="5.75,308,1589266800"; d="scan'208";a="165213797" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2020 07:24:30 -0700 IronPort-SDR: pWopBl9hhYftdL6uGF9pOe/2Mpf92TT06Ft6t+CMaG/B3GlBOJnFb3vLdbT7pVqLeLqmGMbU0U lH+wmVDj/9DA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,308,1589266800"; d="scan'208";a="296218688" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga002.jf.intel.com with ESMTP; 03 Jul 2020 07:24:29 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 3 Jul 2020 07:24:29 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 3 Jul 2020 07:24:28 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.89]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.221]) with mapi id 14.03.0439.000; Fri, 3 Jul 2020 22:24:25 +0800 From: "Zhang, Qi Z" To: "Guo, Jia" , "Wu, Jingjing" , "Xing, Beilei" CC: "dev@dpdk.org" , "Guo, Junfeng" , "Yang, Qiming" , "Su, Simei" Thread-Topic: [dpdk-dev v4 1/3] net/iavf: refactor for hash flow Thread-Index: AQHWUO4ggKAhH1OKGk+pEvR20/+C5qj15bYQ Date: Fri, 3 Jul 2020 14:24:25 +0000 Message-ID: <039ED4275CED7440929022BC67E706115484BABF@SHSMSX103.ccr.corp.intel.com> References: <20200621140235.20488-1-jia.guo@intel.com> <20200703035656.87908-1-jia.guo@intel.com> <20200703035656.87908-2-jia.guo@intel.com> In-Reply-To: <20200703035656.87908-2-jia.guo@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.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [dpdk-dev v4 1/3] net/iavf: refactor for hash flow 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" > -----Original Message----- > From: Guo, Jia > Sent: Friday, July 3, 2020 11:57 AM > To: Zhang, Qi Z ; Wu, Jingjing > ; Xing, Beilei > Cc: dev@dpdk.org; Guo, Junfeng ; Yang, Qiming > ; Su, Simei ; Guo, Jia > > Subject: [dpdk-dev v4 1/3] net/iavf: refactor for hash flow >=20 > Refactor hash flow by change the process of the pattern parser and the > action parser, and refine the lookup table for regular IP and GTPU_EH. >=20 > Signed-off-by: Jeff Guo > --- > drivers/net/iavf/iavf_hash.c | 1658 ++++++++++++++++++++++++---------- > 1 file changed, 1163 insertions(+), 495 deletions(-) >=20 > diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c > index a7691ef0c..921dc961f 100644 > --- a/drivers/net/iavf/iavf_hash.c > +++ b/drivers/net/iavf/iavf_hash.c > @@ -24,32 +24,33 @@ > #include "iavf_generic_flow.h" >=20 > enum iavf_pattern_hint_type { > - IAVF_PATTERN_HINT_NONE, > - IAVF_PATTERN_HINT_IPV4, > - IAVF_PATTERN_HINT_IPV4_UDP, > - IAVF_PATTERN_HINT_IPV4_TCP, > - IAVF_PATTERN_HINT_IPV4_SCTP, > - IAVF_PATTERN_HINT_IPV6, > - IAVF_PATTERN_HINT_IPV6_UDP, > - IAVF_PATTERN_HINT_IPV6_TCP, > - IAVF_PATTERN_HINT_IPV6_SCTP, > -}; > - > -enum iavf_gtpu_hint { > - IAVF_GTPU_HINT_DOWNLINK, > - IAVF_GTPU_HINT_UPLINK, > - IAVF_GTPU_HINT_NONE, > -}; > + IAVF_PHINT_NONE =3D 0x00000000, > + IAVF_PHINT_IPV4 =3D 0x00000001, > + IAVF_PHINT_IPV4_UDP =3D 0x00000002, > + IAVF_PHINT_IPV4_TCP =3D 0x00000004, > + IAVF_PHINT_IPV4_SCTP =3D 0x00000008, > + IAVF_PHINT_IPV6 =3D 0x00000010, > + IAVF_PHINT_IPV6_UDP =3D 0x00000020, > + IAVF_PHINT_IPV6_TCP =3D 0x00000040, > + IAVF_PHINT_IPV6_SCTP =3D 0x00000080, > + IAVF_PHINT_C_VLAN =3D 0x00000100, > + IAVF_PHINT_S_VLAN =3D 0x00000200, > + IAVF_PHINT_IPV4_GTPU_EH =3D 0x00000400, > + IAVF_PHINT_IPV4_GTPU_EH_DWNLINK =3D 0x00000800, > + IAVF_PHINT_IPV4_GTPU_EH_UPLINK =3D 0x00001000, > +}; > + > +#define IAVF_GTPU_EH_DWNLINK 0 > +#define IAVF_GTPU_EH_UPLINK 1 >=20 > struct iavf_pattern_match_type { > - enum iavf_pattern_hint_type phint_type; > + uint64_t pattern_hint; > }; >=20 > struct iavf_hash_match_type { > - enum iavf_pattern_hint_type phint_type; > uint64_t hash_type; > struct virtchnl_proto_hdrs *proto_hdrs; > - enum iavf_gtpu_hint gtpu_hint; > + uint64_t pattern_hint; > }; >=20 > struct iavf_rss_meta { > @@ -83,42 +84,50 @@ iavf_hash_parse_pattern_action(struct iavf_adapter > *ad, > void **meta, > struct rte_flow_error *error); >=20 > -struct iavf_pattern_match_type phint_empty =3D { > - IAVF_PATTERN_HINT_NONE}; > -struct iavf_pattern_match_type phint_eth_ipv4 =3D { > - IAVF_PATTERN_HINT_IPV4}; > -struct iavf_pattern_match_type phint_eth_ipv4_udp =3D { > - IAVF_PATTERN_HINT_IPV4_UDP}; > -struct iavf_pattern_match_type phint_eth_ipv4_tcp =3D { > - IAVF_PATTERN_HINT_IPV4_TCP}; > -struct iavf_pattern_match_type phint_eth_ipv4_sctp =3D { > - IAVF_PATTERN_HINT_IPV4_SCTP}; > -struct iavf_pattern_match_type phint_eth_ipv4_gtpu_eh =3D { > - IAVF_PATTERN_HINT_IPV4_UDP}; > -struct iavf_pattern_match_type phint_eth_ipv4_esp =3D { > - IAVF_PATTERN_HINT_IPV4}; > -struct iavf_pattern_match_type phint_eth_ipv4_ah =3D { > - IAVF_PATTERN_HINT_IPV4}; > -struct iavf_pattern_match_type phint_eth_ipv4_l2tpv3 =3D { > - IAVF_PATTERN_HINT_IPV4}; > -struct iavf_pattern_match_type phint_eth_ipv4_pfcp =3D { > - IAVF_PATTERN_HINT_IPV4_UDP}; > -struct iavf_pattern_match_type phint_eth_ipv6 =3D { > - IAVF_PATTERN_HINT_IPV6}; > -struct iavf_pattern_match_type phint_eth_ipv6_udp =3D { > - IAVF_PATTERN_HINT_IPV6_UDP}; > -struct iavf_pattern_match_type phint_eth_ipv6_tcp =3D { > - IAVF_PATTERN_HINT_IPV6_TCP}; > -struct iavf_pattern_match_type phint_eth_ipv6_sctp =3D { > - IAVF_PATTERN_HINT_IPV6_SCTP}; > -struct iavf_pattern_match_type phint_eth_ipv6_esp =3D { > - IAVF_PATTERN_HINT_IPV6}; > -struct iavf_pattern_match_type phint_eth_ipv6_ah =3D { > - IAVF_PATTERN_HINT_IPV6}; > -struct iavf_pattern_match_type phint_eth_ipv6_l2tpv3 =3D { > - IAVF_PATTERN_HINT_IPV6}; > -struct iavf_pattern_match_type phint_eth_ipv6_pfcp =3D { > - IAVF_PATTERN_HINT_IPV6_UDP}; > +static struct iavf_pattern_match_type phint_empty =3D { > + IAVF_PHINT_NONE}; > +static struct iavf_pattern_match_type phint_eth_ipv4 =3D { > + IAVF_PHINT_IPV4}; > +static struct iavf_pattern_match_type phint_eth_ipv4_udp =3D { > + IAVF_PHINT_IPV4_UDP}; > +static struct iavf_pattern_match_type phint_eth_ipv4_tcp =3D { > + IAVF_PHINT_IPV4_TCP}; > +static struct iavf_pattern_match_type phint_eth_ipv4_sctp =3D { > + IAVF_PHINT_IPV4_SCTP}; > +static struct iavf_pattern_match_type phint_eth_ipv4_gtpu_eh_ipv4 =3D { > + IAVF_PHINT_IPV4}; > +static struct iavf_pattern_match_type phint_eth_ipv4_gtpu_eh_ipv4_udp > =3D { > + IAVF_PHINT_IPV4_UDP}; > +static struct iavf_pattern_match_type phint_eth_ipv4_gtpu_eh_ipv4_tcp = =3D > { > + IAVF_PHINT_IPV4_TCP}; > +static struct iavf_pattern_match_type phint_eth_ipv4_esp =3D { > + IAVF_PHINT_IPV4}; > +static struct iavf_pattern_match_type phint_eth_ipv4_ah =3D { > + IAVF_PHINT_IPV4}; > +static struct iavf_pattern_match_type phint_eth_ipv4_l2tpv3 =3D { > + IAVF_PHINT_IPV4}; > +static struct iavf_pattern_match_type phint_eth_ipv4_pfcp =3D { > + IAVF_PHINT_IPV4_UDP}; > +static struct iavf_pattern_match_type phint_eth_vlan_ipv4 =3D { > + IAVF_PHINT_C_VLAN}; > +static struct iavf_pattern_match_type phint_eth_ipv6 =3D { > + IAVF_PHINT_IPV6}; > +static struct iavf_pattern_match_type phint_eth_ipv6_udp =3D { > + IAVF_PHINT_IPV6_UDP}; > +static struct iavf_pattern_match_type phint_eth_ipv6_tcp =3D { > + IAVF_PHINT_IPV6_TCP}; > +static struct iavf_pattern_match_type phint_eth_ipv6_sctp =3D { > + IAVF_PHINT_IPV6_SCTP}; > +static struct iavf_pattern_match_type phint_eth_ipv6_esp =3D { > + IAVF_PHINT_IPV6}; > +static struct iavf_pattern_match_type phint_eth_ipv6_ah =3D { > + IAVF_PHINT_IPV6}; > +static struct iavf_pattern_match_type phint_eth_ipv6_l2tpv3 =3D { > + IAVF_PHINT_IPV6}; > +static struct iavf_pattern_match_type phint_eth_ipv6_pfcp =3D { > + IAVF_PHINT_IPV6_UDP}; > +static struct iavf_pattern_match_type phint_eth_vlan_ipv6 =3D { > + IAVF_PHINT_C_VLAN}; >=20 > /** > * Supported pattern for hash. > @@ -131,26 +140,28 @@ static struct iavf_pattern_match_item > iavf_hash_pattern_list[] =3D { > {iavf_pattern_eth_ipv4_udp, IAVF_INSET_NONE, > &phint_eth_ipv4_udp}, > {iavf_pattern_eth_ipv4_tcp, IAVF_INSET_NONE, &phint_eth_ipv4_tcp}, > {iavf_pattern_eth_ipv4_sctp, IAVF_INSET_NONE, > &phint_eth_ipv4_sctp}, > - {iavf_pattern_eth_ipv6, IAVF_INSET_NONE, &phint_eth_ipv6}, > {iavf_pattern_eth_ipv4_gtpu_eh_ipv4, IAVF_INSET_NONE, > - &phint_eth_ipv4_gtpu_eh}, > + &phint_eth_ipv4_gtpu_eh_ipv4}, > {iavf_pattern_eth_ipv4_gtpu_eh_ipv4_udp, IAVF_INSET_NONE, > - &phint_eth_ipv4_gtpu_eh}, > + &phint_eth_ipv4_gtpu_eh_ipv4_udp}, > {iavf_pattern_eth_ipv4_gtpu_eh_ipv4_tcp, IAVF_INSET_NONE, > - &phint_eth_ipv4_gtpu_eh}, > + &phint_eth_ipv4_gtpu_eh_ipv4_tcp}, > {iavf_pattern_eth_ipv4_esp, IAVF_INSET_NONE, &phint_eth_ipv4_esp}, > {iavf_pattern_eth_ipv4_ah, IAVF_INSET_NONE, &phint_eth_ipv4_ah}, > {iavf_pattern_eth_ipv4_l2tpv3, IAVF_INSET_NONE, > - &phint_eth_ipv4_l2tpv3}, > + &phint_eth_ipv4_l2tpv3}, > {iavf_pattern_eth_ipv4_pfcp, IAVF_INSET_NONE, > &phint_eth_ipv4_pfcp}, > + {iavf_pattern_eth_vlan_ipv4, IAVF_INSET_NONE, > &phint_eth_vlan_ipv4}, > + {iavf_pattern_eth_ipv6, IAVF_INSET_NONE, &phint_eth_ipv6}, > {iavf_pattern_eth_ipv6_udp, IAVF_INSET_NONE, > &phint_eth_ipv6_udp}, > {iavf_pattern_eth_ipv6_tcp, IAVF_INSET_NONE, &phint_eth_ipv6_tcp}, > {iavf_pattern_eth_ipv6_sctp, IAVF_INSET_NONE, > &phint_eth_ipv6_sctp}, > {iavf_pattern_eth_ipv6_esp, IAVF_INSET_NONE, &phint_eth_ipv6_esp}, > {iavf_pattern_eth_ipv6_ah, IAVF_INSET_NONE, &phint_eth_ipv6_ah}, > {iavf_pattern_eth_ipv6_l2tpv3, IAVF_INSET_NONE, > - &phint_eth_ipv6_l2tpv3}, > + &phint_eth_ipv6_l2tpv3}, > {iavf_pattern_eth_ipv6_pfcp, IAVF_INSET_NONE, > &phint_eth_ipv6_pfcp}, > + {iavf_pattern_eth_vlan_ipv6, IAVF_INSET_NONE, > &phint_eth_vlan_ipv6}, > {iavf_pattern_empty, IAVF_INSET_NONE, &phint_empty}, > }; >=20 > @@ -271,6 +282,10 @@ static struct iavf_pattern_match_item > iavf_hash_pattern_list[] =3D { > FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_SRC) | \ > FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST), {BUFF_NOUSED } } >=20 > +#define proto_hint_gtpu_eh_only { \ > + VIRTCHNL_PROTO_HDR_GTPU_EH, \ > + FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } } > + > #define proto_hint_gtpu_up_only { \ > VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_UP, \ > FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } } > @@ -295,6 +310,8 @@ static struct iavf_pattern_match_item > iavf_hash_pattern_list[] =3D { > VIRTCHNL_PROTO_HDR_PFCP, \ > FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_PFCP_SEID), > {BUFF_NOUSED } } >=20 > +/* ETH */ > + > struct virtchnl_proto_hdrs hdrs_hint_eth_src =3D { > TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_eth_src } > }; > @@ -315,6 +332,8 @@ struct virtchnl_proto_hdrs hdrs_hint_cvlan =3D { > TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_cvlan } > }; >=20 > +/* IPV4 */ > + > struct virtchnl_proto_hdrs hdrs_hint_ipv4_src =3D { > TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv4_src } > }; > @@ -323,46 +342,6 @@ struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst =3D { > TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv4_dst } > }; >=20 > -struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpu_up =3D { > - TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, > {proto_hint_gtpu_up_only, > - proto_hint_ipv4_src } > -}; > - > -struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpu_dwn =3D { > - TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, > {proto_hint_gtpu_dwn_only, > - proto_hint_ipv4_src } > -}; > - > -struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_gtpu_up =3D { > - TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, > {proto_hint_gtpu_up_only, > - proto_hint_ipv4_dst } > -}; > - > -struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_gtpu_dwn =3D { > - TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, > {proto_hint_gtpu_dwn_only, > - proto_hint_ipv4_dst } > -}; > - > -struct virtchnl_proto_hdrs hdrs_hint_ipv4_esp =3D { > - TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only, > - proto_hint_esp } > -}; > - > -struct virtchnl_proto_hdrs hdrs_hint_ipv4_ah =3D { > - TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only, > - proto_hint_ah } > -}; > - > -struct virtchnl_proto_hdrs hdrs_hint_ipv4_l2tpv3 =3D { > - TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only, > - proto_hint_l2tpv3 } > -}; > - > -struct virtchnl_proto_hdrs hdrs_hint_ipv4_pfcp =3D { > - TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only, > - proto_hint_pfcp } > -}; > - > struct virtchnl_proto_hdrs hdrs_hint_ipv4 =3D { > TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv4 } > }; > @@ -472,34 +451,302 @@ struct virtchnl_proto_hdrs hdrs_hint_ipv4_sctp > =3D { > proto_hint_sctp } > }; >=20 > -struct virtchnl_proto_hdrs hdrs_hint_ipv6_src =3D { > - TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv6_src } > -}; > - > -struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst =3D { > - TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv6_dst } > -}; > - > -struct virtchnl_proto_hdrs hdrs_hint_ipv6_esp =3D { > - TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only, > +struct virtchnl_proto_hdrs hdrs_hint_ipv4_esp =3D { > + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only, > proto_hint_esp } > }; >=20 > -struct virtchnl_proto_hdrs hdrs_hint_ipv6_ah =3D { > - TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only, > +struct virtchnl_proto_hdrs hdrs_hint_ipv4_ah =3D { > + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only, > proto_hint_ah } > }; >=20 > -struct virtchnl_proto_hdrs hdrs_hint_ipv6_l2tpv3 =3D { > - TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only, > +struct virtchnl_proto_hdrs hdrs_hint_ipv4_l2tpv3 =3D { > + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only, > proto_hint_l2tpv3 } > }; >=20 > -struct virtchnl_proto_hdrs hdrs_hint_ipv6_pfcp =3D { > - TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only, > +struct virtchnl_proto_hdrs hdrs_hint_ipv4_pfcp =3D { > + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only, > proto_hint_pfcp } > }; >=20 > +struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_esp =3D { > + TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv4_only, > + proto_hint_udp_only, proto_hint_esp } > +}; > + > +/* GTPU EH */ > + > +struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_src_gtpu_eh =3D { > + TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_THREE, > {proto_hint_gtpu_eh_only, > + proto_hint_udp_src_port} The counter is three, but you have only two proto layers here, anything I m= issed? btw, I don't think these code belongs to code refactor, looks like you are = adding inner l4 header which is not supported previously would it be better just keep his patch only for code refactor, and separate= new features in a new patch?