add unit tests for bitrate, latency and pdump libraries
v10 cover add unit tests for bitrate, latency and pdump libraries
From: Reshma Pattan <[email protected]>
1/5: add helper functions for tests using ring-PMD Rx/Tx 2/5: unit test cases added for bitrate library 3/5: unit test cases added for latencystats library 4/5: unit test cases added for pdump library 5/5: added new unit tests to autotest list
Patches 2/5,3/5 depends on 1/5
Patch 4/5 depends on 1/5 and the below patch http://patches.dpdk.org/patch/43354/
---
v10: fixed clang compiler issues and freed latency stats memzone in latency stats unit tests.
v9: rebased ontop of latest autotest changes and added new tests to the autotest list
v8: renamed commit headline and freed the metrics memzone for bitrate ut
v7: removed unused macros and corrected the comment
v6: updated ring variable appropriately
v5: rebased, freed pools and rings, created common patch set
---
Naga Suresh Somarowthu (4):
test: add helper functions for tests using ring-PMD Rx/Tx
test: add unit tests for bitrate library
test: add unit tests for latencystats library
test: add unit test for pdump library
Reshma Pattan (1):
autotest: add new unit tests to autotest list
test/test/Makefile | 9 ++ test/test/autotest_data.py | 18 +++ test/test/process.h | 12 ++ test/test/sample_packet_forward.c | 115 +++++++++++++++++++ test/test/sample_packet_forward.h | 40 +++++++ test/test/test.c | 2 + test/test/test_bitratestats.c | 229 +++++++++++++++++++++++++++++++++++++ test/test/test_latencystats.c | 229 +++++++++++++++++++++++++++++++++++++ test/test/test_pdump.c | 232 ++++++++++++++++++++++++++++++++++++++ test/test/test_pdump.h | 31 +++++ 10 files changed, 917 insertions(+) create mode 100644 test/test/sample_packet_forward.c create mode 100644 test/test/sample_packet_forward.h create mode 100644 test/test/test_bitratestats.c create mode 100644 test/test/test_latencystats.c create mode 100644 test/test/test_pdump.c create mode 100644 test/test/test_pdump.h
Signature · 1 line
2.14.4
PATCH v10 1/5 test: add helper functions for tests using ring-PMD Rx/Tx
From: Naga Suresh Somarowthu <[email protected]>
Added ring pmd based packet rx/tx helper functions for verifying Latency, Bitrate and pdump lib UTs.
--- test/test/Makefile | 1 + test/test/sample_packet_forward.c | 115 ++++++++++++++++++++++++++++++++++++++ test/test/sample_packet_forward.h | 40 +++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 test/test/sample_packet_forward.c create mode 100644 test/test/sample_packet_forward.h
test/test/Makefile +1 -0
@@ -165,6 +165,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_REORDER) += test_reorder.c SRCS-y += virtual_pmd.c SRCS-y += packet_burst_generator.c +SRCS-y += sample_packet_forward.c SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y)
test/test/sample_packet_forward.c new file +115 -0
115 lines not on this page · raw message
test/test/sample_packet_forward.h new file +40 -0
@@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2018 Intel Corporation +*/ + +#ifndef _SAMPLE_PACKET_FORWARD_H_ +#define _SAMPLE_PACKET_FORWARD_H_ + +/* MACROS to support virtual ring creation */ +#define RING_SIZE 256 +#define NUM_QUEUES 1 +#define NB_MBUF 512 + +#define NUM_PACKETS 10 + +/* Sample test to create virtual rings and tx,rx portid from rings */ +int test_ring_setup (struct rte_ring **ring,uint16_t *portid); + +/* Sample test to free the virtual rings */ +void test_ring_free (struct rte_ring *rxtx); + +/* Sample test to forward packet using virtual port id */ +int test_packet_forward (struct rte_mbuf **pbuf,uint16_t portid, +uint16_t queue_id); + +/* sample test to allocate buffer for pkts */ +int test_get_mbuf_from_pool (struct rte_mempool **mp,struct rte_mbuf **pbuf, +char *poolname); + +/* Sample test to create the mempool */ +int test_get_mempool (struct rte_mempool **mp,char *poolname); + +/* sample test to deallocate the allocated buffers and mempool */ +void test_put_mbuf_to_pool (struct rte_mempool *mp,struct rte_mbuf **pbuf); + +/* Sample test to free the mempool */ +void test_mp_free (struct rte_mempool *mp); + +/* Sample test to release the vdev */ +void test_vdev_uninit (const char *vdev); +#endif /* _SAMPLE_PACKET_FORWARD_H_ */
Signature · 1 line
2.14.4
PATCH v10 2/5 test: add unit tests for bitrate library
In reply to Reshma PattanFrom: Naga Suresh Somarowthu <[email protected]>
Unit Test Cases for BitRate library.
--- test/test/Makefile | 1 + test/test/test_bitratestats.c | 229 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 230 insertions(+) create mode 100644 test/test/test_bitratestats.c
test/test/Makefile +1 -0
@@ -183,6 +183,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring_perf.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c +SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) += test_bitratestats.c ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
test/test/test_bitratestats.c new file +229 -0
229 lines not on this page · raw message
Signature · 1 line
2.14.4
PATCH v10 3/5 test: add unit tests for latencystats library
In reply to Reshma PattanFrom: Naga Suresh Somarowthu <[email protected]>
Unit Test Cases added for latencystats library.
--- test/test/Makefile | 1 + test/test/test_latencystats.c | 229 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 230 insertions(+) create mode 100644 test/test/test_latencystats.c
test/test/Makefile +1 -0
@@ -184,6 +184,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) += test_bitratestats.c +SRCS-$(CONFIG_RTE_LIBRTE_LATENCY_STATS) += test_latencystats.c ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
test/test/test_latencystats.c new file +229 -0
229 lines not on this page · raw message
Signature · 1 line
2.14.4
PATCH v10 4/5 test: add unit test for pdump library
In reply to Reshma PattanFrom: Naga Suresh Somarowthu <[email protected]>
Unit test cases are added for pdump library.
Primary process will act as server, forks a child secondary process. Secondary process acts as client.
Server will do pdump init to serve any pdump client requests. Server will create a vdev, send/receive packets continuously in a separate thread.
Client will create virtual rings to receive the packet dump. Client sends pdump enable/disable requests using either port/device id. Packet flow direction can be tx/rx/tx&rx.
In Server, appropriate pdump callbacks are triggered,
when packets are transmitted/received.
Pdump packet is copied to client rings.
--- test/test/Makefile | 6 ++ test/test/process.h | 12 +++ test/test/test.c | 2 + test/test/test_pdump.c | 232 +++++++++++++++++++++++++++++++++++++++++++++++++ test/test/test_pdump.h | 31 +++++++ 5 files changed, 283 insertions(+) create mode 100644 test/test/test_pdump.c create mode 100644 test/test/test_pdump.h
test/test/Makefile +6 -0
@@ -185,6 +185,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) += test_bitratestats.c SRCS-$(CONFIG_RTE_LIBRTE_LATENCY_STATS) += test_latencystats.c +SRCS-$(CONFIG_RTE_LIBRTE_PDUMP) += test_pdump.c ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
@@ -214,6 +215,11 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -D_GNU_SOURCE LDLIBS += -lm + +ifeq ($(CONFIG_RTE_LIBRTE_PDUMP),y) +LDLIBS += -lpthread +endif + ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) ifeq ($(CONFIG_RTE_LIBRTE_COMPRESSDEV),y) LDLIBS += -lz
test/test/process.h +12 -0
@@ -18,6 +18,10 @@#define exe "exe"#endif +#include <pthread.h> +extern void *send_pkts (void *empty); +extern uint16_t flag_for_send_pkts; +/* * launches a second copy of the test process using the given argv parameters, * which should include argv[0] as the process name. To identify in the
@@ -31,6 +35,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value)char *argv_cpy[numargs +1 ];int i, fd, status;char path[32 ]; +pthread_t thread;pid_t pid =fork ();if (pid <0 )
@@ -61,8 +66,15 @@ process_dup(const char *const argv[], int numargs, const char *env_value)rte_panic ("Cannot exec\n" ); }/* parent process does a wait */ +if ((strcmp (env_value,"run_pdump_server_tests" ) ==0 )) +pthread_create (&thread,NULL , &send_pkts,NULL ); +while (wait (&status) != pid) ; +if ((strcmp (env_value,"run_pdump_server_tests" ) ==0 )) { + flag_for_send_pkts =0 ; +pthread_join (thread,NULL ); + }return status; }
test/test/test.c +2 -0
@@ -30,6 +30,7 @@ extern cmdline_parse_ctx_t main_ctx[];#endif #include "test.h" +#include "test_pdump.h" #define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1
@@ -49,6 +50,7 @@ do_recursive_call(void)int (*action_fn)(void ); } actions[] = { { "run_secondary_instances", test_mp_secondary }, + { "run_pdump_server_tests", test_pdump }, { "test_missing_c_flag", no_action }, { "test_master_lcore_flag", no_action }, { "test_invalid_n_flag", no_action },
test/test/test_pdump.c new file +232 -0
232 lines not on this page · raw message
test/test/test_pdump.h new file +31 -0
@@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2018 Intel Corporation +*/ + +#ifndef _TEST_PDUMP_H_ +#define _TEST_PDUMP_H_ + +#define QUEUE_ID 0 +#define NUM_ITR 3 + +/* sample test to send packets to the pdump client recursively */ +void *send_pkts (void *port); + +/* Sample test to create setup for the pdump server tests */ +int test_pdump_init (void ); + +/* Sample test to teardown the pdump server setup */ +int test_pdump_uninit (void ); + +/* Sample test to run the pdump client tests */ +int run_pdump_client_tests (void ); + +/* Sample test to run the pdump server tests */ +int run_pdump_server_tests (void ); + +/* Sample test to run the pdump client and server tests based on +* the process type +*/ +int test_pdump (void ); + +#endif /* _TEST_PDUMP_H_ */
Signature · 1 line
2.14.4
PATCH v10 5/5 autotest: add new unit tests to autotest list
In reply to Reshma PattanFrom: Reshma Pattan <[email protected]>
added bitrate, latency and pdump lib unit tests to autotest list.
--- test/test/autotest_data.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
test/test/autotest_data.py +18 -0
@@ -476,6 +476,24 @@ "Func": default_autotest, "Report": None, }, + { + "Name": "Bitratestats autotest", + "Command": "bitratestats_autotest", + "Func": default_autotest, + "Report": None, + } + { + "Name": "Latencystats autotest", + "Command": "latencystats_autotest", + "Func": default_autotest, + "Report": None, + } + { + "Name": "Pdump autotest", + "Comamnd": "pdump_autotest", + "Func": default_autotest, + "Report": None, + } # #Please always keep all dump tests at the end and together! #
Signature · 1 line
2.14.4
Hi Reshma,
01/08/2018 00:18, Reshma Pattan:
Quoted 7 lines
v10: fixed clang compiler issues and freed latency stats memzone in latency stats unit tests.
v9: rebased ontop of latest autotest changes and added new tests to the autotest list
v8: renamed commit headline and freed the metrics memzone for bitrate ut
v7: removed unused macros and corrected the comment
v6: updated ring variable appropriately
v5: rebased, freed pools and rings, created common patch set
Please use --in-reply-to as explained in the contributing guide, in order to get all the versions in the same thread.
01/08/2018 00:18, Reshma Pattan:
Quoted 8 lines
v10: fixed clang compiler issues and freed latency stats memzone in latency stats unit tests.
v9: rebased ontop of latest autotest changes and added new tests to the autotest list
v8: renamed commit headline and freed the metrics memzone for bitrate ut
v7: removed unused macros and corrected the comment
v6: updated ring variable appropriately
v5: rebased, freed pools and rings, created common patch set
---
Sorry, the integration of this patchset is very painful.
After asking for rebase, for clang fix, there are still some basic errors with 32-bit compilation:
test_latencystats.c:131:21: error:
format ‘%ld’ expects argument of type ‘long int’,
but argument 2 has type ‘uint64_t’ {aka ‘long long unsigned int’}linkage:
test@test@@dpdk-test@exe/test.c.o:(.data+0x18): undefined reference to `test_pdump'
or even MAINTAINERS file:
test/test/sample_packet_forward.c
test/test/sample_packet_forward.h
test/test/test_bitratestats.c
test/test/test_latencystats.c
I have already spent too much time on it, despite it is not fixing 18.08.
Please do a complete detailed review of this series, so it can be considered for 18.11.
Hi Thomas,
Quoted 43 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Wednesday, August 1, 2018 8:52 AM
To: Pattan, Reshma <[email protected]>
Cc: [email protected]; Burakov, Anatoly <[email protected]>; Parthasarathy, JananeeX M <[email protected]>; Somarowthu, Naga SureshX <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v10 0/5] add unit tests for bitrate, latency and pdump libraries01/08/2018 00:18, Reshma Pattan:
Quoted 10 lines
v10: fixed clang compiler issues and freed latency stats memzone in latency stats unit tests.
v9: rebased ontop of latest autotest changes and added new tests to the autotest list
v8: renamed commit headline and freed the metrics memzone for bitrate ut
v7: removed unused macros and corrected the comment
v6: updated ring variable appropriately
v5: rebased, freed pools and rings, created common patch set
---Sorry, the integration of this patchset is very painful.
After asking for rebase, for clang fix, there are still some basic errors with 32- bit compilation:
test_latencystats.c:131:21: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘uint64_t’ {aka ‘long long unsigned int’}linkage:
test@test@@dpdk-test@exe/test.c.o:(.data+0x18): undefinedreference to `test_pdump'
or even
MAINTAINERSfile:
test/test/sample_packet_forward.c
test/test/sample_packet_forward.h
test/test/test_bitratestats.c
test/test/test_latencystats.c
Quoted 5 lines
I have already spent too much time on it, despite it is not fixing 18.08.
Please do a complete detailed review of this series, so it can be considered for 18.11.
We missed to do these basic checks, apologies for consuming your time.
Naga Suresh has now proactively worked on fixing these issues and running pre checks on patches and addressed in v12.
The earlier versions were reviewed by me, Remy and Anatoly . So we request you to consider latest patches for 18.08, until unless they don’t give any last minute surprises.
Thanks,
Reshma
03/08/2018 15:45, Pattan, Reshma:
Quoted 40 lines
Hi Thomas,
From: Thomas Monjalon [mailto:[email protected]]
Sent: Wednesday, August 1, 2018 8:52 AMQuoted 36 lines
01/08/2018 00:18, Reshma Pattan:
Quoted 10 lines
v10: fixed clang compiler issues and freed latency stats memzone in latency stats unit tests.
v9: rebased ontop of latest autotest changes and added new tests to the autotest list
v8: renamed commit headline and freed the metrics memzone for bitrate ut
v7: removed unused macros and corrected the comment
v6: updated ring variable appropriately
v5: rebased, freed pools and rings, created common patch set
---Sorry, the integration of this patchset is very painful.
After asking for rebase, for clang fix, there are still some basic errors with 32- bit compilation:
test_latencystats.c:131:21: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘uint64_t’ {aka ‘long long unsigned int’}linkage:
test@test@@dpdk-test@exe/test.c.o:(.data+0x18): undefinedreference to `test_pdump'
or even
MAINTAINERSfile:
test/test/sample_packet_forward.c
test/test/sample_packet_forward.h
test/test/test_bitratestats.c
test/test/test_latencystats.cI have already spent too much time on it, despite it is not fixing 18.08.
Quoted 8 lines
Quoted 3 lines
Please do a complete detailed review of this series, so it can be considered for 18.11.
We missed to do these basic checks, apologies for consuming your time.
Naga Suresh has now proactively worked on fixing these issues and running pre checks on patches and addressed in v12.
The earlier versions were reviewed by me, Remy and Anatoly . So we request you to consider latest patches for 18.08, until unless they don’t give any last minute surprises.
Sorry, I consider it is now too late for such patch in 18.08. It is not fixing any issue.
Last days of 18.08 cycle will be really focus on bugs and doc.
Hi Thomas,
Quoted 69 lines
-----Original Message-----
From: Pattan, Reshma
Sent: Friday, August 03, 2018 7:15 PM
To: Thomas Monjalon <[email protected]>; Somarowthu, Naga SureshX <[email protected]>
Cc: [email protected]; Burakov, Anatoly <[email protected]>; Parthasarathy, JananeeX M <[email protected]>
Subject: RE: [dpdk-dev] [PATCH v10 0/5] add unit tests for bitrate, latency and pdump librariesHi Thomas,
Quoted 27 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Wednesday, August 1, 2018 8:52 AM
To: Pattan, Reshma <[email protected]>
Cc: [email protected]; Burakov, Anatoly <[email protected]>; Parthasarathy, JananeeX M <[email protected]>; Somarowthu, Naga SureshX <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v10 0/5] add unit tests for bitrate, latency and pdump libraries01/08/2018 00:18, Reshma Pattan:
Quoted 10 lines
v10: fixed clang compiler issues and freed latency stats memzone in latency stats unit tests.
v9: rebased ontop of latest autotest changes and added new tests to the autotest list
v8: renamed commit headline and freed the metrics memzone for bitrate ut
v7: removed unused macros and corrected the comment
v6: updated ring variable appropriately
v5: rebased, freed pools and rings, created common patch set
---Sorry, the integration of this patchset is very painful.
After asking for rebase, for clang fix, there are still some basic errors with 32- bit compilation:
Quoted 7 lines
test_latencystats.c:131:21: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘uint64_t’ {aka ‘long long unsigned int’}linkage:
test@test@@dpdk-test@exe/test.c.o:(.data+0x18): undefinedreference
Quoted 9 lines
to `test_pdump'
or even
MAINTAINERSfile:
test/test/sample_packet_forward.c
test/test/sample_packet_forward.h
test/test/test_bitratestats.c
test/test/test_latencystats.cQuoted 5 lines
I have already spent too much time on it, despite it is not fixing 18.08.
Please do a complete detailed review of this series, so it can be considered for 18.11.
We missed to do these basic checks, apologies for consuming your time. Naga Suresh has now proactively worked on fixing these issues and running pre checks on patches and addressed in v12.
The earlier versions were reviewed by me, Remy and Anatoly . So we request you to consider latest patches for 18.08, until unless they don’t give any last minute surprises.
Quoted 5 lines
Thanks,
Reshma
Apologies very much to miss the earlier patch pre-checks.
We have gone through the cheatsheet and validated pre-checks in the patch v12.
Compiled Successfully in Fedora 27, Fedora 26, CentOS 7.2, CentOS 7.4, Ubuntu for both 32bit/64bit and FreeBSD (64bit) Build using compilers gcc, icc, clang were successful in Fedora.
Shared Library builds were successful in Fedora 27, CentOS 7.2 and Ubuntu
Executed checkpatch, check-git-log without any errors. Code changes were acknowledged by reviewers.
Request to please consider the patch set v12 to be included in RC3 18.08.
In case of any info/change please let us know.
Thanks for your support.
M.P.Jananee
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
03/08/2018 16:16, Parthasarathy, JananeeX M:
Quoted 65 lines
Hi Thomas,
From: Pattan, Reshma
Quoted 51 lines
Hi Thomas,
From: Thomas Monjalon [mailto:[email protected]]
Quoted 17 lines
01/08/2018 00:18, Reshma Pattan:
Quoted 10 lines
v10: fixed clang compiler issues and freed latency stats memzone in latency stats unit tests.
v9: rebased ontop of latest autotest changes and added new tests to the autotest list
v8: renamed commit headline and freed the metrics memzone for bitrate ut
v7: removed unused macros and corrected the comment
v6: updated ring variable appropriately
v5: rebased, freed pools and rings, created common patch set
---Sorry, the integration of this patchset is very painful.
After asking for rebase, for clang fix, there are still some basic errors with 32- bit compilation:
Quoted 7 lines
test_latencystats.c:131:21: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘uint64_t’ {aka ‘long long unsigned int’}linkage:
test@test@@dpdk-test@exe/test.c.o:(.data+0x18): undefinedreference
Quoted 9 lines
to `test_pdump'
or even
MAINTAINERSfile:
test/test/sample_packet_forward.c
test/test/sample_packet_forward.h
test/test/test_bitratestats.c
test/test/test_latencystats.cQuoted 5 lines
I have already spent too much time on it, despite it is not fixing 18.08.
Please do a complete detailed review of this series, so it can be considered for 18.11.
We missed to do these basic checks, apologies for consuming your time. Naga Suresh has now proactively worked on fixing these issues and running pre checks on patches and addressed in v12.
The earlier versions were reviewed by me, Remy and Anatoly . So we request you to consider latest patches for 18.08, until unless they don’t give any last minute surprises.Quoted 5 lines
Thanks,
ReshmaApologies very much to miss the earlier patch pre-checks.
We have gone through the cheatsheet and validated pre-checks in the patch v12.
Compiled Successfully in Fedora 27, Fedora 26, CentOS 7.2, CentOS 7.4, Ubuntu for both 32bit/64bit and FreeBSD (64bit) Build using compilers gcc, icc, clang were successful in Fedora.
Shared Library builds were successful in Fedora 27, CentOS 7.2 and Ubuntu
Quoted 6 lines
Executed checkpatch, check-git-log without any errors. Code changes were acknowledged by reviewers.
Request to please consider the patch set v12 to be included in RC3 18.08.
In case of any info/change please let us know.
Why are you insisting so much?
I have already replied to Reshma that it is too late and not urgent:
http://mails.dpdk.org/archives/dev/2018-August/109352.html
Please do not make it even more difficult.
I just do not want to spend more time on this series now.
When I will take time, I will do a better review, and I can promise that I will have some comments.
So please consider my earlier comment to avoid burning too much time:
"Please do a complete detailed review of this series"
After a quick look, I already see some suspicious includes, linkage, and last 2 patches should be integrated with others.
To make it clear, the quality was not good and I already burnt too much time. I won't spend more time on it during August.
v11 cover add unit tests for bitrate, latency and pdump libraries
In reply to Reshma Pattan1/6: add helper functions for tests using ring-PMD Rx/Tx 2/6: unit test cases added for bitrate library 3/6: unit test cases added for latencystats library 4/6: unit test cases added for pdump library 5/6: added new unit tests to autotest list
6/6: updated maintainers for bitrate latency pdump tests
Patches 2/6, 3/6 and 4/6 depends on 1/6
---
v11: fixed compilation issue in centos and 32bit arch
removed memzone free as per fix in the latency library
and updated the maintainers file
v10: fixed clang compiler issues and freed latency stats memzone in latency stats unit tests.
v9: rebased ontop of latest autotest changes and added new tests to the autotest list
v8: renamed commit headline and freed the metrics memzone for bitrate ut
v7: removed unused macros and corrected the comment
v6: updated ring variable appropriately
v5: rebased, freed pools and rings, created common patch set
---
Naga Suresh Somarowthu (6):
test: add helper functions for tests using ring-PMD Rx/Tx
test: add unit tests for bitrate library
test: add unit tests for latencystats library
test: add unit test for pdump library
autotest: add new unit tests to autotest list
maintainers: add bitrate latency pdump tests
MAINTAINERS | 10 +- test/test/Makefile | 9 ++ test/test/autotest_data.py | 18 +++ test/test/process.h | 12 ++ test/test/sample_packet_forward.c | 115 +++++++++++++++++++ test/test/sample_packet_forward.h | 40 +++++++ test/test/test.c | 2 + test/test/test_bitratestats.c | 229 +++++++++++++++++++++++++++++++++++++ test/test/test_latencystats.c | 226 +++++++++++++++++++++++++++++++++++++ test/test/test_pdump.c | 232 ++++++++++++++++++++++++++++++++++++++ test/test/test_pdump.h | 31 +++++ 11 files changed, 923 insertions(+), 1 deletion(-) create mode 100644 test/test/sample_packet_forward.c create mode 100644 test/test/sample_packet_forward.h create mode 100644 test/test/test_bitratestats.c create mode 100644 test/test/test_latencystats.c create mode 100644 test/test/test_pdump.c create mode 100644 test/test/test_pdump.h
Signature · 1 line
2.13.6
PATCH v11 1/6 test: add helper functions for tests using ring-PMD Rx/Tx
Added ring pmd based packet rx/tx helper functions for verifying Latency, Bitrate and pdump lib UTs.
--- test/test/Makefile | 1 + test/test/sample_packet_forward.c | 115 ++++++++++++++++++++++++++++++++++++++ test/test/sample_packet_forward.h | 40 +++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 test/test/sample_packet_forward.c create mode 100644 test/test/sample_packet_forward.h
test/test/Makefile +1 -0
@@ -165,6 +165,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_REORDER) += test_reorder.c SRCS-y += virtual_pmd.c SRCS-y += packet_burst_generator.c +SRCS-y += sample_packet_forward.c SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y)
test/test/sample_packet_forward.c new file +115 -0
115 lines not on this page · raw message
test/test/sample_packet_forward.h new file +40 -0
@@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2018 Intel Corporation +*/ + +#ifndef _SAMPLE_PACKET_FORWARD_H_ +#define _SAMPLE_PACKET_FORWARD_H_ + +/* MACROS to support virtual ring creation */ +#define RING_SIZE 256 +#define NUM_QUEUES 1 +#define NB_MBUF 512 + +#define NUM_PACKETS 10 + +/* Sample test to create virtual rings and tx,rx portid from rings */ +int test_ring_setup (struct rte_ring **ring,uint16_t *portid); + +/* Sample test to free the virtual rings */ +void test_ring_free (struct rte_ring *rxtx); + +/* Sample test to forward packet using virtual port id */ +int test_packet_forward (struct rte_mbuf **pbuf,uint16_t portid, +uint16_t queue_id); + +/* sample test to allocate buffer for pkts */ +int test_get_mbuf_from_pool (struct rte_mempool **mp,struct rte_mbuf **pbuf, +char *poolname); + +/* Sample test to create the mempool */ +int test_get_mempool (struct rte_mempool **mp,char *poolname); + +/* sample test to deallocate the allocated buffers and mempool */ +void test_put_mbuf_to_pool (struct rte_mempool *mp,struct rte_mbuf **pbuf); + +/* Sample test to free the mempool */ +void test_mp_free (struct rte_mempool *mp); + +/* Sample test to release the vdev */ +void test_vdev_uninit (const char *vdev); +#endif /* _SAMPLE_PACKET_FORWARD_H_ */
Signature · 1 line
2.13.6
PATCH v11 2/6 test: add unit tests for bitrate library
In reply to Naga Suresh SomarowthuUnit Test Cases for BitRate library.
--- test/test/Makefile | 1 + test/test/test_bitratestats.c | 229 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 230 insertions(+) create mode 100644 test/test/test_bitratestats.c
test/test/Makefile +1 -0
@@ -183,6 +183,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring_perf.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c +SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) += test_bitratestats.c ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
test/test/test_bitratestats.c new file +229 -0
229 lines not on this page · raw message
Signature · 1 line
2.13.6
PATCH v11 3/6 test: add unit tests for latencystats library
In reply to Naga Suresh SomarowthuUnit Test Cases added for latencystats library.
--- test/test/Makefile | 1 + test/test/test_latencystats.c | 226 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 227 insertions(+) create mode 100644 test/test/test_latencystats.c
test/test/Makefile +1 -0
@@ -184,6 +184,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) += test_bitratestats.c +SRCS-$(CONFIG_RTE_LIBRTE_LATENCY_STATS) += test_latencystats.c ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
test/test/test_latencystats.c new file +226 -0
226 lines not on this page · raw message
Signature · 1 line
2.13.6
PATCH v11 4/6 test: add unit test for pdump library
In reply to Naga Suresh Somarowthu Unit test cases are added for pdump library.
Primary process will act as server, forks a child secondary process. Secondary process acts as client.
Server will do pdump init to serve any pdump client requests. Server will create a vdev, send/receive packets continuously in a separate thread.
Client will create virtual rings to receive the packet dump. Client sends pdump enable/disable requests using either port/device id. Packet flow direction can be tx/rx/tx&rx.
In Server, appropriate pdump callbacks are triggered,
when packets are transmitted/received.
Pdump packet is copied to client rings.
--- test/test/Makefile | 6 ++ test/test/process.h | 12 +++ test/test/test.c | 2 + test/test/test_pdump.c | 232 +++++++++++++++++++++++++++++++++++++++++++++++++ test/test/test_pdump.h | 31 +++++++ 5 files changed, 283 insertions(+) create mode 100644 test/test/test_pdump.c create mode 100644 test/test/test_pdump.h
test/test/Makefile +6 -0
@@ -185,6 +185,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) += test_bitratestats.c SRCS-$(CONFIG_RTE_LIBRTE_LATENCY_STATS) += test_latencystats.c +SRCS-$(CONFIG_RTE_LIBRTE_PDUMP) += test_pdump.c ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
@@ -214,6 +215,11 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -D_GNU_SOURCE LDLIBS += -lm + +ifeq ($(CONFIG_RTE_LIBRTE_PDUMP),y) +LDLIBS += -lpthread +endif + ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) ifeq ($(CONFIG_RTE_LIBRTE_COMPRESSDEV),y) LDLIBS += -lz
test/test/process.h +12 -0
@@ -18,6 +18,10 @@#define exe "exe"#endif +#include <pthread.h> +extern void *send_pkts (void *empty); +extern uint16_t flag_for_send_pkts; +/* * launches a second copy of the test process using the given argv parameters, * which should include argv[0] as the process name. To identify in the
@@ -31,6 +35,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value)char *argv_cpy[numargs +1 ];int i, fd, status;char path[32 ]; +pthread_t thread;pid_t pid =fork ();if (pid <0 )
@@ -61,8 +66,15 @@ process_dup(const char *const argv[], int numargs, const char *env_value)rte_panic ("Cannot exec\n" ); }/* parent process does a wait */ +if ((strcmp (env_value,"run_pdump_server_tests" ) ==0 )) +pthread_create (&thread,NULL , &send_pkts,NULL ); +while (wait (&status) != pid) ; +if ((strcmp (env_value,"run_pdump_server_tests" ) ==0 )) { + flag_for_send_pkts =0 ; +pthread_join (thread,NULL ); + }return status; }
test/test/test.c +2 -0
@@ -30,6 +30,7 @@ extern cmdline_parse_ctx_t main_ctx[];#endif #include "test.h" +#include "test_pdump.h" #define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1
@@ -49,6 +50,7 @@ do_recursive_call(void)int (*action_fn)(void ); } actions[] = { { "run_secondary_instances", test_mp_secondary }, + { "run_pdump_server_tests", test_pdump }, { "test_missing_c_flag", no_action }, { "test_master_lcore_flag", no_action }, { "test_invalid_n_flag", no_action },
test/test/test_pdump.c new file +232 -0
232 lines not on this page · raw message
test/test/test_pdump.h new file +31 -0
@@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2018 Intel Corporation +*/ + +#ifndef _TEST_PDUMP_H_ +#define _TEST_PDUMP_H_ + +#define QUEUE_ID 0 +#define NUM_ITR 3 + +/* sample test to send packets to the pdump client recursively */ +void *send_pkts (void *port); + +/* Sample test to create setup for the pdump server tests */ +int test_pdump_init (void ); + +/* Sample test to teardown the pdump server setup */ +int test_pdump_uninit (void ); + +/* Sample test to run the pdump client tests */ +int run_pdump_client_tests (void ); + +/* Sample test to run the pdump server tests */ +int run_pdump_server_tests (void ); + +/* Sample test to run the pdump client and server tests based on +* the process type +*/ +int test_pdump (void ); + +#endif /* _TEST_PDUMP_H_ */
Signature · 1 line
2.13.6
PATCH v11 5/6 autotest: add new unit tests to autotest list
In reply to Naga Suresh Somarowthuadded bitrate, latency and pdump lib unit tests to autotest list.
--- test/test/autotest_data.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
test/test/autotest_data.py +18 -0
@@ -482,6 +482,24 @@ "Func": default_autotest, "Report": None, }, + { + "Name": "Bitratestats autotest", + "Command": "bitratestats_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Latencystats autotest", + "Command": "latencystats_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Pdump autotest", + "Comamnd": "pdump_autotest", + "Func": default_autotest, + "Report": None, + }, # #Please always keep all dump tests at the end and together! #
Signature · 1 line
2.13.6
PATCH v11 6/6 maintainers: add bitrate latency pdump tests
In reply to Naga Suresh SomarowthuUpdate MAINTAINERSHIP for bitrate, latency, pdump unit tests and sample packet helper functions for unit test.
--- MAINTAINERS | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
MAINTAINERS +9 -1
@@ -1018,7 +1018,8 @@ F: lib/librte_pdump/ F: doc/guides/prog_guide/pdump_lib.rst F: app/pdump/ F: doc/guides/tools/pdump.rst - +F: test/test/test_pdump.c +F: test/test/test_pdump.h Packet Framework ----------------
@@ -1144,10 +1145,12 @@ F: lib/librte_metrics/ Bit-rate statistics M: Remy Horton <[email protected]> F: lib/librte_bitratestats/ +F: test/test/test_bitratestats.c Latency statistics M: Reshma Pattan <[email protected]> F: lib/librte_latencystats/ +F: test/test/test_latencystats.c BPF - EXPERIMENTAL M: Konstantin Ananyev <[email protected]>
@@ -1176,6 +1179,11 @@ F: test/test/test_resource.c F: test/test/virtual_pmd.c F: test/test/virtual_pmd.h +Sample packet helper functions for unit test +M: Reshma Pattan <[email protected]> +F: test/test/sample_packet_forward.c +F: test/test/sample_packet_forward.h + Driver testing tool M: Wenzhuo Lu <[email protected]> M: Jingjing Wu <[email protected]>
Signature · 1 line
2.13.6
v12 cover add unit tests for bitrate, latency and pdump libraries
In reply to Naga Suresh Somarowthu1/6: add helper functions for tests using ring-PMD Rx/Tx 2/6: unit test cases added for bitrate library 3/6: unit test cases added for latencystats library 4/6: unit test cases added for pdump library 5/6: added new unit tests to autotest list
6/6: updated maintainers for bitrate latency pdump tests
Patches 2/6, 3/6 and 4/6 depends on 1/6
---
v12: corrected commit message for pdump unit test
v11: fixed compilation issue in centos and 32bit arch
removed memzone free as per fix in the latency library
and updated the maintainers file
v10: fixed clang compiler issues and freed latency stats memzone in latency stats unit tests.
v9: rebased ontop of latest autotest changes and added new tests to the autotest list
v8: renamed commit headline and freed the metrics memzone for bitrate ut
v7: removed unused macros and corrected the comment
v6: updated ring variable appropriately
v5: rebased, freed pools and rings, created common patch set
---
Naga Suresh Somarowthu (6):
test: add helper functions for tests using ring-PMD Rx/Tx
test: add unit tests for bitrate library
test: add unit tests for latencystats library
test: add unit test for pdump library
autotest: add new unit tests to autotest list
maintainers: add bitrate latency pdump tests
MAINTAINERS | 10 +- test/test/Makefile | 9 ++ test/test/autotest_data.py | 18 +++ test/test/process.h | 12 ++ test/test/sample_packet_forward.c | 115 +++++++++++++++++++ test/test/sample_packet_forward.h | 40 +++++++ test/test/test.c | 2 + test/test/test_bitratestats.c | 229 +++++++++++++++++++++++++++++++++++++ test/test/test_latencystats.c | 226 +++++++++++++++++++++++++++++++++++++ test/test/test_pdump.c | 232 ++++++++++++++++++++++++++++++++++++++ test/test/test_pdump.h | 31 +++++ 11 files changed, 923 insertions(+), 1 deletion(-) create mode 100644 test/test/sample_packet_forward.c create mode 100644 test/test/sample_packet_forward.h create mode 100644 test/test/test_bitratestats.c create mode 100644 test/test/test_latencystats.c create mode 100644 test/test/test_pdump.c create mode 100644 test/test/test_pdump.h
Signature · 1 line
2.13.6
PATCH v12 1/6 test: add helper functions for tests using ring-PMD Rx/Tx
Added ring pmd based packet rx/tx helper functions for verifying Latency, Bitrate and pdump lib UTs.
--- test/test/Makefile | 1 + test/test/sample_packet_forward.c | 115 ++++++++++++++++++++++++++++++++++++++ test/test/sample_packet_forward.h | 40 +++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 test/test/sample_packet_forward.c create mode 100644 test/test/sample_packet_forward.h
test/test/Makefile +1 -0
@@ -165,6 +165,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_REORDER) += test_reorder.c SRCS-y += virtual_pmd.c SRCS-y += packet_burst_generator.c +SRCS-y += sample_packet_forward.c SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y)
test/test/sample_packet_forward.c new file +115 -0
115 lines not on this page · raw message
test/test/sample_packet_forward.h new file +40 -0
@@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2018 Intel Corporation +*/ + +#ifndef _SAMPLE_PACKET_FORWARD_H_ +#define _SAMPLE_PACKET_FORWARD_H_ + +/* MACROS to support virtual ring creation */ +#define RING_SIZE 256 +#define NUM_QUEUES 1 +#define NB_MBUF 512 + +#define NUM_PACKETS 10 + +/* Sample test to create virtual rings and tx,rx portid from rings */ +int test_ring_setup (struct rte_ring **ring,uint16_t *portid); + +/* Sample test to free the virtual rings */ +void test_ring_free (struct rte_ring *rxtx); + +/* Sample test to forward packet using virtual port id */ +int test_packet_forward (struct rte_mbuf **pbuf,uint16_t portid, +uint16_t queue_id); + +/* sample test to allocate buffer for pkts */ +int test_get_mbuf_from_pool (struct rte_mempool **mp,struct rte_mbuf **pbuf, +char *poolname); + +/* Sample test to create the mempool */ +int test_get_mempool (struct rte_mempool **mp,char *poolname); + +/* sample test to deallocate the allocated buffers and mempool */ +void test_put_mbuf_to_pool (struct rte_mempool *mp,struct rte_mbuf **pbuf); + +/* Sample test to free the mempool */ +void test_mp_free (struct rte_mempool *mp); + +/* Sample test to release the vdev */ +void test_vdev_uninit (const char *vdev); +#endif /* _SAMPLE_PACKET_FORWARD_H_ */
Signature · 1 line
2.13.6
PATCH v12 2/6 test: add unit tests for bitrate library
In reply to Naga Suresh SomarowthuUnit Test Cases for BitRate library.
--- test/test/Makefile | 1 + test/test/test_bitratestats.c | 229 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 230 insertions(+) create mode 100644 test/test/test_bitratestats.c
test/test/Makefile +1 -0
@@ -183,6 +183,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring_perf.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c +SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) += test_bitratestats.c ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
test/test/test_bitratestats.c new file +229 -0
229 lines not on this page · raw message
Signature · 1 line
2.13.6
PATCH v12 3/6 test: add unit tests for latencystats library
In reply to Naga Suresh SomarowthuUnit Test Cases added for latencystats library.
--- test/test/Makefile | 1 + test/test/test_latencystats.c | 226 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 227 insertions(+) create mode 100644 test/test/test_latencystats.c
test/test/Makefile +1 -0
@@ -184,6 +184,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) += test_bitratestats.c +SRCS-$(CONFIG_RTE_LIBRTE_LATENCY_STATS) += test_latencystats.c ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
test/test/test_latencystats.c new file +226 -0
226 lines not on this page · raw message
Signature · 1 line
2.13.6
PATCH v12 4/6 test: add unit test for pdump library
In reply to Naga Suresh SomarowthuUnit test cases are added for pdump library.
Primary process will act as server, forks a child secondary process. Secondary process acts as client.
Server will do pdump init to serve any pdump client requests. Server will create a vdev, send/receive packets continuously in a separate thread.
Client will create virtual rings to receive the packet dump. Client sends pdump enable/disable requests using either port/device id. Packet flow direction can be tx/rx/tx&rx.
In Server, appropriate pdump callbacks are triggered,
when packets are transmitted/received.
Pdump packet is copied to client rings.
--- test/test/Makefile | 6 ++ test/test/process.h | 12 +++ test/test/test.c | 2 + test/test/test_pdump.c | 232 +++++++++++++++++++++++++++++++++++++++++++++++++ test/test/test_pdump.h | 31 +++++++ 5 files changed, 283 insertions(+) create mode 100644 test/test/test_pdump.c create mode 100644 test/test/test_pdump.h
test/test/Makefile +6 -0
@@ -185,6 +185,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) += test_bitratestats.c SRCS-$(CONFIG_RTE_LIBRTE_LATENCY_STATS) += test_latencystats.c +SRCS-$(CONFIG_RTE_LIBRTE_PDUMP) += test_pdump.c ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
@@ -214,6 +215,11 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -D_GNU_SOURCE LDLIBS += -lm + +ifeq ($(CONFIG_RTE_LIBRTE_PDUMP),y) +LDLIBS += -lpthread +endif + ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) ifeq ($(CONFIG_RTE_LIBRTE_COMPRESSDEV),y) LDLIBS += -lz
test/test/process.h +12 -0
@@ -18,6 +18,10 @@#define exe "exe"#endif +#include <pthread.h> +extern void *send_pkts (void *empty); +extern uint16_t flag_for_send_pkts; +/* * launches a second copy of the test process using the given argv parameters, * which should include argv[0] as the process name. To identify in the
@@ -31,6 +35,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value)char *argv_cpy[numargs +1 ];int i, fd, status;char path[32 ]; +pthread_t thread;pid_t pid =fork ();if (pid <0 )
@@ -61,8 +66,15 @@ process_dup(const char *const argv[], int numargs, const char *env_value)rte_panic ("Cannot exec\n" ); }/* parent process does a wait */ +if ((strcmp (env_value,"run_pdump_server_tests" ) ==0 )) +pthread_create (&thread,NULL , &send_pkts,NULL ); +while (wait (&status) != pid) ; +if ((strcmp (env_value,"run_pdump_server_tests" ) ==0 )) { + flag_for_send_pkts =0 ; +pthread_join (thread,NULL ); + }return status; }
test/test/test.c +2 -0
@@ -30,6 +30,7 @@ extern cmdline_parse_ctx_t main_ctx[];#endif #include "test.h" +#include "test_pdump.h" #define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1
@@ -49,6 +50,7 @@ do_recursive_call(void)int (*action_fn)(void ); } actions[] = { { "run_secondary_instances", test_mp_secondary }, + { "run_pdump_server_tests", test_pdump }, { "test_missing_c_flag", no_action }, { "test_master_lcore_flag", no_action }, { "test_invalid_n_flag", no_action },
test/test/test_pdump.c new file +232 -0
232 lines not on this page · raw message
test/test/test_pdump.h new file +31 -0
@@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2018 Intel Corporation +*/ + +#ifndef _TEST_PDUMP_H_ +#define _TEST_PDUMP_H_ + +#define QUEUE_ID 0 +#define NUM_ITR 3 + +/* sample test to send packets to the pdump client recursively */ +void *send_pkts (void *port); + +/* Sample test to create setup for the pdump server tests */ +int test_pdump_init (void ); + +/* Sample test to teardown the pdump server setup */ +int test_pdump_uninit (void ); + +/* Sample test to run the pdump client tests */ +int run_pdump_client_tests (void ); + +/* Sample test to run the pdump server tests */ +int run_pdump_server_tests (void ); + +/* Sample test to run the pdump client and server tests based on +* the process type +*/ +int test_pdump (void ); + +#endif /* _TEST_PDUMP_H_ */
Signature · 1 line
2.13.6
PATCH v12 5/6 autotest: add new unit tests to autotest list
In reply to Naga Suresh Somarowthuadded bitrate, latency and pdump lib unit tests to autotest list.
--- test/test/autotest_data.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
test/test/autotest_data.py +18 -0
@@ -482,6 +482,24 @@ "Func": default_autotest, "Report": None, }, + { + "Name": "Bitratestats autotest", + "Command": "bitratestats_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Latencystats autotest", + "Command": "latencystats_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Pdump autotest", + "Comamnd": "pdump_autotest", + "Func": default_autotest, + "Report": None, + }, # #Please always keep all dump tests at the end and together! #
Signature · 1 line
2.13.6
PATCH v12 6/6 maintainers: add bitrate latency pdump tests
In reply to Naga Suresh SomarowthuUpdate MAINTAINERSHIP for bitrate, latency, pdump unit tests and sample packet helper functions for unit test.
--- MAINTAINERS | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
MAINTAINERS +9 -1
@@ -1018,7 +1018,8 @@ F: lib/librte_pdump/ F: doc/guides/prog_guide/pdump_lib.rst F: app/pdump/ F: doc/guides/tools/pdump.rst - +F: test/test/test_pdump.c +F: test/test/test_pdump.h Packet Framework ----------------
@@ -1144,10 +1145,12 @@ F: lib/librte_metrics/ Bit-rate statistics M: Remy Horton <[email protected]> F: lib/librte_bitratestats/ +F: test/test/test_bitratestats.c Latency statistics M: Reshma Pattan <[email protected]> F: lib/librte_latencystats/ +F: test/test/test_latencystats.c BPF - EXPERIMENTAL M: Konstantin Ananyev <[email protected]>
@@ -1176,6 +1179,11 @@ F: test/test/test_resource.c F: test/test/virtual_pmd.c F: test/test/virtual_pmd.h +Sample packet helper functions for unit test +M: Reshma Pattan <[email protected]> +F: test/test/sample_packet_forward.c +F: test/test/sample_packet_forward.h + Driver testing tool M: Wenzhuo Lu <[email protected]> M: Jingjing Wu <[email protected]>
Signature · 1 line
2.13.6
v13 cover add unit tests for bitrate, latency and pdump libraries
In reply to Naga Suresh SomarowthuFrom: Naga Suresh Somarowthu <[email protected]>
1/4: add helper functions for tests using ring-PMD Rx/Tx 2/4: unit test cases added for bitrate library 3/4: unit test cases added for latencystats library 4/4: unit test cases added for pdump library
Patches 2/4, 3/4 and 4/4 depends on 1/4
---
v13: added required changes for meson build
updated respective patches
updated the headers as per IWYU
v12: corrected commit message for pdump unit test
v11: fixed compilation issue in centos and 32bit arch
removed memzone free as per fix in the latency library
and updated the maintainers file
v10: fixed clang compiler issues and freed latency stats memzone in latency stats unit tests.
v9: rebased ontop of latest autotest changes and added new tests to the autotest list
v8: renamed commit headline and freed the metrics memzone for bitrate ut
v7: removed unused macros and corrected the comment
v6: updated ring variable appropriately
v5: rebased, freed pools and rings, created common patch set
---
Naga Suresh Somarowthu (6):
test: add helper functions for tests using ring-PMD Rx/Tx
test: add unit tests for bitrate library
test: add unit tests for latencystats library
test: add unit test for pdump library
MAINTAINERS | 10 +- test/test/Makefile | 9 ++ test/test/autotest_data.py | 18 +++ test/test/meson.build | 10 ++ test/test/process.h | 13 +++ test/test/sample_packet_forward.c | 114 +++++++++++++++++++ test/test/sample_packet_forward.h | 46 ++++++++ test/test/test.c | 2 + test/test/test_bitratestats.c | 226 ++++++++++++++++++++++++++++++++++++++ test/test/test_latencystats.c | 224 +++++++++++++++++++++++++++++++++++++ test/test/test_pdump.c | 219 ++++++++++++++++++++++++++++++++++++ test/test/test_pdump.h | 31 ++++++ 12 files changed, 921 insertions(+), 1 deletion(-) create mode 100644 test/test/sample_packet_forward.c create mode 100644 test/test/sample_packet_forward.h create mode 100644 test/test/test_bitratestats.c create mode 100644 test/test/test_latencystats.c create mode 100644 test/test/test_pdump.c create mode 100644 test/test/test_pdump.h
Signature · 1 line
2.13.6
PATCH v13 1/4 test: add helper functions for tests using ring-PMD Rx/Tx
Added ring pmd based packet rx/tx helper functions for verifying Latency, Bitrate and pdump lib UTs.
--- MAINTAINERS | 5 ++ test/test/Makefile | 1 + test/test/meson.build | 1 + test/test/sample_packet_forward.c | 114 ++++++++++++++++++++++++++++++++++++++ test/test/sample_packet_forward.h | 46 +++++++++++++++ 5 files changed, 167 insertions(+) create mode 100644 test/test/sample_packet_forward.c create mode 100644 test/test/sample_packet_forward.h
MAINTAINERS +5 -0
@@ -1176,6 +1176,11 @@ F: test/test/test_resource.c F: test/test/virtual_pmd.c F: test/test/virtual_pmd.h +Sample packet helper functions for unit test +M: Reshma Pattan <[email protected]> +F: test/test/sample_packet_forward.c +F: test/test/sample_packet_forward.h + Driver testing tool M: Wenzhuo Lu <[email protected]> M: Jingjing Wu <[email protected]>
test/test/Makefile +1 -0
@@ -165,6 +165,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_REORDER) += test_reorder.c SRCS-y += virtual_pmd.c SRCS-y += packet_burst_generator.c +SRCS-y += sample_packet_forward.c SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y)
test/test/meson.build +1 -0
@@ -3,6 +3,7 @@ test_sources = files('commands.c', 'packet_burst_generator.c', + 'sample_packet_forward.c', 'test.c', 'test_acl.c', 'test_alarm.c',
test/test/sample_packet_forward.c new file +114 -0
114 lines not on this page · raw message
test/test/sample_packet_forward.h new file +46 -0
46 lines not on this page · raw message
Signature · 1 line
2.13.6
PATCH v13 2/4 test: add unit tests for bitrate library
In reply to Naga Suresh SomarowthuUnit Test Cases for BitRate library.
--- MAINTAINERS | 1 + test/test/Makefile | 1 + test/test/autotest_data.py | 6 ++ test/test/meson.build | 4 + test/test/test_bitratestats.c | 226 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 238 insertions(+) create mode 100644 test/test/test_bitratestats.c
MAINTAINERS +1 -0
@@ -1144,6 +1144,7 @@ F: lib/librte_metrics/ Bit-rate statistics M: Remy Horton <[email protected]> F: lib/librte_bitratestats/ +F: test/test/test_bitratestats.c Latency statistics M: Reshma Pattan <[email protected]>
test/test/Makefile +1 -0
@@ -183,6 +183,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring_perf.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c +SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) += test_bitratestats.c ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
test/test/autotest_data.py +6 -0
@@ -482,6 +482,12 @@ "Func": default_autotest, "Report": None, }, + { + "Name": "Bitratestats autotest", + "Command": "bitratestats_autotest", + "Func": default_autotest, + "Report": None, + }, # #Please always keep all dump tests at the end and together! #
test/test/meson.build +4 -0
@@ -9,6 +9,7 @@ test_sources = files('commands.c', 'test_alarm.c', 'test_atomic.c', 'test_barrier.c', + 'test_bitratestats.c', 'test_bpf.c', 'test_byteorder.c', 'test_cmdline.c',
@@ -100,6 +101,7 @@ test_sources = files('commands.c', ) test_deps = ['acl', + 'bitratestats', 'bpf', 'cfgfile', 'cmdline',
@@ -112,6 +114,7 @@ test_deps = ['acl', 'hash', 'lpm', 'member', + 'metrics', 'pipeline', 'port', 'reorder',
@@ -124,6 +127,7 @@ test_names = [ 'alarm_autotest', 'atomic_autotest', 'barrier_autotest', + 'bitratestats_autotest', 'byteorder_autotest', 'cmdline_autotest', 'common_autotest',
test/test/test_bitratestats.c new file +226 -0
226 lines not on this page · raw message
Signature · 1 line
2.13.6
PATCH v13 3/4 test: add unit tests for latencystats library
In reply to Naga Suresh SomarowthuUnit Test Cases added for latencystats library.
--- MAINTAINERS | 1 + test/test/Makefile | 1 + test/test/autotest_data.py | 6 ++ test/test/meson.build | 3 + test/test/test_latencystats.c | 224 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 235 insertions(+) create mode 100644 test/test/test_latencystats.c
MAINTAINERS +1 -0
@@ -1149,6 +1149,7 @@ F: test/test/test_bitratestats.c Latency statistics M: Reshma Pattan <[email protected]> F: lib/librte_latencystats/ +F: test/test/test_latencystats.c BPF - EXPERIMENTAL M: Konstantin Ananyev <[email protected]>
test/test/Makefile +1 -0
@@ -184,6 +184,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) += test_bitratestats.c +SRCS-$(CONFIG_RTE_LIBRTE_LATENCY_STATS) += test_latencystats.c ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
test/test/autotest_data.py +6 -0
@@ -488,6 +488,12 @@ "Func": default_autotest, "Report": None, }, + { + "Name": "Latencystats autotest", + "Command": "latencystats_autotest", + "Func": default_autotest, + "Report": None, + }, # #Please always keep all dump tests at the end and together! #
test/test/meson.build +3 -0
@@ -47,6 +47,7 @@ test_sources = files('commands.c', 'test_interrupts.c', 'test_kni.c', 'test_kvargs.c', + 'test_latencystats.c', 'test_link_bonding.c', 'test_link_bonding_mode4.c', 'test_logs.c',
@@ -112,6 +113,7 @@ test_deps = ['acl', 'eventdev', 'flow_classify', 'hash', + 'latencystats', 'lpm', 'member', 'metrics',
@@ -170,6 +172,7 @@ test_names = [ 'interrupt_autotest', 'kni_autotest', 'kvargs_autotest', + 'latencystats_autotest', 'link_bonding_autotest', 'link_bonding_mode4_autotest', 'logs_autotest',
test/test/test_latencystats.c new file +224 -0
224 lines not on this page · raw message
Signature · 1 line
2.13.6
PATCH v13 4/4 test: add unit test for pdump library
In reply to Naga Suresh SomarowthuUnit test cases are added for pdump library.
Primary process will act as server, forks a child secondary process. Secondary process acts as client.
Server will do pdump init to serve any pdump client requests. Server will create a vdev, send/receive packets continuously in a separate thread.
Client will create virtual rings to receive the packet dump. Client sends pdump enable/disable requests using either port/device id. Packet flow direction can be tx/rx/tx&rx.
In Server, appropriate pdump callbacks are triggered,
when packets are transmitted/received.
Pdump packet is copied to client rings.
--- MAINTAINERS | 3 +- test/test/Makefile | 6 ++ test/test/autotest_data.py | 6 ++ test/test/meson.build | 2 + test/test/process.h | 13 +++ test/test/test.c | 2 + test/test/test_pdump.c | 219 +++++++++++++++++++++++++++++++++++++++++++++ test/test/test_pdump.h | 31 +++++++ 8 files changed, 281 insertions(+), 1 deletion(-) create mode 100644 test/test/test_pdump.c create mode 100644 test/test/test_pdump.h
MAINTAINERS +2 -1
@@ -1018,7 +1018,8 @@ F: lib/librte_pdump/ F: doc/guides/prog_guide/pdump_lib.rst F: app/pdump/ F: doc/guides/tools/pdump.rst - +F: test/test/test_pdump.c +F: test/test/test_pdump.h Packet Framework ----------------
test/test/Makefile +6 -0
@@ -185,6 +185,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) += test_bitratestats.c SRCS-$(CONFIG_RTE_LIBRTE_LATENCY_STATS) += test_latencystats.c +SRCS-$(CONFIG_RTE_LIBRTE_PDUMP) += test_pdump.c ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
@@ -214,6 +215,11 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -D_GNU_SOURCE LDLIBS += -lm + +ifeq ($(CONFIG_RTE_LIBRTE_PDUMP),y) +LDLIBS += -lpthread +endif + ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) ifeq ($(CONFIG_RTE_LIBRTE_COMPRESSDEV),y) LDLIBS += -lz
test/test/autotest_data.py +6 -0
@@ -494,6 +494,12 @@ "Func": default_autotest, "Report": None, }, + { + "Name": "Pdump autotest", + "Comamnd": "pdump_autotest", + "Func": default_autotest, + "Report": None, + }, # #Please always keep all dump tests at the end and together! #
test/test/meson.build +2 -0
@@ -67,6 +67,7 @@ test_sources = files('commands.c', 'test_memzone.c', 'test_meter.c', 'test_mp_secondary.c', + 'test_pdump.c', 'test_per_lcore.c', 'test_pmd_perf.c', 'test_pmd_ring.c',
@@ -192,6 +193,7 @@ test_names = [ 'memzone_autotest', 'meter_autotest', 'multiprocess_autotest', + 'pdump_autotest', 'per_lcore_autotest', 'pmd_perf_autotest', 'power_acpi_cpufreq_autotest',
test/test/process.h +13 -0
@@ -9,6 +9,7 @@#include <libgen.h> /* basename et al */ #include <stdlib.h> /* NULL */ #include <unistd.h> /* readlink */ +#include <sys/wait.h> #ifdef RTE_EXEC_ENV_BSDAPP #define self "curproc"
@@ -18,6 +19,10 @@#define exe "exe"#endif +#include <pthread.h> +extern void *send_pkts (void *empty); +extern uint16_t flag_for_send_pkts; +/* * launches a second copy of the test process using the given argv parameters, * which should include argv[0] as the process name. To identify in the
@@ -31,6 +36,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value)char *argv_cpy[numargs +1 ];int i, fd, status;char path[32 ]; +pthread_t thread;pid_t pid =fork ();if (pid <0 )
@@ -61,8 +67,15 @@ process_dup(const char *const argv[], int numargs, const char *env_value)rte_panic ("Cannot exec\n" ); }/* parent process does a wait */ +if ((strcmp (env_value,"run_pdump_server_tests" ) ==0 )) +pthread_create (&thread,NULL , &send_pkts,NULL ); +while (wait (&status) != pid) ; +if ((strcmp (env_value,"run_pdump_server_tests" ) ==0 )) { + flag_for_send_pkts =0 ; +pthread_join (thread,NULL ); + }return status; }
test/test/test.c +2 -0
@@ -30,6 +30,7 @@ extern cmdline_parse_ctx_t main_ctx[];#endif #include "test.h" +#include "test_pdump.h" #define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1
@@ -49,6 +50,7 @@ do_recursive_call(void)int (*action_fn)(void ); } actions[] = { { "run_secondary_instances", test_mp_secondary }, + { "run_pdump_server_tests", test_pdump }, { "test_missing_c_flag", no_action }, { "test_master_lcore_flag", no_action }, { "test_invalid_n_flag", no_action },
test/test/test_pdump.c new file +219 -0
219 lines not on this page · raw message
test/test/test_pdump.h new file +31 -0
@@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2018 Intel Corporation +*/ + +#ifndef _TEST_PDUMP_H_ +#define _TEST_PDUMP_H_ + +#define QUEUE_ID 0 +#define NUM_ITR 3 + +/* sample test to send packets to the pdump client recursively */ +void *send_pkts (void *port); + +/* Sample test to create setup for the pdump server tests */ +int test_pdump_init (void ); + +/* Sample test to teardown the pdump server setup */ +int test_pdump_uninit (void ); + +/* Sample test to run the pdump client tests */ +int run_pdump_client_tests (void ); + +/* Sample test to run the pdump server tests */ +int run_pdump_server_tests (void ); + +/* Sample test to run the pdump client and server tests based on +* the process type +*/ +int test_pdump (void ); + +#endif /* _TEST_PDUMP_H_ */
Signature · 1 line
2.13.6
Quoted 7 lines · Naga Suresh Somarowthu
1/6: add helper functions for tests using ring-PMD Rx/Tx 2/6: unit test cases added for bitrate library 3/6: unit test cases added for latencystats library 4/6: unit test cases added for pdump library 5/6: added new unit tests to autotest list
6/6: updated maintainers for bitrate latency pdump tests
Quoted 7 lines
Patches 2/6, 3/6 and 4/6 depends on 1/6
Signed-off-by Naga Suresh Somarowthu <[email protected]>Reviewed-by Reshma Pattan <[email protected]>Reviewed-by Remy Horton <[email protected]>Reviewed-by Anatoly Burakov <[email protected]>Acked-by Reshma Pattan <[email protected]>
The cover letter "reviewed-by" tags should only be used if someone replied with a series-ack. I did no such thing (did Remy?), i only really reviewed first patch out of the series. Please remove that line from the cover letter.
Signature · 2 lines
Thanks, Anatoly