From: David Hunt <david.hunt@intel.com>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com, David Hunt <david.hunt@intel.com>
Subject: [dpdk-dev] [PATCH v1] power: fix vm power manager build without i40e
Date: Thu, 24 Oct 2019 15:26:10 +0100 [thread overview]
Message-ID: <20191024142610.37842-1-david.hunt@intel.com> (raw)
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 <david.hunt@intel.com>
---
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 <rte_atomic.h>
#include <rte_cycles.h>
#include <rte_ethdev.h>
+#ifdef RTE_LIBRTE_I40E_PMD
#include <rte_pmd_i40e.h>
+#endif
#include <libvirt/libvirt.h>
#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
next reply other threads:[~2019-10-24 14:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-24 14:26 David Hunt [this message]
2019-10-24 15:07 ` Bruce Richardson
2019-10-27 18:31 ` Thomas Monjalon
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=20191024142610.37842-1-david.hunt@intel.com \
--to=david.hunt@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
/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).