[dpdk-dev] [RFC PATCH v2 5/5] app/test_pmd: add tests for new API's

2016-09-13 Thread Yuanhan Liu
On Mon, Sep 12, 2016 at 03:57:19PM +, Iremonger, Bernard wrote:
> > /root/dpdk/x86_64-native-linuxapp-
> > clang/include/cmdline_parse_num.h:107:3: note: expanded from macro
> > 'TOKEN_NUM_INITIALIZER'
> > numtype,/* type */  \
> > ^~~
> > /root/dpdk/app/test-pmd/cmdline.c:11156:8: error: expression which
> > evaluates to zero treated as a null pointer constant of type 'const char *' 
> > [-
> > Werror,-Wnon-literal-null-conversion]
> >  on, UINT8);
> >  ^
> > /root/dpdk/x86_64-native-linuxapp-
> > clang/include/cmdline_parse_num.h:107:3: note: expanded from macro
> > 'TOKEN_NUM_INITIALIZER'
> > numtype,/* type */  \
> > ^~~
> > 7 errors generated.
> > make[5]: *** [cmdline.o] Error 1
> > make[5]: *** Waiting for unfinished jobs
> > make[4]: *** [test-pmd] Error 2
> > make[4]: *** Waiting for unfinished jobs
> > make[3]: *** [app] Error 2
> > make[2]: *** [all] Error 2
> > make[1]: *** [pre_install] Error 2
> > make: *** [install] Error 2
> > error: build failed
> 
> I am not seeing the above errors when I build with the following commands:
> 
> make config T=x86_64-native-linuxapp-clang
> make install T=x86_64-native-linuxapp-clang -j
> 
> Are you using a different clang config file?

Not really (well, I disabled KNI and UIO stuff). FYI, I'm using the
default clang compiler from ubuntu 16.04-x86_64.

--yliu


[dpdk-dev] [RFC PATCH v2 5/5] app/test_pmd: add tests for new API's

2016-09-13 Thread Iremonger, Bernard
Hi Yuanhan,

<snip)
> Subject: Re: [dpdk-dev] [RFC PATCH v2 5/5] app/test_pmd: add tests for
> new API's
> 
> On Mon, Sep 12, 2016 at 03:57:19PM +, Iremonger, Bernard wrote:
> > > /root/dpdk/x86_64-native-linuxapp-
> > > clang/include/cmdline_parse_num.h:107:3: note: expanded from macro
> > > 'TOKEN_NUM_INITIALIZER'
> > > numtype,/* type */  \
> > > ^~~
> > > /root/dpdk/app/test-pmd/cmdline.c:11156:8: error: expression which
> > > evaluates to zero treated as a null pointer constant of type 'const
> > > char *' [- Werror,-Wnon-literal-null-conversion]
> > >  on, UINT8);
> > >  ^
> > > /root/dpdk/x86_64-native-linuxapp-
> > > clang/include/cmdline_parse_num.h:107:3: note: expanded from macro
> > > 'TOKEN_NUM_INITIALIZER'
> > > numtype,/* type */  \
> > > ^~~
> > > 7 errors generated.
> > > make[5]: *** [cmdline.o] Error 1
> > > make[5]: *** Waiting for unfinished jobs
> > > make[4]: *** [test-pmd] Error 2
> > > make[4]: *** Waiting for unfinished jobs
> > > make[3]: *** [app] Error 2
> > > make[2]: *** [all] Error 2
> > > make[1]: *** [pre_install] Error 2
> > > make: *** [install] Error 2
> > > error: build failed
> >
> > I am not seeing the above errors when I build with the following
> commands:
> >
> > make config T=x86_64-native-linuxapp-clang make install
> > T=x86_64-native-linuxapp-clang -j
> >
> > Are you using a different clang config file?
> 
> Not really (well, I disabled KNI and UIO stuff). FYI, I'm using the default 
> clang
> compiler from ubuntu 16.04-x86_64.
> 
>   --yliu

The clang I am using is version 3.4-1, what is your clang version?

Regards,

Bernard.



[dpdk-dev] [RFC PATCH v2 5/5] app/test_pmd: add tests for new API's

2016-09-12 Thread Iremonger, Bernard
Hi Yuanhan,



