From: Beilei Xing <beilei.xing@intel.com>
To: qi.z.zhang@intel.com
Cc: dev@dpdk.org, andrey.chilikin@intel.com
Subject: [dpdk-dev] [PATCH v4 3/3] net/i40e: replace strncmp with strncasecmp
Date: Fri, 19 Jan 2018 15:50:06 +0800 [thread overview]
Message-ID: <1516348206-89406-4-git-send-email-beilei.xing@intel.com> (raw)
In-Reply-To: <1516348206-89406-1-git-send-email-beilei.xing@intel.com>
Replace strncmp with strncasecmp in i40e_update_customized_ptype
function for compatibility.
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 55 +++++++++++++++++++++++-------------------
1 file changed, 30 insertions(+), 25 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index b197c53..a0f0d92 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -11326,99 +11326,104 @@ 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 (!strncasecmp(name, "PPPOE", 5))
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_L2_ETHER_PPPOE;
- else if (!strncmp(name, "IPV4FRAG", 8) &&
+ else if (!strncasecmp(name, "IPV4FRAG", 8) &&
!in_tunnel) {
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_L4_FRAG;
- } else if (!strncmp(name, "IPV4FRAG", 8) &&
+ } else if (!strncasecmp(name, "IPV4FRAG", 8) &&
in_tunnel) {
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN;
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_INNER_L4_FRAG;
- } else if (!strncmp(name, "OIPV4", 5)) {
+ } else if (!strncasecmp(name, "OIPV4", 5)) {
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
in_tunnel = true;
- } else if (!strncmp(name, "IPV4", 4) &&
+ } else if (!strncasecmp(name, "IPV4", 4) &&
!in_tunnel)
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
- else if (!strncmp(name, "IPV4", 4) &&
+ else if (!strncasecmp(name, "IPV4", 4) &&
in_tunnel)
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN;
- else if (!strncmp(name, "IPV6FRAG", 8) &&
+ else if (!strncasecmp(name, "IPV6FRAG", 8) &&
!in_tunnel) {
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_L4_FRAG;
- } else if (!strncmp(name, "IPV6FRAG", 8) &&
+ } else if (!strncasecmp(name, "IPV6FRAG", 8) &&
in_tunnel) {
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN;
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_INNER_L4_FRAG;
- } else if (!strncmp(name, "OIPV6", 5)) {
+ } else if (!strncasecmp(name, "OIPV6", 5)) {
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;
in_tunnel = true;
- } else if (!strncmp(name, "IPV6", 4) &&
+ } else if (!strncasecmp(name, "IPV6", 4) &&
!in_tunnel)
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;
- else if (!strncmp(name, "IPV6", 4) &&
+ else if (!strncasecmp(name, "IPV6", 4) &&
in_tunnel)
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN;
- else if (!strncmp(name, "UDP", 3) && !in_tunnel)
+ else if (!strncasecmp(name, "UDP", 3) &&
+ !in_tunnel)
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_L4_UDP;
- else if (!strncmp(name, "UDP", 3) && in_tunnel)
+ else if (!strncasecmp(name, "UDP", 3) &&
+ in_tunnel)
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_INNER_L4_UDP;
- else if (!strncmp(name, "TCP", 3) && !in_tunnel)
+ else if (!strncasecmp(name, "TCP", 3) &&
+ !in_tunnel)
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_L4_TCP;
- else if (!strncmp(name, "TCP", 3) && in_tunnel)
+ else if (!strncasecmp(name, "TCP", 3) &&
+ in_tunnel)
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_INNER_L4_TCP;
- else if (!strncmp(name, "SCTP", 4) &&
+ else if (!strncasecmp(name, "SCTP", 4) &&
!in_tunnel)
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_L4_SCTP;
- else if (!strncmp(name, "SCTP", 4) && in_tunnel)
+ else if (!strncasecmp(name, "SCTP", 4) &&
+ in_tunnel)
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_INNER_L4_SCTP;
- else if ((!strncmp(name, "ICMP", 4) ||
- !strncmp(name, "ICMPV6", 6)) &&
+ else if ((!strncasecmp(name, "ICMP", 4) ||
+ !strncasecmp(name, "ICMPV6", 6)) &&
!in_tunnel)
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_L4_ICMP;
- else if ((!strncmp(name, "ICMP", 4) ||
- !strncmp(name, "ICMPV6", 6)) &&
+ else if ((!strncasecmp(name, "ICMP", 4) ||
+ !strncasecmp(name, "ICMPV6", 6)) &&
in_tunnel)
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_INNER_L4_ICMP;
- else if (!strncmp(name, "GTPC", 4)) {
+ else if (!strncasecmp(name, "GTPC", 4)) {
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_TUNNEL_GTPC;
in_tunnel = true;
- } else if (!strncmp(name, "GTPU", 4)) {
+ } else if (!strncasecmp(name, "GTPU", 4)) {
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_TUNNEL_GTPU;
in_tunnel = true;
- } else if (!strncmp(name, "GRENAT", 6)) {
+ } else if (!strncasecmp(name, "GRENAT", 6)) {
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_TUNNEL_GRENAT;
in_tunnel = true;
- } else if (!strncmp(name, "L2TPv2CTL", 9)) {
+ } else if (!strncasecmp(name, "L2TPV2CTL", 9)) {
ptype_mapping[i].sw_ptype |=
RTE_PTYPE_TUNNEL_L2TP;
in_tunnel = true;
--
2.5.5
next prev parent reply other threads:[~2018-01-19 7:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-11 10:03 [dpdk-dev] [PATCH v1] net/i40e: fix packet type parser issue Beilei Xing
2018-01-12 8:41 ` [dpdk-dev] [PATCH v2] " Beilei Xing
2018-01-14 4:02 ` Zhang, Qi Z
2018-01-15 7:26 ` Xing, Beilei
2018-01-15 13:51 ` [dpdk-dev] [PATCH v3] " Beilei Xing
2018-01-15 23:55 ` Zhang, Qi Z
2018-01-17 14:56 ` Zhang, Helin
2018-01-20 9:45 ` Zhang, Helin
2018-01-19 7:50 ` [dpdk-dev] [PATCH v4 0/3] net/i40e: change for ptype parser Beilei Xing
2018-01-19 7:50 ` [dpdk-dev] [PATCH v4 1/3] net/i40e: fix fail to update ptype table Beilei Xing
2018-01-19 7:50 ` [dpdk-dev] [PATCH v4 2/3] net/i40e: add parser for IPV4FRAG and IPV6FRAG Beilei Xing
2018-01-19 7:50 ` Beilei Xing [this message]
2018-01-20 13:18 ` [dpdk-dev] [PATCH v4 0/3] net/i40e: change for ptype parser Zhang, Qi Z
2018-01-20 13:32 ` Zhang, Helin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1516348206-89406-4-git-send-email-beilei.xing@intel.com \
--to=beilei.xing@intel.com \
--cc=andrey.chilikin@intel.com \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).