From 8f9b74390009b5033b873661afecdec0fd4b3e28 Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Tue, 24 Nov 2020 11:49:56 +0000 Subject: [PATCH] app/testpmd: fix build without i40e If there was no RTE_NET_I40E configured the static routine str2flowtype() was not used causing compilation warning. The str2flowtype() is moved under #ifdef RTE_NET_I40E block. Fixes: 1be514fbcea9 ("ethdev: remove legacy FDIR filter type support") Signed-off-by: Viacheslav Ovsiienko Reviewed-by: Ferruh Yigit --- app/test-pmd/cmdline.c | 48 +++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index bde0de5165..0d2d6aad05 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -10097,6 +10097,30 @@ cmdline_parse_inst_t cmd_show_queue_region_info_all = { /* *** Filters Control *** */ +#define IPV4_ADDR_TO_UINT(ip_addr, ip) \ +do { \ + if ((ip_addr).family == AF_INET) \ + (ip) = (ip_addr).addr.ipv4.s_addr; \ + else { \ + printf("invalid parameter.\n"); \ + return; \ + } \ +} while (0) + +#define IPV6_ADDR_TO_ARRAY(ip_addr, ip) \ +do { \ + if ((ip_addr).family == AF_INET6) \ + rte_memcpy(&(ip), \ + &((ip_addr).addr.ipv6), \ + sizeof(struct in6_addr)); \ + else { \ + printf("invalid parameter.\n"); \ + return; \ + } \ +} while (0) + +#ifdef RTE_NET_I40E + static uint16_t str2flowtype(char *string) { @@ -10132,30 +10156,6 @@ str2flowtype(char *string) return RTE_ETH_FLOW_UNKNOWN; } -#define IPV4_ADDR_TO_UINT(ip_addr, ip) \ -do { \ - if ((ip_addr).family == AF_INET) \ - (ip) = (ip_addr).addr.ipv4.s_addr; \ - else { \ - printf("invalid parameter.\n"); \ - return; \ - } \ -} while (0) - -#define IPV6_ADDR_TO_ARRAY(ip_addr, ip) \ -do { \ - if ((ip_addr).family == AF_INET6) \ - rte_memcpy(&(ip), \ - &((ip_addr).addr.ipv6), \ - sizeof(struct in6_addr)); \ - else { \ - printf("invalid parameter.\n"); \ - return; \ - } \ -} while (0) - -#ifdef RTE_NET_I40E - /* *** deal with flow director filter *** */ struct cmd_flow_director_result { cmdline_fixed_string_t flow_director_filter;