[v2] examples/vm_power: add conditional compilation for PMD specific code

Message ID 1554230772-2170-1-git-send-email-drc@linux.vnet.ibm.com
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series
  • [v2] examples/vm_power: add conditional compilation for PMD specific code
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

David Christensen April 2, 2019, 6:46 p.m.
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

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
---

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

 examples/vm_power_manager/main.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

David Christensen April 12, 2019, 5:04 p.m. | #1
> 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
> 
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>

Ping.
David Hunt April 18, 2019, 2:23 p.m. | #2
On 2/4/2019 7:46 PM, David Christensen wrote:
> 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
>
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
> ---
>
> v2:
> * Fixed tab issues reported by checkpatches, added Bugzilla ID
>
>   examples/vm_power_manager/main.c | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
>
> diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
> index 893bf4c..bb50a2a 100644
> --- a/examples/vm_power_manager/main.c
> +++ b/examples/vm_power_manager/main.c
> @@ -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:


Acked-by: David Hunt <david.hunt@intel.com>
Thomas Monjalon April 22, 2019, 10:05 p.m. | #3
18/04/2019 16:23, Hunt, David:
> On 2/4/2019 7:46 PM, David Christensen wrote:
> > 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
> >
> > Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
> 
> Acked-by: David Hunt <david.hunt@intel.com>

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

Applied, thanks

Patch

diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 893bf4c..bb50a2a 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -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: