From patchwork Fri Apr 23 00:31:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Zhou X-Patchwork-Id: 92044 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3F9B7A0A02; Fri, 23 Apr 2021 02:33:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A3FAB41DEA; Fri, 23 Apr 2021 02:32:25 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id A6FF841D06 for ; Fri, 23 Apr 2021 02:32:07 +0200 (CEST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id BCB7F20B83F1; Thu, 22 Apr 2021 17:32:06 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BCB7F20B83F1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1619137926; bh=sEDvNlgmx8tyoKVT27EcHA7cN5/IJOur3QyaWmsTRyk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SOVzPbHzr+Zskg5HvFAFW3VsXsT00RxBGFTA++3EcCDaUgVdrVptjzj8vWq62+D34 FMtXcRmnCKUQ2LJNiRM89dI0q6jSZnlSxYQbNySjy/j249+9mY6GHvBiBqExOJS+J2 E1rOwxFT/xTVSkmUtmvUSQ1FkXdbxSls6WI36wEo= From: Jie Zhou To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, xiaoyun.li@intel.com, roretzla@microsoft.com, pallavi.kadam@intel.com, thomas@monjalon.net, bruce.richardson@intel.com, ferruh.yigit@intel.com, konstantin.ananyev@intel.com Date: Thu, 22 Apr 2021 17:31:59 -0700 Message-Id: <1619137920-13449-10-git-send-email-jizh@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1619137920-13449-1-git-send-email-jizh@linux.microsoft.com> References: <1618874400-26819-1-git-send-email-jizh@linux.microsoft.com> <1619137920-13449-1-git-send-email-jizh@linux.microsoft.com> Subject: [dpdk-dev] [PATCH v7 09/10] app/testpmd: fix unused function warnings X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Function print_fdir_mask and print_fdir_flex_payload is only called when either i40e or ixgbe presents. Add #if defined to remove "unused function" compilation warning. Signed-off-by: Jie Zhou Signed-off-by: Jie Zhou --- app/test-pmd/config.c | 82 +++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index dadc44031..e7edad216 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -4358,6 +4358,47 @@ set_record_burst_stats(uint8_t on_off) record_burst_stats = on_off; } +static char* +flowtype_to_str(uint16_t flow_type) +{ + struct flow_type_info { + char str[32]; + uint16_t ftype; + }; + + uint8_t i; + static struct flow_type_info flowtype_str_table[] = { + {"raw", RTE_ETH_FLOW_RAW}, + {"ipv4", RTE_ETH_FLOW_IPV4}, + {"ipv4-frag", RTE_ETH_FLOW_FRAG_IPV4}, + {"ipv4-tcp", RTE_ETH_FLOW_NONFRAG_IPV4_TCP}, + {"ipv4-udp", RTE_ETH_FLOW_NONFRAG_IPV4_UDP}, + {"ipv4-sctp", RTE_ETH_FLOW_NONFRAG_IPV4_SCTP}, + {"ipv4-other", RTE_ETH_FLOW_NONFRAG_IPV4_OTHER}, + {"ipv6", RTE_ETH_FLOW_IPV6}, + {"ipv6-frag", RTE_ETH_FLOW_FRAG_IPV6}, + {"ipv6-tcp", RTE_ETH_FLOW_NONFRAG_IPV6_TCP}, + {"ipv6-udp", RTE_ETH_FLOW_NONFRAG_IPV6_UDP}, + {"ipv6-sctp", RTE_ETH_FLOW_NONFRAG_IPV6_SCTP}, + {"ipv6-other", RTE_ETH_FLOW_NONFRAG_IPV6_OTHER}, + {"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD}, + {"port", RTE_ETH_FLOW_PORT}, + {"vxlan", RTE_ETH_FLOW_VXLAN}, + {"geneve", RTE_ETH_FLOW_GENEVE}, + {"nvgre", RTE_ETH_FLOW_NVGRE}, + {"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE}, + }; + + for (i = 0; i < RTE_DIM(flowtype_str_table); i++) { + if (flowtype_str_table[i].ftype == flow_type) + return flowtype_str_table[i].str; + } + + return NULL; +} + +#if defined(RTE_NET_I40E) || defined(RTE_NET_IXGBE) + static inline void print_fdir_mask(struct rte_eth_fdir_masks *mask) { @@ -4417,47 +4458,6 @@ print_fdir_flex_payload(struct rte_eth_fdir_flex_conf *flex_conf, uint32_t num) printf("\n"); } -static char * -flowtype_to_str(uint16_t flow_type) -{ - struct flow_type_info { - char str[32]; - uint16_t ftype; - }; - - uint8_t i; - static struct flow_type_info flowtype_str_table[] = { - {"raw", RTE_ETH_FLOW_RAW}, - {"ipv4", RTE_ETH_FLOW_IPV4}, - {"ipv4-frag", RTE_ETH_FLOW_FRAG_IPV4}, - {"ipv4-tcp", RTE_ETH_FLOW_NONFRAG_IPV4_TCP}, - {"ipv4-udp", RTE_ETH_FLOW_NONFRAG_IPV4_UDP}, - {"ipv4-sctp", RTE_ETH_FLOW_NONFRAG_IPV4_SCTP}, - {"ipv4-other", RTE_ETH_FLOW_NONFRAG_IPV4_OTHER}, - {"ipv6", RTE_ETH_FLOW_IPV6}, - {"ipv6-frag", RTE_ETH_FLOW_FRAG_IPV6}, - {"ipv6-tcp", RTE_ETH_FLOW_NONFRAG_IPV6_TCP}, - {"ipv6-udp", RTE_ETH_FLOW_NONFRAG_IPV6_UDP}, - {"ipv6-sctp", RTE_ETH_FLOW_NONFRAG_IPV6_SCTP}, - {"ipv6-other", RTE_ETH_FLOW_NONFRAG_IPV6_OTHER}, - {"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD}, - {"port", RTE_ETH_FLOW_PORT}, - {"vxlan", RTE_ETH_FLOW_VXLAN}, - {"geneve", RTE_ETH_FLOW_GENEVE}, - {"nvgre", RTE_ETH_FLOW_NVGRE}, - {"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE}, - }; - - for (i = 0; i < RTE_DIM(flowtype_str_table); i++) { - if (flowtype_str_table[i].ftype == flow_type) - return flowtype_str_table[i].str; - } - - return NULL; -} - -#if defined(RTE_NET_I40E) || defined(RTE_NET_IXGBE) - static inline void print_fdir_flex_mask(struct rte_eth_fdir_flex_conf *flex_conf, uint32_t num) {