[dpdk-dev] app/test-pmd: fix compiler error with drivers disabled

Message ID 20171025200945.82300-1-bruce.richardson@intel.com (mailing list archive)
State Not Applicable, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Bruce Richardson Oct. 25, 2017, 8:09 p.m. UTC
  When both ixgbe and bnxt drivers are disabled at build time, testpmd has
a compiler errors due to unused parameters, and unused variables.

Fixes: 36735a932ca7 ("net/bnxt: support set VF QOS and MAC anti spoof")
CC: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test-pmd/cmdline.c | 5 +++++
 app/test-pmd/config.c  | 7 +++++++
 2 files changed, 12 insertions(+)
  

Comments

Ferruh Yigit Oct. 25, 2017, 8:20 p.m. UTC | #1
On 10/25/2017 1:09 PM, Bruce Richardson wrote:
> When both ixgbe and bnxt drivers are disabled at build time, testpmd has
> a compiler errors due to unused parameters, and unused variables.
> 
> Fixes: 36735a932ca7 ("net/bnxt: support set VF QOS and MAC anti spoof")
> CC: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Is this duplicate of [1] which is applied into next-net [2].


[1]
http://dpdk.org/dev/patchwork/patch/30813/

[2]
http://dpdk.org/browse/next/dpdk-next-net/commit/?id=9d4d6c4a5563fe63facc9ed6e5087d54900e511d
  
Bruce Richardson Oct. 25, 2017, 8:44 p.m. UTC | #2
On Wed, Oct 25, 2017 at 01:20:30PM -0700, Ferruh Yigit wrote:
> On 10/25/2017 1:09 PM, Bruce Richardson wrote:
> > When both ixgbe and bnxt drivers are disabled at build time, testpmd has
> > a compiler errors due to unused parameters, and unused variables.
> > 
> > Fixes: 36735a932ca7 ("net/bnxt: support set VF QOS and MAC anti spoof")
> > CC: stable@dpdk.org
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> Is this duplicate of [1] which is applied into next-net [2].
> 
> 
> [1]
> http://dpdk.org/dev/patchwork/patch/30813/
> 
> [2]
> http://dpdk.org/browse/next/dpdk-next-net/commit/?id=9d4d6c4a5563fe63facc9ed6e5087d54900e511d
> 
Yes, please ignore as a dup. I'll mark it as N/A in patchwork.

/Bruce
  

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 1159a4a47..809e3c25b 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -7504,6 +7504,11 @@  cmd_set_vf_rxmode_parsed(void *parsed_result,
 		ret = rte_pmd_bnxt_set_vf_rxmode(res->port_id, res->vf_id,
 						 rx_mode, (uint8_t)is_on);
 #endif
+#ifndef RTE_LIBRTE_IXGBE_PMD
+#ifndef RTE_LIBRTE_BNXT_PMD
+	RTE_SET_USED(is_on);
+#endif
+#endif
 	if (ret < 0)
 		printf("bad VF receive mode parameter, return code = %d \n",
 		ret);
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index bafe76cf4..9440ff540 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -3194,6 +3194,13 @@  set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
 	if (diag == -ENOTSUP)
 		diag = rte_pmd_bnxt_set_vf_rate_limit(port_id, vf, rate, q_msk);
 #endif
+#ifndef RTE_LIBRTE_IXGBE_PMD
+#ifndef RTE_LIBRTE_BNXT_PMD
+	RTE_SET_USED(vf);
+	RTE_SET_USED(rate);
+	RTE_SET_USED(q_msk);
+#endif
+#endif
 	if (diag == 0)
 		return diag;