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 888EBA32A2 for ; Thu, 24 Oct 2019 16:26:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4692C1EA7A; Thu, 24 Oct 2019 16:26:26 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 56D671E945 for ; Thu, 24 Oct 2019 16:26:24 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2019 07:26:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,224,1569308400"; d="scan'208";a="188602873" Received: from silpixa00399952.ir.intel.com (HELO silpixa00399952.ger.corp.intel.com) ([10.237.222.38]) by orsmga007.jf.intel.com with ESMTP; 24 Oct 2019 07:26:21 -0700 From: David Hunt To: dev@dpdk.org Cc: bruce.richardson@intel.com, David Hunt Date: Thu, 24 Oct 2019 15:26:10 +0100 Message-Id: <20191024142610.37842-1-david.hunt@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH v1] power: fix vm power manager build without i40e 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" channel_monitor.c was dependent on i40e driver being available. This is only necessary for the TRAFFIC policy, so use #ifdef's to not call these when i40e not available. Fixes: f14791a8126e ("examples/vm_power_mgr: add policy to channels") Signed-off-by: David Hunt --- examples/vm_power_manager/channel_monitor.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c index fe6088a18..99080f92a 100644 --- a/examples/vm_power_manager/channel_monitor.c +++ b/examples/vm_power_manager/channel_monitor.c @@ -28,7 +28,9 @@ #include #include #include +#ifdef RTE_LIBRTE_I40E_PMD #include +#endif #include #include "channel_monitor.h" @@ -436,8 +438,12 @@ get_pfid(struct policy *pol) for (i = 0; i < pol->pkt.nb_mac_to_monitor; i++) { RTE_ETH_FOREACH_DEV(x) { +#ifdef RTE_LIBRTE_I40E_PMD ret = rte_pmd_i40e_query_vfid_by_mac(x, (struct rte_ether_addr *)&(pol->pkt.vfid[i])); +#else + ret = -ENOTSUP; +#endif if (ret != -EINVAL) { pol->port[i] = x; break; @@ -531,15 +537,21 @@ get_pkt_diff(struct policy *pol) vsi_pkt_count_prev_total = 0; double rdtsc_curr, rdtsc_diff, diff; int x; +#ifdef RTE_LIBRTE_I40E_PMD struct rte_eth_stats vf_stats; +#endif for (x = 0; x < pol->pkt.nb_mac_to_monitor; x++) { +#ifdef RTE_LIBRTE_I40E_PMD /*Read vsi stats*/ if (rte_pmd_i40e_get_vf_stats(x, pol->pfid[x], &vf_stats) == 0) vsi_pkt_count = vf_stats.ipackets; else vsi_pkt_count = -1; +#else + vsi_pkt_count = -1; +#endif vsi_pkt_total += vsi_pkt_count; -- 2.17.1