> Subject: Re: [dpdk-dev] [RFC PATCH v2 5/5] app/test_pmd: add tests for
> new API's
> 
> On Fri, Aug 26, 2016 at 10:10:20AM +0100, Bernard Iremonger wrote:
> > add test for vf vlan anti spoof
> > add test for vf mac anti spoof
> > add test for vf ping
> > add test for vf vlan strip
> > add test for vf vlan insert
> > add test for tx loopback
> > add test for all queues drop enable bit add test for vf split drop
> > enable bit add test for vf mac address add new API's to the testpmd
> > guide
> >
> > Signed-off-by: Bernard Iremonger 
> 
> Hi,
> 
> FYI, my testrobot caught some errors when this patch is applied.
> (BTW, gcc builds fine)
> 
> --yliu
> 
> ---
> 
> x86_64-native-linuxapp-clang
> 
> /root/dpdk/app/test-pmd/cmdline.c:10629:8: error: expression which
> evaluates to zero treated as a null pointer constant of type 'const char *' [-
> Werror,-Wnon-literal-null-conversion]
>  on, UINT8);
>  ^
> /root/dpdk/x86_64-native-linuxapp-
> clang/include/cmdline_parse_num.h:107:3: note: expanded from macro
> 'TOKEN_NUM_INITIALIZER'
> numtype,/* type */  \
> ^~~
> /root/dpdk/app/test-pmd/cmdline.c:10710:8: error: expression which
> evaluates to zero treated as a null pointer constant of type 'const char *' [-
> Werror,-Wnon-literal-null-conversion]
>  on, UINT8);
>  ^
> /root/dpdk/x86_64-native-linuxapp-
> clang/include/cmdline_parse_num.h:107:3: note: expanded from macro
> 'TOKEN_NUM_INITIALIZER'
> numtype,/* type */  \
> ^~~
> /root/dpdk/app/test-pmd/cmdline.c:10856:8: error: expression which
> evaluates to zero treated as a null pointer constant of type 'const char *' [-
> Werror,-Wnon-literal-null-conversion]
>  on, UINT8);
>  ^
> /root/dpdk/x86_64-native-linuxapp-
> clang/include/cmdline_parse_num.h:107:3: note: expanded from macro
> 'TOKEN_NUM_INITIALIZER'
> numtype,/* type */  \
> ^~~
> /root/dpdk/app/test-pmd/cmdline.c:10938:8: error: expression which
> evaluates to zero treated as a null pointer constant of type 'const char *' [-
> Werror,-Wnon-literal-null-conversion]
>  on, UINT8);
>  ^
> /root/dpdk/x86_64-native-linuxapp-
> clang/include/cmdline_parse_num.h:107:3: note: expanded from macro
> 'TOKEN_NUM_INITIALIZER'
> numtype,/* type */  \
> ^~~
> /root/dpdk/app/test-pmd/cmdline.c:11010:8: error: expression which
> evaluates to zero treated as a null pointer constant of type 'const char *' [-
> Werror,-Wnon-literal-null-conversion]
>  on, UINT8);
>  ^
> /root/dpdk/x86_64-native-linuxapp-
> clang/include/cmdline_parse_num.h:107:3: note: expanded from macro
> 'TOKEN_NUM_INITIALIZER'
> numtype,/* type */  \
> ^~~
> /root/dpdk/app/test-pmd/cmdline.c:11080:8: error: expression which
> evaluates to zero treated as a null pointer constant of type 'const char *' [-
> Werror,-Wnon-literal-null-conversion]
>  on, UINT8);
>  ^
> /root/dpdk/x86_64-native-linuxapp-
> clang/include/cmdline_parse_num.h:107:3: note: expanded from macro
> 'TOKEN_NUM_INITIALIZER'
> numtype,/* type */  \
> ^~~
> /root/dpdk/app/test-pmd/cmdline.c:11156:8: error: expression which
> evaluates to zero treated as a null pointer constant of type 'const char *' [-
> Werror,-Wnon-literal-null-conversion]
>  on, UINT8);
>  ^
> /root/dpdk/x86_64-native-linuxapp-
> clang/include/cmdline_parse_num.h:107:3: note: expanded from macro
> 'TOKEN_NUM_INITIALIZER'
> numtype,/* type */  \
> ^~~
> 7 errors generated.
> make[5]: *** [cmdline.o] Error 1
> make[5]: *** Waiting for unfinished jobs
> make[4]: *** [test-pmd] Error 2
> make[4]: *** Waiting for unfinished jobs
> make[3]: *** [app] Error 2
> make[2]: *** [all] Error 2
> make[1]: *** [pre_install] Error 2
> make: *** [install] Error 2
> error: build failed

I am not seeing the above errors when I build with the following commands:

make config T=x86_64-native-linuxapp-clang
make install T=x86_64-native-linuxapp-clang -j

Are you using a different clang config file?

Regards,

Bernard.




[dpdk-dev] [RFC PATCH v2 5/5] app/test_pmd: add tests for new API's

