From: Thomas Monjalon Date: Thu, 15 Jun 2017 09:25:06 +0000 (+0200) Subject: app/testpmd: fix build with bypass without ixgbe X-Git-Tag: spdx-start~3002 X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=50c4440ee89bf1fe1303baa86f5b8f9e99b35361 app/testpmd: fix build with bypass without ixgbe When ixgbe bypass is not explicitly disabled while ixgbe is disabled: app/test-pmd/testpmd.c:304:27: error: ‘RTE_PMD_IXGBE_BYPASS_TMT_OFF’ undeclared here The ixgbe bypass feature is meaningful only if ixgbe is enabled. So we need to check both. A best fix will be to enable bypass always and remove this option. Fixes: e261265e42a1 ("ethdev: move bypass functions to ixgbe PMD") Signed-off-by: Thomas Monjalon --- diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 37368351a5..105c71f392 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -3928,7 +3928,7 @@ cmd_set_bypass_mode_parsed(void *parsed_result, portid_t port_id = res->port_id; int32_t rc = -EINVAL; -#ifdef RTE_LIBRTE_IXGBE_BYPASS +#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS uint32_t bypass_mode = RTE_PMD_IXGBE_BYPASS_MODE_NORMAL; if (!strcmp(res->value, "bypass")) @@ -3996,7 +3996,7 @@ cmd_set_bypass_event_parsed(void *parsed_result, struct cmd_set_bypass_event_result *res = parsed_result; portid_t port_id = res->port_id; -#ifdef RTE_LIBRTE_IXGBE_BYPASS +#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS uint32_t bypass_event = RTE_PMD_IXGBE_BYPASS_EVENT_NONE; uint32_t bypass_mode = RTE_PMD_IXGBE_BYPASS_MODE_NORMAL; @@ -4101,7 +4101,7 @@ cmd_set_bypass_timeout_parsed(void *parsed_result, { __rte_unused struct cmd_set_bypass_timeout_result *res = parsed_result; -#ifdef RTE_LIBRTE_IXGBE_BYPASS +#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS if (!strcmp(res->value, "1.5")) bypass_timeout = RTE_PMD_IXGBE_BYPASS_TMT_1_5_SEC; else if (!strcmp(res->value, "2")) @@ -4164,7 +4164,7 @@ cmd_show_bypass_config_parsed(void *parsed_result, struct cmd_show_bypass_config_result *res = parsed_result; portid_t port_id = res->port_id; int rc = -EINVAL; -#ifdef RTE_LIBRTE_IXGBE_BYPASS +#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS uint32_t event_mode; uint32_t bypass_mode; uint32_t timeout = bypass_timeout; diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index d32cbb96d5..b29328a69d 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -299,7 +299,7 @@ uint32_t event_print_mask = (UINT32_C(1) << RTE_ETH_EVENT_UNKNOWN) | * NIC bypass mode configuration options. */ -#ifdef RTE_LIBRTE_IXGBE_BYPASS +#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS /* The NIC bypass watchdog timeout. */ uint32_t bypass_timeout = RTE_PMD_IXGBE_BYPASS_TMT_OFF; #endif @@ -2015,7 +2015,7 @@ init_port_config(void) rte_eth_macaddr_get(pid, &port->eth_addr); map_port_queue_stats_mapping_registers(pid, port); -#ifdef RTE_LIBRTE_IXGBE_BYPASS +#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS rte_pmd_ixgbe_bypass_init(pid); #endif