From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 3E914A495; Sun, 14 Jan 2018 05:02:11 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2018 20:02:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,356,1511856000"; d="scan'208";a="19239495" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 13 Jan 2018 20:02:11 -0800 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 13 Jan 2018 20:02:10 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 13 Jan 2018 20:02:10 -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; Sun, 14 Jan 2018 12:02:08 +0800 From: "Zhang, Qi Z" To: "Xing, Beilei" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH v2] net/i40e: fix packet type parser issue Thread-Index: AQHTi4ECn59KNBl1uU+oWf61V+Z0w6NywUlg Date: Sun, 14 Jan 2018 04:02:08 +0000 Message-ID: <039ED4275CED7440929022BC67E706115312D4B4@SHSMSX103.ccr.corp.intel.com> References: <1515665027-105293-1-git-send-email-beilei.xing@intel.com> <1515746494-86927-1-git-send-email-beilei.xing@intel.com> In-Reply-To: <1515746494-86927-1-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] net/i40e: fix packet type parser issue 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: Sun, 14 Jan 2018 04:02:12 -0000 > -----Original Message----- > From: Xing, Beilei > Sent: Friday, January 12, 2018 4:42 PM > To: Zhang, Qi Z > Cc: dev@dpdk.org; stable@dpdk.org > Subject: [PATCH v2] net/i40e: fix packet type parser issue >=20 > Ptype mapping table will fail to update when loading PPP profile, fix the= issue > via modifying metadata and adding check. > This patch also adds parser for IPV4FRAG and IPV6FRAG. >=20 > Fixes: ab2e350c4f4b ("net/i40e: improve packet type parser") > Cc: stable@dpdk.org >=20 > Signed-off-by: Beilei Xing > --- >=20 > v2 changes: > - Add parser for IPV4FRAG and IPV6FRAG. >=20 > drivers/net/i40e/i40e_ethdev.c | 44 > ++++++++++++++++++++++++++--------------- > drivers/net/i40e/rte_pmd_i40e.c | 6 ++++-- > 2 files changed, 32 insertions(+), 18 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index d80671a..69704e3 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -11283,43 +11283,55 @@ 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, "PPPOE", 5)) > + if (!strncmp(name, "PPPoE", 5)) > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_L2_ETHER_PPPOE; > - else if (!strncmp(name, "OIPV4", 5)) { > + else if (!strncmp(name, "IPV4FRAG", 8) && > + !in_tunnel) { > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_L3_IPV4_EXT_UNKNOWN; > - 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) { > + RTE_PTYPE_L4_FRAG; > + } 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) && > + !in_tunnel) > + ptype_mapping[i].sw_ptype |=3D > + RTE_PTYPE_L3_IPV4_EXT_UNKNOWN; > + else if (!strncmp(name, "OIPV4", 5)) { > + ptype_mapping[i].sw_ptype |=3D > + RTE_PTYPE_L3_IPV4_EXT_UNKNOWN; > + in_tunnel =3D true; > + } else if (!strncmp(name, "IPV4", 4) && > in_tunnel) Since you are doing some reordering here, it's better to move IPV4 && in_tu= nnel case above OIPV4, to match IPV4 && !in_tunnel case. Regards Qi > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN; > - else if (!strncmp(name, "OIPV6", 5)) { > + else if (!strncmp(name, "IPV6FRAG", 8) && > + !in_tunnel) { > 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; > - else if (!strncmp(name, "IPV6FRAG", 8) && > - in_tunnel) { > + RTE_PTYPE_L4_FRAG; > + } 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, "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) > + !in_tunnel) > + ptype_mapping[i].sw_ptype |=3D > + RTE_PTYPE_L3_IPV6_EXT_UNKNOWN; > + else if (!strncmp(name, "IPV6", 4) && > + in_tunnel) > ptype_mapping[i].sw_ptype |=3D > RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN; > else if (!strncmp(name, "UDP", 3) && !in_tunnel) diff --git > a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c index > 55ae2fe..af33a7c 100644 > --- a/drivers/net/i40e/rte_pmd_i40e.c > +++ b/drivers/net/i40e/rte_pmd_i40e.c > @@ -2053,7 +2053,8 @@ static int check_invalid_pkt_type(uint32_t pkt_type= ) > l2 !=3D RTE_PTYPE_L2_ETHER_LLDP && > l2 !=3D RTE_PTYPE_L2_ETHER_NSH && > l2 !=3D RTE_PTYPE_L2_ETHER_VLAN && > - l2 !=3D RTE_PTYPE_L2_ETHER_QINQ) > + l2 !=3D RTE_PTYPE_L2_ETHER_QINQ && > + l2 !=3D RTE_PTYPE_L2_ETHER_PPPOE) > return -1; >=20 > if (l3 && > @@ -2082,7 +2083,8 @@ static int check_invalid_pkt_type(uint32_t pkt_type= ) > tnl !=3D RTE_PTYPE_TUNNEL_GENEVE && > tnl !=3D RTE_PTYPE_TUNNEL_GRENAT && > tnl !=3D RTE_PTYPE_TUNNEL_GTPC && > - tnl !=3D RTE_PTYPE_TUNNEL_GTPU) > + tnl !=3D RTE_PTYPE_TUNNEL_GTPU && > + tnl !=3D RTE_PTYPE_TUNNEL_L2TP) > return -1; >=20 > if (il2 && > -- > 2.5.5