Skip to contentSkip to conversation

power: fix vm power manager build without i40e

PATCH Applied David Hunt 3 participants 3 messages Oct 24, 2019 – Oct 27, 2019

lore
Share & tools
lore

David Hunt

author
#0 lore raw

PATCH 1/1 power: fix vm power manager build without i40e

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")
---
 examples/vm_power_manager/channel_monitor.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
examples/vm_power_manager/channel_monitor.c +12 -0
index fe6088a18..99080f92a 100644
@@ -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;
 
Signature · 1 line
2.17.1
Tested-by Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · David Hunt

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")
---
 examples/vm_power_manager/channel_monitor.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Tested with "meson configure -Ddisable_drivers=/net/i40e" Head build fails, passes with this patch applied.

#2 lore raw

24/10/2019 17:07, Bruce Richardson:

Quoted 12 lines · David Hunt
Quoted 11 lines

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")
---
 examples/vm_power_manager/channel_monitor.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
Quoted 5 lines

Tested with "meson configure -Ddisable_drivers=/net/i40e" Head build fails, passes with this patch applied.

Applied, thanks