examples/power: fix build with some disabled PMDs
authorDavid Christensen <drc@linux.vnet.ibm.com>
Tue, 2 Apr 2019 18:46:12 +0000 (14:46 -0400)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 22 Apr 2019 22:15:10 +0000 (00:15 +0200)
Running the devtools/test-build.sh script on IBM Power systems fails
because the IXGBE_PMD is explicity disabled for Power as an untested
driver, but the examples/vm_power_manager application has a hard
dependency on a function call in the IXGBE_PMD.

Modify the example application so that all dependencies on PMD code
are conditionally compiled.

Bugzilla ID: 237
Fixes: c9a4779135c9 ("examples/vm_power_mgr: set MAC address of VF")

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Acked-by: David Hunt <david.hunt@intel.com>
examples/vm_power_manager/main.c

index 1a846af..5fa13fe 100644 (file)
 #include "vm_power_cli.h"
 #include "oob_monitor.h"
 #include "parse.h"
+#ifdef RTE_LIBRTE_IXGBE_PMD
 #include <rte_pmd_ixgbe.h>
+#endif
+#ifdef RTE_LIBRTE_I40E_PMD
 #include <rte_pmd_i40e.h>
+#endif
+#ifdef RTE_LIBRTE_BNXT_PMD
 #include <rte_pmd_bnxt.h>
+#endif
 
 #define RX_RING_SIZE 1024
 #define TX_RING_SIZE 1024
@@ -370,14 +376,21 @@ main(int argc, char **argv)
                        for (w = 0; w < MAX_VFS; w++) {
                                eth.addr_bytes[5] = w + 0xf0;
 
+                               ret = -ENOTSUP;
+#ifdef RTE_LIBRTE_IXGBE_PMD
                                ret = rte_pmd_ixgbe_set_vf_mac_addr(portid,
                                                        w, &eth);
+#endif
+#ifdef RTE_LIBRTE_I40E_PMD
                                if (ret == -ENOTSUP)
                                        ret = rte_pmd_i40e_set_vf_mac_addr(
                                                        portid, w, &eth);
+#endif
+#ifdef RTE_LIBRTE_BNXT_PMD
                                if (ret == -ENOTSUP)
                                        ret = rte_pmd_bnxt_set_vf_mac_addr(
                                                        portid, w, &eth);
+#endif
 
                                switch (ret) {
                                case 0: