Skip to contentSkip to conversation

examples/vm_power: add conditional compilation for PMD specific code

PATCH Applied David Christensen 3 participants 4 messages Apr 2, 2019 – Apr 22, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 examples/vm_power: add conditional compilation for PMD specific code

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: Running test-build.sh Fails on ppc_64 fails due to hard-coded
requirement for IXGBE_PMD in examples/vm_power_manager

---

v2:
* Fixed tab issues reported by checkpatches, added Bugzilla ID

 examples/vm_power_manager/main.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
examples/vm_power_manager/main.c +13 -0
index 893bf4c..bb50a2a 100644
@@ -31,9 +31,15 @@
 #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
@@ -369,14 +375,21 @@
 			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:
Signature · 1 line
1.8.3.1
Acked-by on v2 1/1
#2 lore raw
In reply to David Christensen
Quoted 53 lines · David Christensen

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: Running test-build.sh Fails on ppc_64 fails due to hard-coded
requirement for IXGBE_PMD in examples/vm_power_manager

---

v2:
* Fixed tab issues reported by checkpatches, added Bugzilla ID

  examples/vm_power_manager/main.c | 13 +++++++++++++
  1 file changed, 13 insertions(+)
examples/vm_power_manager/main.c +10 -0
index 893bf4c..bb50a2a 100644
@@ -31,9 +31,15 @@
  #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
@@ -369,14 +375,21 @@
  			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(

examples/vm_power_manager/main.c line 395

Quoted 10 lines
examples/vm_power_manager/main.c +3 -0
  							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:
#3 lore raw

18/04/2019 16:23, Hunt, David:

Quoted 9 lines · David Christensen
Quoted 8 lines

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.

Quoted 7 lines
Quoted 5 lines

Bugzilla ID: 237
Fixes: Running test-build.sh Fails on ppc_64 fails due to hard-coded
requirement for IXGBE_PMD in examples/vm_power_manager

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

Applied, thanks