From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 96E412904 for ; Thu, 4 Jan 2018 09:43:57 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jan 2018 00:43:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,506,1508828400"; d="scan'208";a="7306393" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 04 Jan 2018 00:43:56 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 4 Jan 2018 00:43:55 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Thu, 4 Jan 2018 16:43:54 +0800 From: "Zhang, Qi Z" To: "Xing, Beilei" CC: "dev@dpdk.org" , "Wu, Jingjing" , "Chilikin, Andrey" Thread-Topic: [PATCH v2 2/2] net/i40e: support PPPoE and L2TP ptype parser Thread-Index: AQHTeWusDEwtJEZNf0aXF8fkGXTQmqNjfJOw Date: Thu, 4 Jan 2018 08:43:53 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153127A64@SHSMSX103.ccr.corp.intel.com> References: <1511863976-126599-1-git-send-email-beilei.xing@intel.com> <1513758164-39610-1-git-send-email-beilei.xing@intel.com> <1513758164-39610-3-git-send-email-beilei.xing@intel.com> In-Reply-To: <1513758164-39610-3-git-send-email-beilei.xing@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.0.116 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] [PATCH v2 2/2] net/i40e: support PPPoE and L2TP ptype parser 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: , X-List-Received-Date: Thu, 04 Jan 2018 08:43:58 -0000 > -----Original Message----- > From: Xing, Beilei > Sent: Wednesday, December 20, 2017 4:23 PM > To: Zhang, Qi Z > Cc: dev@dpdk.org; Wu, Jingjing ; Chilikin, Andrey > > Subject: [PATCH v2 2/2] net/i40e: support PPPoE and L2TP ptype parser >=20 > This patch adds support for PPPoE and L2TP packet types parser. The code is ok for me.=20 It's better to add more explanation that the naming rule for protocol type = has also been changed For example: O|IPV4 =3D IPV4 + !inner_ip Regards Qi >=20 > Signed-off-by: Beilei Xing > --- > drivers/net/i40e/i40e_ethdev.c | 83 > ++++++++++++++++++++++++++++++------------ > 1 file changed, 60 insertions(+), 23 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 811cc9f..c6f7ce7 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -11078,7 +11078,7 @@ i40e_update_customized_ptype(struct > rte_eth_dev *dev, uint8_t *pkg, > uint8_t proto_id; > char name[RTE_PMD_I40E_DDP_NAME_SIZE]; > uint32_t i, j, n; > - bool inner_ip; > + bool in_tunnel; > int ret; >=20 > /* get information about new ptype num */ @@ -11123,7 +11123,7 @@ > i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg, > for (i =3D 0; i < ptype_num; i++) { > ptype_mapping[i].hw_ptype =3D ptype[i].ptype_id; > ptype_mapping[i].sw_ptype =3D 0; > - inner_ip =3D false; > + in_tunnel =3D false; > for (j =3D 0; j < RTE_PMD_I40E_PROTO_NUM; j++) { > proto_id =3D ptype[i].protocols[j]; > if (proto_id =3D=3D RTE_PMD_I40E_PROTO_UNUSED) @@ -11133,54 > +11133,91 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, > uint8_t *pkg, > continue; > memset(name, 0, sizeof(name)); > strcpy(name, proto[n].name); > - if (!strncmp(name, "IPV4", 4) && !inner_ip) { > + if (!strncmp(name, "PPPOE", 5)) > + ptype_mapping[i].sw_ptype |=3D > + RTE_PTYPE_L2_ETHER_PPPOE; > + else if (!strncmp(name, "OIPV4", 5)) { > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_L3_IPV4_EXT_UNKNOWN; > - inner_ip =3D true; > - } else if (!strncmp(name, "IPV4FRAG", 8) && > - inner_ip) { > + in_tunnel =3D true; > + } else if (!strncmp(name, "IPV4", 4) && > + !in_tunnel) > + ptype_mapping[i].sw_ptype |=3D > + RTE_PTYPE_L3_IPV4_EXT_UNKNOWN; > + else if (!strncmp(name, "IPV4FRAG", 8) && > + in_tunnel) { > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN; > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_INNER_L4_FRAG; > } else if (!strncmp(name, "IPV4", 4) && > - inner_ip) > + in_tunnel) > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN; > - else if (!strncmp(name, "IPV6", 4) && > - !inner_ip) { > + else if (!strncmp(name, "OIPV6", 5)) { > + ptype_mapping[i].sw_ptype |=3D > + RTE_PTYPE_L3_IPV6_EXT_UNKNOWN; > + in_tunnel =3D true; > + } else if (!strncmp(name, "IPV6", 4) && > + !in_tunnel) > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_L3_IPV6_EXT_UNKNOWN; > - inner_ip =3D true; > - } else if (!strncmp(name, "IPV6FRAG", 8) && > - inner_ip) { > + else if (!strncmp(name, "IPV6FRAG", 8) && > + in_tunnel) { > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN; > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_INNER_L4_FRAG; > } else if (!strncmp(name, "IPV6", 4) && > - inner_ip) > + in_tunnel) > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN; > - else if (!strncmp(name, "GTPC", 4)) > + else if (!strncmp(name, "UDP", 3) && !in_tunnel) > ptype_mapping[i].sw_ptype |=3D > - RTE_PTYPE_TUNNEL_GTPC; > - else if (!strncmp(name, "GTPU", 4)) > - ptype_mapping[i].sw_ptype |=3D > - RTE_PTYPE_TUNNEL_GTPU; > - else if (!strncmp(name, "UDP", 3)) > + RTE_PTYPE_L4_UDP; > + else if (!strncmp(name, "UDP", 3) && in_tunnel) > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_INNER_L4_UDP; > - else if (!strncmp(name, "TCP", 3)) > + else if (!strncmp(name, "TCP", 3) && !in_tunnel) > + ptype_mapping[i].sw_ptype |=3D > + RTE_PTYPE_L4_TCP; > + else if (!strncmp(name, "TCP", 3) && in_tunnel) > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_INNER_L4_TCP; > - else if (!strncmp(name, "SCTP", 4)) > + else if (!strncmp(name, "SCTP", 4) && > + !in_tunnel) > + ptype_mapping[i].sw_ptype |=3D > + RTE_PTYPE_L4_SCTP; > + else if (!strncmp(name, "SCTP", 4) && in_tunnel) > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_INNER_L4_SCTP; > - else if (!strncmp(name, "ICMP", 4) || > - !strncmp(name, "ICMPV6", 6)) > + else if ((!strncmp(name, "ICMP", 4) || > + !strncmp(name, "ICMPV6", 6)) && > + !in_tunnel) > + ptype_mapping[i].sw_ptype |=3D > + RTE_PTYPE_L4_ICMP; > + else if ((!strncmp(name, "ICMP", 4) || > + !strncmp(name, "ICMPV6", 6)) && > + in_tunnel) > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_INNER_L4_ICMP; > + else if (!strncmp(name, "GTPC", 4)) { > + ptype_mapping[i].sw_ptype |=3D > + RTE_PTYPE_TUNNEL_GTPC; > + in_tunnel =3D true; > + } else if (!strncmp(name, "GTPU", 4)) { > + ptype_mapping[i].sw_ptype |=3D > + RTE_PTYPE_TUNNEL_GTPU; > + in_tunnel =3D true; > + } else if (!strncmp(name, "GRENAT", 6)) { > + ptype_mapping[i].sw_ptype |=3D > + RTE_PTYPE_TUNNEL_GRENAT; > + in_tunnel =3D true; > + } else if (!strncmp(name, "L2TPv2CTL", 9)) { > + ptype_mapping[i].sw_ptype |=3D > + RTE_PTYPE_TUNNEL_L2TP; > + in_tunnel =3D true; > + } >=20 > break; > } > -- > 2.5.5