2016-09-11 Thread Yuanhan Liu
On Fri, Aug 26, 2016 at 10:10:20AM +0100, Bernard Iremonger wrote:
> add test for vf vlan anti spoof
> add test for vf mac anti spoof
> add test for vf ping
> add test for vf vlan strip
> add test for vf vlan insert
> add test for tx loopback
> add test for all queues drop enable bit
> add test for vf split drop enable bit
> add test for vf mac address
> add new API's to the testpmd guide
> 
> Signed-off-by: Bernard Iremonger 

Hi,

FYI, my testrobot caught some errors when this patch is applied.
(BTW, gcc builds fine)

--yliu

---

x86_64-native-linuxapp-clang

/root/dpdk/app/test-pmd/cmdline.c:10629:8: error: expression which evaluates to 
zero treated as a null pointer constant of type 'const char *' 
[-Werror,-Wnon-literal-null-conversion]
 on, UINT8);
 ^
/root/dpdk/x86_64-native-linuxapp-clang/include/cmdline_parse_num.h:107:3: 
note: expanded from macro 'TOKEN_NUM_INITIALIZER'
numtype,/* type */  \
^~~
/root/dpdk/app/test-pmd/cmdline.c:10710:8: error: expression which evaluates to 
zero treated as a null pointer constant of type 'const char *' 
[-Werror,-Wnon-literal-null-conversion]
 on, UINT8);
 ^
/root/dpdk/x86_64-native-linuxapp-clang/include/cmdline_parse_num.h:107:3: 
note: expanded from macro 'TOKEN_NUM_INITIALIZER'
numtype,/* type */  \
^~~
/root/dpdk/app/test-pmd/cmdline.c:10856:8: error: expression which evaluates to 
zero treated as a null pointer constant of type 'const char *' 
[-Werror,-Wnon-literal-null-conversion]
 on, UINT8);
 ^
/root/dpdk/x86_64-native-linuxapp-clang/include/cmdline_parse_num.h:107:3: 
note: expanded from macro 'TOKEN_NUM_INITIALIZER'
numtype,/* type */  \
^~~
/root/dpdk/app/test-pmd/cmdline.c:10938:8: error: expression which evaluates to 
zero treated as a null pointer constant of type 'const char *' 
[-Werror,-Wnon-literal-null-conversion]
 on, UINT8);
 ^
/root/dpdk/x86_64-native-linuxapp-clang/include/cmdline_parse_num.h:107:3: 
note: expanded from macro 'TOKEN_NUM_INITIALIZER'
numtype,/* type */  \
^~~
/root/dpdk/app/test-pmd/cmdline.c:11010:8: error: expression which evaluates to 
zero treated as a null pointer constant of type 'const char *' 
[-Werror,-Wnon-literal-null-conversion]
 on, UINT8);
 ^
/root/dpdk/x86_64-native-linuxapp-clang/include/cmdline_parse_num.h:107:3: 
note: expanded from macro 'TOKEN_NUM_INITIALIZER'
numtype,/* type */  \
^~~
/root/dpdk/app/test-pmd/cmdline.c:11080:8: error: expression which evaluates to 
zero treated as a null pointer constant of type 'const char *' 
[-Werror,-Wnon-literal-null-conversion]
 on, UINT8);
 ^
/root/dpdk/x86_64-native-linuxapp-clang/include/cmdline_parse_num.h:107:3: 
note: expanded from macro 'TOKEN_NUM_INITIALIZER'
numtype,/* type */  \
^~~
/root/dpdk/app/test-pmd/cmdline.c:11156:8: error: expression which evaluates to 
zero treated as a null pointer constant of type 'const char *' 
[-Werror,-Wnon-literal-null-conversion]
 on, UINT8);
 ^
/root/dpdk/x86_64-native-linuxapp-clang/include/cmdline_parse_num.h:107:3: 
note: expanded from macro 'TOKEN_NUM_INITIALIZER'
numtype,/* type */  \
^~~
7 errors generated.
make[5]: *** [cmdline.o] Error 1
make[5]: *** Waiting for unfinished jobs
make[4]: *** [test-pmd] Error 2
make[4]: *** Waiting for unfinished jobs
make[3]: *** [app] Error 2
make[2]: *** [all] Error 2
make[1]: *** [pre_install] Error 2
make: *** [install] Error 2
error: build failed


[dpdk-dev] [RFC PATCH v2 5/5] app/test_pmd: add tests for new API's

2016-08-26 Thread Bernard Iremonger
add test for vf vlan anti spoof
add test for vf mac anti spoof
add test for vf ping
add test for vf vlan strip
add test for vf vlan insert
add test for tx loopback
add test for all queues drop enable bit
add test for vf split drop enable bit
add test for vf mac address
add new API's to the testpmd guide

