app/testpmd: fix build without ixgbe
PATCH 1/1 app/testpmd: fix build without ixgbe
When ixgbe bypass is not explictly 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.
--- app/test-pmd/cmdline.c | 8 ++++---- app/test-pmd/testpmd.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)
app/test-pmd/cmdline.c +4 -4
@@ -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 definedRTE_LIBRTE_IXGBE_PMD && definedRTE_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 definedRTE_LIBRTE_IXGBE_PMD && definedRTE_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 definedRTE_LIBRTE_IXGBE_PMD && definedRTE_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 definedRTE_LIBRTE_IXGBE_PMD && definedRTE_LIBRTE_IXGBE_BYPASS uint32_t event_mode;uint32_t bypass_mode;uint32_t timeout = bypass_timeout;
app/test-pmd/testpmd.c +2 -2
@@ -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 definedRTE_LIBRTE_IXGBE_PMD && definedRTE_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 definedRTE_LIBRTE_IXGBE_PMD && definedRTE_LIBRTE_IXGBE_BYPASS rte_pmd_ixgbe_bypass_init (pid);#endif
Signature · 1 line
2.13.1
Looks ok to me, but why would one enable IXGBE_BYPASS without enabling IXGBE?
Quoted 79 lines · Thomas Monjalon
When ixgbe bypass is not explictly disabled while ixgbe is disabled:
app/test-pmd/testpmd.c:304:27: error:
‘RTE_PMD_IXGBE_BYPASS_TMT_OFF’ undeclared hereThe 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 <[email protected]>--- app/test-pmd/cmdline.c | 8 ++++---- app/test-pmd/testpmd.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)app/test-pmd/cmdline.c +4
-4@@ -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 definedRTE_LIBRTE_IXGBE_PMD && definedRTE_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 definedRTE_LIBRTE_IXGBE_PMD && definedRTE_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 definedRTE_LIBRTE_IXGBE_PMD && definedRTE_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 definedRTE_LIBRTE_IXGBE_PMD && definedRTE_LIBRTE_IXGBE_BYPASS uint32_t event_mode;uint32_t bypass_mode;uint32_t timeout = bypass_timeout;app/test-pmd/testpmd.c +2
-2@@ -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 definedRTE_LIBRTE_IXGBE_PMD && definedRTE_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 definedRTE_LIBRTE_IXGBE_PMD && definedRTE_LIBRTE_IXGBE_BYPASS rte_pmd_ixgbe_bypass_init (pid);#endif
15/06/2017 13:37, Radu Nicolau:
Quoted 2 lines
Looks ok to me, but why would one enable
IXGBE_BYPASSwithout enabling IXGBE?
[...]
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +1
-1-#ifdef RTE_LIBRTE_IXGBE_BYPASS +#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS
RTE_LIBRTE_IXGBE_BYPASS should not be enabled if RTE_LIBRTE_IXGBE_PMD is disabled. But it can happen in some scripted configuration like test-build.sh does.
Anyway we should drop the RTE_LIBRTE_IXGBE_BYPASS configuration option and enables it always.
Hi Radu,
Quoted 9 lines
-----Original Message-----
From: Nicolau, Radu
Sent: Thursday, June 15, 2017 7:37 PM
To: Thomas Monjalon
Cc: Lu, Wenzhuo; [email protected]
Subject: Re: [PATCH] app/testpmd: fix build without ixgbeLooks ok to me, but why would one enable
IXGBE_BYPASSwithout enabling IXGBE?
Although the scenario doesn't make sense, I think it's better to add more check to avoid the users making any mistake.
Quoted 94 lines · Thomas Monjalon
app/test-pmd/cmdline.c cmd_set_bypass_mode_parsed(void
Quoted 22 lines
When ixgbe bypass is not explictly disabled while ixgbe is disabled:
app/test-pmd/testpmd.c:304:27: error:
‘RTE_PMD_IXGBE_BYPASS_TMT_OFF’ undeclared hereThe 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 <[email protected]>--- app/test-pmd/cmdline.c | 8 ++++---- app/test-pmd/testpmd.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)app/test-pmd/cmdline.c +0
-0@@ -3928,7 +3928,7 @@ cmd_set_bypass_mode_parsed(void
*parsed_result,app/test-pmd/cmdline.c cmd_set_bypass_mode_parsed(void *parsed_result,
Quoted 5 lines
app/test-pmd/cmdline.c +1
-1portid_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_BYPASSapp/test-pmd/cmdline.c cmd_set_bypass_event_parsed(void
Quoted 4 lines
app/test-pmd/cmdline.c +0
-0uint32_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,app/test-pmd/cmdline.c cmd_set_bypass_event_parsed(void *parsed_result,
Quoted 5 lines
app/test-pmd/cmdline.c +1
-1struct 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_BYPASSapp/test-pmd/cmdline.c cmd_set_bypass_timeout_parsed(void
Quoted 4 lines
app/test-pmd/cmdline.c +0
-0uint32_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,app/test-pmd/cmdline.c cmd_set_bypass_timeout_parsed(void · line 4102
Quoted 2 lines
app/test-pmd/cmdline.c +0
-0{ __rte_unused struct cmd_set_bypass_timeout_result *res =
parsed_result;app/test-pmd/cmdline.c cmd_set_bypass_timeout_parsed(void · line 4103
Quoted 3 lines
app/test-pmd/cmdline.c +1
-1-#ifdef RTE_LIBRTE_IXGBE_BYPASS +#if defined RTE_LIBRTE_IXGBE_PMD && defined
RTE_LIBRTE_IXGBE_BYPASSapp/test-pmd/cmdline.c cmd_show_bypass_config_parsed(void
Quoted 4 lines
app/test-pmd/cmdline.c +0
-0if (!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,app/test-pmd/cmdline.c cmd_show_bypass_config_parsed(void *parsed_result,
Quoted 5 lines
app/test-pmd/cmdline.c +1
-1struct 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_BYPASSapp/test-pmd/testpmd.c uint32_t event_print_mask = (UINT32_C(1) <<
Quoted 8 lines
app/test-pmd/cmdline.c +0
-0uint32_t event_mode;uint32_t bypass_mode;uint32_t timeout = bypass_timeout;app/test-pmd/testpmd.c +0
-0@@ -299,7 +299,7 @@ uint32_t event_print_mask = (UINT32_C(1) <<
RTE_ETH_EVENT_UNKNOWN) |app/test-pmd/testpmd.c uint32_t event_print_mask = (UINT32_C(1) << RTE_ETH_EVENT_UNKNOWN) |
Quoted 5 lines
app/test-pmd/testpmd.c +1
-1* NIC bypass mode configuration options. */ -#ifdef RTE_LIBRTE_IXGBE_BYPASS +#if defined RTE_LIBRTE_IXGBE_PMD && defined
RTE_LIBRTE_IXGBE_BYPASSapp/test-pmd/testpmd.c init_port_config(void) · line 2018
Quoted 9 lines
app/test-pmd/testpmd.c +1
-1/* 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_BYPASSQuoted 3 lines
app/test-pmd/testpmd.c +0
-0rte_pmd_ixgbe_bypass_init (pid);#endif
Thomas Monjalon
Applied16/06/2017 03:29, Lu, Wenzhuo:
Quoted 6 lines
From: Nicolau, Radu
Quoted 3 lines
Looks ok to me, but why would one enable
IXGBE_BYPASSwithout enabling IXGBE?Although the scenario doesn't make sense, I think it's better to add more check to avoid the users making any mistake.
Applied