Signed-off-by: Bernard Iremonger 
---
 app/test-pmd/cmdline.c  | 700 
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  68 ++-
 2 files changed, 766 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index f90befc..fb29c0a 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -10585,6 +10585,697 @@ cmdline_parse_inst_t cmd_config_e_tag_filter_del = {
},
 };

+/* vf vlan anti spoof configuration */
+
+/* Common result structure for vf vlan anti spoof */
+struct cmd_vf_vlan_anti_spoof_result {
+   cmdline_fixed_string_t set;
+   cmdline_fixed_string_t vf;
+   cmdline_fixed_string_t vlan;
+   cmdline_fixed_string_t antispoof;
+   uint8_t port_id;
+   uint32_t vf_id;
+   uint8_t on;
+};
+
+/* Common CLI fields for vf vlan anti spoof enable disable */
+cmdline_parse_token_string_t cmd_vf_vlan_anti_spoof_set =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_vlan_anti_spoof_result,
+set, "set");
+cmdline_parse_token_string_t cmd_vf_vlan_anti_spoof_vf =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_vlan_anti_spoof_result,
+vf, "vf");
+cmdline_parse_token_string_t cmd_vf_vlan_anti_spoof_vlan =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_vlan_anti_spoof_result,
+vlan, "vlan");
+cmdline_parse_token_string_t cmd_vf_vlan_anti_spoof_antispoof =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_vlan_anti_spoof_result,
+antispoof, "antispoof");
+cmdline_parse_token_num_t cmd_vf_vlan_anti_spoof_port_id =
+   TOKEN_NUM_INITIALIZER
+   (struct cmd_vf_vlan_anti_spoof_result,
+port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_vlan_anti_spoof_vf_id =
+   TOKEN_NUM_INITIALIZER
+   (struct cmd_vf_vlan_anti_spoof_result,
+vf_id, UINT32);
+cmdline_parse_token_num_t cmd_vf_vlan_anti_spoof_on =
+   TOKEN_NUM_INITIALIZER
+   (struct cmd_vf_vlan_anti_spoof_result,
+on, UINT8);
+
+static void
+cmd_set_vf_vlan_anti_spoof_parsed(
+   void *parsed_result,
+   __attribute__((unused)) struct cmdline *cl,
+   __attribute__((unused)) void *data)
+{
+   struct cmd_vf_vlan_anti_spoof_result *res = parsed_result;
+   int ret = 0;
+
+   if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+   return;
+
+   if (res->vf_id > 63) {
+   printf("vf_id must be less than 64.\n");
+   return;
+   }
+   ret = rte_eth_dev_set_vf_vlan_anti_spoof(res->port_id, res->vf_id, 
res->on);
+   if (ret < 0)
+   printf("vf vlan anti spoofing programming error: (%s)\n",
+  strerror(-ret));
+}
+
+cmdline_parse_inst_t cmd_set_vf_vlan_anti_spoof = {
+   .f = cmd_set_vf_vlan_anti_spoof_parsed,
+   .data = NULL,
+   .help_str = "enable/disable vf vlan anti spoof",
+   .tokens = {
+   (void *)_vf_vlan_anti_spoof_set,
+   (void *)_vf_vlan_anti_spoof_vf,
+   (void *)_vf_vlan_anti_spoof_vlan,
+   (void *)_vf_vlan_anti_spoof_antispoof,
+   (void *)_vf_vlan_anti_spoof_port_id,
+   (void *)_vf_vlan_anti_spoof_vf_id,
+   (void *)_vf_vlan_anti_spoof_on,
+   NULL,
+   },
+};
+
+/* vf mac anti spoof configuration */
+
+/* Common result structure for vf mac anti spoof */
+struct cmd_vf_mac_anti_spoof_result {
+   cmdline_fixed_string_t set;
+   cmdline_fixed_string_t vf;
+   cmdline_fixed_string_t mac;
+   cmdline_fixed_string_t antispoof;
+   uint8_t port_id;
+   uint32_t vf_id;
+   uint8_t on;
+};
+
+/* Common CLI fields for vf mac anti spoof enable disable */
+cmdline_parse_token_string_t cmd_vf_mac_anti_spoof_set =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_mac_anti_spoof_result,
+set, "set");
+cmdline_parse_token_string_t cmd_vf_mac_anti_spoof_vf =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_mac_anti_spoof_result,
+vf, "vf");
+cmdline_parse_token_string_t cmd_vf_mac_anti_spoof_mac =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_mac_anti_spoof_result,
+mac, "mac");
+cmdline_parse_token_string_t cmd_vf_mac_anti_spoof_antispoof =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_mac_anti_spoof_result,
+antispoof, "antispoof");
+cmdline_parse_token_num_t cmd_vf_mac_anti_spoof_port_id =
+   TOKEN_NUM_INITIALIZER
+   (struct