From patchwork Fri Aug 3 12:34:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naga Suresh Somarowthu X-Patchwork-Id: 43556 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 065C21B572; Fri, 3 Aug 2018 14:35:34 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 5D5491B570 for ; Fri, 3 Aug 2018 14:35:32 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Aug 2018 05:35:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,438,1526367600"; d="scan'208";a="77059615" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga004.fm.intel.com with ESMTP; 03 Aug 2018 05:35:09 -0700 Received: from wgcvswdev001.ir.intel.com (wgcvswdev001.ir.intel.com [10.102.246.100]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w73CZ8B1003977; Fri, 3 Aug 2018 13:35:08 +0100 Received: from wgcvswdev001.ir.intel.com (localhost [127.0.0.1]) by wgcvswdev001.ir.intel.com with ESMTP id w73CZ5QQ021012; Fri, 3 Aug 2018 13:35:05 +0100 Received: (from jmparthx@localhost) by wgcvswdev001.ir.intel.com with ? id w73CZ5KZ021007; Fri, 3 Aug 2018 13:35:05 +0100 From: Naga Suresh Somarowthu To: dev@dpdk.org Cc: remy.horton@intel.com, reshma.pattan@intel.com, Naga Suresh Somarowthu Date: Fri, 3 Aug 2018 13:34:53 +0100 Message-Id: <1533299698-20950-2-git-send-email-naga.sureshx.somarowthu@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1533299698-20950-1-git-send-email-naga.sureshx.somarowthu@intel.com> References: <1533297953-9149-1-git-send-email-naga.sureshx.somarowthu@intel.com> <1533299698-20950-1-git-send-email-naga.sureshx.somarowthu@intel.com> Subject: [dpdk-dev] [PATCH v12 1/6] test: add helper functions for tests using ring-PMD Rx/Tx X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Added ring pmd based packet rx/tx helper functions for verifying Latency, Bitrate and pdump lib UTs. Signed-off-by: Naga Suresh Somarowthu Reviewed-by: Reshma Pattan Reviewed-by: Anatoly Burakov --- 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 diff --git a/test/test/Makefile b/test/test/Makefile index e6967bab6..9f7d398e4 100644 --- a/test/test/Makefile +++ b/test/test/Makefile @@ -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) diff --git a/test/test/sample_packet_forward.c b/test/test/sample_packet_forward.c new file mode 100644 index 000000000..3822577b9 --- /dev/null +++ b/test/test/sample_packet_forward.c @@ -0,0 +1,115 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Intel Corporation + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "sample_packet_forward.h" +#include "test.h" + +/* Sample test to create virtual rings and tx,rx portid from rings */ +int +test_ring_setup(struct rte_ring **ring, uint16_t *portid) +{ + *ring = rte_ring_create("R0", RING_SIZE, rte_socket_id(), + RING_F_SP_ENQ | RING_F_SC_DEQ); + if (*ring == NULL) { + printf("%s() line %u: rte_ring_create R0 failed", + __func__, __LINE__); + return -1; + } + *portid = rte_eth_from_rings("net_ringa", ring, NUM_QUEUES, + ring, NUM_QUEUES, rte_socket_id()); + + return 0; +} + +/* Sample test to free the mempool */ +void +test_mp_free(struct rte_mempool *mp) +{ + rte_mempool_free(mp); +} + +/* Sample test to free the virtual rings */ +void +test_ring_free(struct rte_ring *rxtx) +{ + rte_ring_free(rxtx); +} + +/* Sample test to release the vdev */ +void +test_vdev_uninit(const char *vdev) +{ + rte_vdev_uninit(vdev); +} + +/* sample test to allocate the mempool */ +int +test_get_mempool(struct rte_mempool **mp, char *poolname) +{ + *mp = rte_pktmbuf_pool_create(poolname, NB_MBUF, 32, 0, + RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id()); + if (*mp == NULL) + return -1; + return 0; +} + +/* sample test to allocate buffer for pkts */ +int +test_get_mbuf_from_pool(struct rte_mempool **mp, struct rte_mbuf **pbuf, + char *poolname) +{ + int ret = 0; + + ret = test_get_mempool(mp, poolname); + if (ret < 0) + return -1; + if (rte_pktmbuf_alloc_bulk(*mp, pbuf, NUM_PACKETS) != 0) { + printf("%s() line %u: rte_pktmbuf_alloc_bulk failed", __func__, + __LINE__); + return -1; + } + return 0; +} + +/* sample test to deallocate the allocated buffers and mempool */ +void +test_put_mbuf_to_pool(struct rte_mempool *mp, struct rte_mbuf **pbuf) +{ + int itr = 0; + + for (itr = 0; itr < NUM_PACKETS; itr++) + rte_pktmbuf_free(pbuf[itr]); + rte_mempool_free(mp); +} + +/* Sample test to forward packets using virtual portids */ +int +test_packet_forward(struct rte_mbuf **pbuf, uint16_t portid, uint16_t queue_id) +{ + /* send and receive packet and check for stats update */ + if (rte_eth_tx_burst(portid, queue_id, pbuf, NUM_PACKETS) + < NUM_PACKETS) { + printf("%s() line %u: Error sending packet to" + " port %d\n", __func__, __LINE__, portid); + return -1; + } + if (rte_eth_rx_burst(portid, queue_id, pbuf, NUM_PACKETS) + < NUM_PACKETS) { + printf("%s() line %u: Error receiving packet from" + " port %d\n", __func__, __LINE__, portid); + return -1; + } + return 0; +} diff --git a/test/test/sample_packet_forward.h b/test/test/sample_packet_forward.h new file mode 100644 index 000000000..433bd3ba2 --- /dev/null +++ b/test/test/sample_packet_forward.h @@ -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_ */ From patchwork Fri Aug 3 12:34:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naga Suresh Somarowthu X-Patchwork-Id: 43555 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3663C1B56A; Fri, 3 Aug 2018 14:35:31 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 8B9261B561 for ; Fri, 3 Aug 2018 14:35:29 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Aug 2018 05:35:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,438,1526367600"; d="scan'208";a="62121382" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga008.jf.intel.com with ESMTP; 03 Aug 2018 05:35:10 -0700 Received: from wgcvswdev001.ir.intel.com (wgcvswdev001.ir.intel.com [10.102.246.100]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w73CZArG004030; Fri, 3 Aug 2018 13:35:10 +0100 Received: from wgcvswdev001.ir.intel.com (localhost [127.0.0.1]) by wgcvswdev001.ir.intel.com with ESMTP id w73CZ6Vd021019; Fri, 3 Aug 2018 13:35:06 +0100 Received: (from jmparthx@localhost) by wgcvswdev001.ir.intel.com with ? id w73CZ6SF021015; Fri, 3 Aug 2018 13:35:06 +0100 From: Naga Suresh Somarowthu To: dev@dpdk.org Cc: remy.horton@intel.com, reshma.pattan@intel.com, Naga Suresh Somarowthu Date: Fri, 3 Aug 2018 13:34:54 +0100 Message-Id: <1533299698-20950-3-git-send-email-naga.sureshx.somarowthu@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1533299698-20950-1-git-send-email-naga.sureshx.somarowthu@intel.com> References: <1533297953-9149-1-git-send-email-naga.sureshx.somarowthu@intel.com> <1533299698-20950-1-git-send-email-naga.sureshx.somarowthu@intel.com> Subject: [dpdk-dev] [PATCH v12 2/6] test: add unit tests for bitrate library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Unit Test Cases for BitRate library. Signed-off-by: Naga Suresh Somarowthu Reviewed-by: Reshma Pattan Reviewed-by: Remy Horton --- test/test/Makefile | 1 + test/test/test_bitratestats.c | 229 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 230 insertions(+) create mode 100644 test/test/test_bitratestats.c diff --git a/test/test/Makefile b/test/test/Makefile index 9f7d398e4..c619877f0 100644 --- a/test/test/Makefile +++ b/test/test/Makefile @@ -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 diff --git a/test/test/test_bitratestats.c b/test/test/test_bitratestats.c new file mode 100644 index 000000000..38f7da4b5 --- /dev/null +++ b/test/test/test_bitratestats.c @@ -0,0 +1,229 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Intel Corporation + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "test.h" +#include "sample_packet_forward.h" + +#define BIT_NUM_PACKETS 10 +#define QUEUE_ID 0 + +uint16_t portid; +struct rte_stats_bitrates *bitrate_data; +struct rte_ring *ring; + +/* To test whether rte_stats_bitrate_create is successful */ +static int +test_stats_bitrate_create(void) +{ + bitrate_data = rte_stats_bitrate_create(); + TEST_ASSERT(bitrate_data != NULL, "rte_stats_bitrate_create failed"); + + return TEST_SUCCESS; +} + +/* To test bit rate registration */ +static int +test_stats_bitrate_reg(void) +{ + int ret = 0; + + /* Test to register bit rate without metrics init */ + ret = rte_stats_bitrate_reg(bitrate_data); + TEST_ASSERT(ret < 0, "Test Failed: rte_stats_bitrate_reg succeeded " + "without metrics init, ret:%d", ret); + + /* Metrics initialization */ + rte_metrics_init(rte_socket_id()); + /* Test to register bit rate after metrics init */ + ret = rte_stats_bitrate_reg(bitrate_data); + TEST_ASSERT((ret >= 0), "Test Failed: rte_stats_bitrate_reg %d", ret); + + return TEST_SUCCESS; +} + +/* To test the bit rate registration with invalid pointer */ +static int +test_stats_bitrate_reg_invalidpointer(void) +{ + int ret = 0; + + ret = rte_stats_bitrate_reg(NULL); + TEST_ASSERT(ret < 0, "Test Failed: Expected failure < 0 but " + "got %d", ret); + + return TEST_SUCCESS; +} + +/* To test bit rate calculation with invalid bit rate data pointer */ +static int +test_stats_bitrate_calc_invalid_bitrate_data(void) +{ + int ret = 0; + + ret = rte_stats_bitrate_calc(NULL, portid); + TEST_ASSERT(ret < 0, "Test Failed: rte_stats_bitrate_calc " + "ret:%d", ret); + + return TEST_SUCCESS; +} + +/* To test the bit rate calculation with invalid portid + * (higher than max ports) + */ +static int +test_stats_bitrate_calc_invalid_portid_1(void) +{ + int ret = 0; + + ret = rte_stats_bitrate_calc(bitrate_data, 33); + TEST_ASSERT(ret == -EINVAL, "Test Failed: Expected -%d for higher " + "portid rte_stats_bitrate_calc ret:%d", EINVAL, ret); + + return TEST_SUCCESS; +} + +/* To test the bit rate calculation with invalid portid (lesser than 0) */ +static int +test_stats_bitrate_calc_invalid_portid_2(void) +{ + int ret = 0; + + ret = rte_stats_bitrate_calc(bitrate_data, -1); + TEST_ASSERT(ret == -EINVAL, "Test Failed: Expected -%d for invalid " + "portid rte_stats_bitrate_calc ret:%d", EINVAL, ret); + + return TEST_SUCCESS; +} + +/* To test the bit rate calculation with non-existing portid */ +static int +test_stats_bitrate_calc_non_existing_portid(void) +{ + int ret = 0; + + ret = rte_stats_bitrate_calc(bitrate_data, 31); + TEST_ASSERT(ret == -EINVAL, "Test Failed: Expected -%d for " + "non-existing portid rte_stats_bitrate_calc ret:%d", + EINVAL, ret); + + return TEST_SUCCESS; +} + +/* To test the bit rate calculation with valid bit rate data, valid portid */ +static int +test_stats_bitrate_calc(void) +{ + int ret = 0; + + ret = rte_stats_bitrate_calc(bitrate_data, portid); + TEST_ASSERT(ret >= 0, "Test Failed: Expected >=0 for valid portid " + "rte_stats_bitrate_calc ret:%d", ret); + + return TEST_SUCCESS; +} + +static int +test_bit_packet_forward(void) +{ + int ret; + struct rte_mbuf *pbuf[BIT_NUM_PACKETS] = { }; + struct rte_mempool *mp; + char poolname[] = "mbuf_pool"; + ret = test_get_mbuf_from_pool(&mp, pbuf, poolname); + if (ret < 0) { + printf("allocate mbuf pool Failed\n"); + return TEST_FAILED; + } + ret = test_packet_forward(pbuf, portid, QUEUE_ID); + if (ret < 0) + printf("send pkts Failed\n"); + test_put_mbuf_to_pool(mp, pbuf); + + return TEST_SUCCESS; +} + +static int +test_bit_ring_setup(void) +{ + test_ring_setup(&ring, &portid); + printf("port in ring setup : %d\n", portid); + + return TEST_SUCCESS; +} + +static void +test_bit_ring_free(void) +{ + test_ring_free(ring); + test_vdev_uninit("net_ring_net_ringa"); + rte_memzone_free(rte_memzone_lookup("RTE_METRICS")); +} + +static struct +unit_test_suite bitratestats_testsuite = { + .suite_name = "BitRate Stats Unit Test Suite", + .setup = test_bit_ring_setup, + .teardown = test_bit_ring_free, + .unit_test_cases = { + /* TEST CASE 1: Test to create bit rate data */ + TEST_CASE(test_stats_bitrate_create), + + /* TEST CASE 2: Test to register bit rate metrics + * without metrics init and after metrics init + */ + TEST_CASE(test_stats_bitrate_reg), + + /* TEST CASE 3: Test to register bit rate metrics + * with invalid bit rate data + */ + TEST_CASE(test_stats_bitrate_reg_invalidpointer), + + /* TEST CASE 4: Test to calculate bit rate data metrics + * with invalid bit rate data + */ + TEST_CASE(test_stats_bitrate_calc_invalid_bitrate_data), + + /* TEST CASE 5: Test to calculate bit rate data metrics + * with portid exceeding the max ports + */ + TEST_CASE(test_stats_bitrate_calc_invalid_portid_1), + + /* TEST CASE 6: Test to calculate bit rate data metrics + * with portid less than 0 + */ + TEST_CASE(test_stats_bitrate_calc_invalid_portid_2), + + /* TEST CASE 7: Test to calculate bit rate data metrics + * with non-existing portid + */ + TEST_CASE(test_stats_bitrate_calc_non_existing_portid), + + /* TEST CASE 8: Test to calculate bit rate data metrics + * with valid portid, valid bit rate data + */ + TEST_CASE_ST(test_bit_packet_forward, NULL, + test_stats_bitrate_calc), + TEST_CASES_END() + } +}; + +static int +test_bitratestats(void) +{ + return unit_test_suite_runner(&bitratestats_testsuite); +} +REGISTER_TEST_COMMAND(bitratestats_autotest, test_bitratestats); From patchwork Fri Aug 3 12:34:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naga Suresh Somarowthu X-Patchwork-Id: 43558 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B577F1B560; Fri, 3 Aug 2018 14:39:38 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 6F6B2493D for ; Fri, 3 Aug 2018 14:39:34 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Aug 2018 05:39:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,438,1526367600"; d="scan'208";a="80238792" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 03 Aug 2018 05:39:32 -0700 Received: from wgcvswdev001.ir.intel.com (wgcvswdev001.ir.intel.com [10.102.246.100]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w73CZBsa004083; Fri, 3 Aug 2018 13:35:11 +0100 Received: from wgcvswdev001.ir.intel.com (localhost [127.0.0.1]) by wgcvswdev001.ir.intel.com with ESMTP id w73CZ8hb021026; Fri, 3 Aug 2018 13:35:08 +0100 Received: (from jmparthx@localhost) by wgcvswdev001.ir.intel.com with ? id w73CZ835021022; Fri, 3 Aug 2018 13:35:08 +0100 From: Naga Suresh Somarowthu To: dev@dpdk.org Cc: remy.horton@intel.com, reshma.pattan@intel.com, Naga Suresh Somarowthu Date: Fri, 3 Aug 2018 13:34:55 +0100 Message-Id: <1533299698-20950-4-git-send-email-naga.sureshx.somarowthu@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1533299698-20950-1-git-send-email-naga.sureshx.somarowthu@intel.com> References: <1533297953-9149-1-git-send-email-naga.sureshx.somarowthu@intel.com> <1533299698-20950-1-git-send-email-naga.sureshx.somarowthu@intel.com> Subject: [dpdk-dev] [PATCH v12 3/6] test: add unit tests for latencystats library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Unit Test Cases added for latencystats library. Signed-off-by: Naga Suresh Somarowthu Reviewed-by: Reshma Pattan --- test/test/Makefile | 1 + test/test/test_latencystats.c | 226 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 227 insertions(+) create mode 100644 test/test/test_latencystats.c diff --git a/test/test/Makefile b/test/test/Makefile index c619877f0..bba3be1be 100644 --- a/test/test/Makefile +++ b/test/test/Makefile @@ -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 diff --git a/test/test/test_latencystats.c b/test/test/test_latencystats.c new file mode 100644 index 000000000..82433033e --- /dev/null +++ b/test/test/test_latencystats.c @@ -0,0 +1,226 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Intel Corporation + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include "test.h" +#include "sample_packet_forward.h" +#define NUM_STATS 4 +#define LATENCY_NUM_PACKETS 10 +#define QUEUE_ID 0 + +uint16_t portid; +struct rte_ring *ring; + +struct rte_metric_name lat_stats_strings[] = { + {"min_latency_ns"}, + {"avg_latency_ns"}, + {"max_latency_ns"}, + {"jitter_ns"}, +}; + +/* Test case for latency init with metrics init */ +static int test_latency_init(void) +{ + int ret = 0; + + /* Metrics Initialization */ + rte_metrics_init(rte_socket_id()); + + ret = rte_latencystats_init(1, NULL); + TEST_ASSERT(ret >= 0, "Test Failed: rte_latencystats_init failed"); + + return TEST_SUCCESS; +} + +/* Test case to update the latency stats */ +static int test_latency_update(void) +{ + int ret = 0; + + ret = rte_latencystats_update(); + TEST_ASSERT(ret >= 0, "Test Failed: rte_latencystats_update failed"); + + return TEST_SUCCESS; +} + +/* Test case to uninit latency stats */ +static int test_latency_uninit(void) +{ + int ret = 0; + + ret = rte_latencystats_uninit(); + TEST_ASSERT(ret >= 0, "Test Failed: rte_latencystats_uninit failed"); + + return TEST_SUCCESS; +} + +/* Test case to get names of latency stats */ +static int test_latencystats_get_names(void) +{ + int ret = 0, i = 0; + int size = 0; + struct rte_metric_name names[NUM_STATS]; + struct rte_metric_name wrongnames[NUM_STATS - 2]; + + size_t m_size = sizeof(struct rte_metric_name); + for (i = 0; i < NUM_STATS; i++) + memset(&names[i], 0, m_size); + for (i = 0; i < NUM_STATS - 2; i++) + memset(&wrongnames[i], 0, m_size); + + /* Success Test: Valid names and size */ + size = NUM_STATS; + ret = rte_latencystats_get_names(names, size); + for (i = 0; i <= NUM_STATS; i++) { + if (strcmp(lat_stats_strings[i].name, names[i].name) == 0) + printf(" %s\n", names[i].name); + else + printf("Failed: Names are not matched\n"); + } + TEST_ASSERT((ret == NUM_STATS), "Test Failed to get metrics names"); + + /* Failure Test: Invalid names and valid size */ + ret = rte_latencystats_get_names(NULL, size); + TEST_ASSERT((ret == NUM_STATS), "Test Failed to get the metrics count," + "Actual: %d Expected: %d", ret, NUM_STATS); + + /* Failure Test: Valid names and invalid size */ + size = 0; + ret = rte_latencystats_get_names(names, size); + TEST_ASSERT((ret == NUM_STATS), "Test Failed to get the metrics count," + "Actual: %d Expected: %d", ret, NUM_STATS); + + /* Failure Test: Invalid names (array size lesser than size) */ + size = NUM_STATS + 1; + ret = rte_latencystats_get_names(wrongnames, size); + TEST_ASSERT((ret == NUM_STATS), "Test Failed to get metrics names"); + return TEST_SUCCESS; +} + +/* Test case to get latency stats values */ +static int test_latencystats_get(void) +{ + int ret = 0, i = 0; + int size = 0; + struct rte_metric_value values[NUM_STATS]; + struct rte_metric_value wrongvalues[NUM_STATS - 2]; + + size_t v_size = sizeof(struct rte_metric_value); + for (i = 0; i < NUM_STATS; i++) + memset(&values[i], 0, v_size); + for (i = 0; i < NUM_STATS - 2; i++) + memset(&wrongvalues[i], 0, v_size); + + /* Success Test: Valid values and valid size */ + size = NUM_STATS; + ret = rte_latencystats_get(values, size); + TEST_ASSERT((ret == NUM_STATS), "Test Failed to get latency metrics" + " values"); + + /* Failure Test: Invalid values and valid size */ + ret = rte_latencystats_get(NULL, size); + TEST_ASSERT((ret == NUM_STATS), "Test Failed to get the stats count," + "Actual: %d Expected: %d", ret, NUM_STATS); + + /* Failure Test: Valid values and invalid size */ + size = 0; + ret = rte_latencystats_get(values, size); + TEST_ASSERT((ret == NUM_STATS), "Test Failed to get the stats count," + "Actual: %d Expected: %d", ret, NUM_STATS); + + /* Failure Test: Invalid values(array size lesser than size) + * and invalid size + */ + size = NUM_STATS + 2; + ret = rte_latencystats_get(wrongvalues, size); + TEST_ASSERT(ret == NUM_STATS, "Test Failed to get latency metrics" + " values"); + + return TEST_SUCCESS; +} + +static int test_latency_ring_setup(void) +{ + test_ring_setup(&ring, &portid); + + return TEST_SUCCESS; +} + +static void test_latency_ring_free(void) +{ + test_ring_free(ring); + test_vdev_uninit("net_ring_net_ringa"); +} + +static int test_latency_packet_forward(void) +{ + int ret; + struct rte_mbuf *pbuf[LATENCY_NUM_PACKETS] = { }; + struct rte_mempool *mp; + char poolname[] = "mbuf_pool"; + + ret = test_get_mbuf_from_pool(&mp, pbuf, poolname); + if (ret < 0) { + printf("allocate mbuf pool Failed\n"); + return TEST_FAILED; + } + ret = test_packet_forward(pbuf, portid, QUEUE_ID); + if (ret < 0) + printf("send pkts Failed\n"); + test_put_mbuf_to_pool(mp, pbuf); + + return TEST_SUCCESS; +} + +static struct +unit_test_suite latencystats_testsuite = { + .suite_name = "Latency Stats Unit Test Suite", + .setup = test_latency_ring_setup, + .teardown = test_latency_ring_free, + .unit_test_cases = { + + /* Test Case 1: To check latency init with + * metrics init + */ + TEST_CASE_ST(NULL, NULL, test_latency_init), + + /* Test Case 2: Do packet forwarding for metrics + * calculation and check the latency metrics values + * are updated + */ + TEST_CASE_ST(test_latency_packet_forward, NULL, + test_latency_update), + /* Test Case 3: To check whether latency stats names + * are retrieved + */ + TEST_CASE_ST(NULL, NULL, test_latencystats_get_names), + + /* Test Case 4: To check whether latency stats + * values are retrieved + */ + TEST_CASE_ST(NULL, NULL, test_latencystats_get), + + /* Test Case 5: To check uninit of latency test */ + TEST_CASE_ST(NULL, NULL, test_latency_uninit), + + TEST_CASES_END() + } +}; + +static int test_latencystats(void) +{ + return unit_test_suite_runner(&latencystats_testsuite); +} + +REGISTER_TEST_COMMAND(latencystats_autotest, test_latencystats); From patchwork Fri Aug 3 12:34:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naga Suresh Somarowthu X-Patchwork-Id: 43559 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E7E9D1B56E; Fri, 3 Aug 2018 14:39:40 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 9AFFF1B558 for ; Fri, 3 Aug 2018 14:39:35 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Aug 2018 05:39:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,438,1526367600"; d="scan'208";a="80238802" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 03 Aug 2018 05:39:34 -0700 Received: from wgcvswdev001.ir.intel.com (wgcvswdev001.ir.intel.com [10.102.246.100]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w73CZCO7004133; Fri, 3 Aug 2018 13:35:12 +0100 Received: from wgcvswdev001.ir.intel.com (localhost [127.0.0.1]) by wgcvswdev001.ir.intel.com with ESMTP id w73CZ9vt021034; Fri, 3 Aug 2018 13:35:09 +0100 Received: (from jmparthx@localhost) by wgcvswdev001.ir.intel.com with ? id w73CZ9q7021030; Fri, 3 Aug 2018 13:35:09 +0100 From: Naga Suresh Somarowthu To: dev@dpdk.org Cc: remy.horton@intel.com, reshma.pattan@intel.com, Naga Suresh Somarowthu Date: Fri, 3 Aug 2018 13:34:56 +0100 Message-Id: <1533299698-20950-5-git-send-email-naga.sureshx.somarowthu@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1533299698-20950-1-git-send-email-naga.sureshx.somarowthu@intel.com> References: <1533297953-9149-1-git-send-email-naga.sureshx.somarowthu@intel.com> <1533299698-20950-1-git-send-email-naga.sureshx.somarowthu@intel.com> Subject: [dpdk-dev] [PATCH v12 4/6] test: add unit test for pdump library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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. Signed-off-by: Naga Suresh Somarowthu Reviewed-by: Reshma Pattan --- 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 diff --git a/test/test/Makefile b/test/test/Makefile index bba3be1be..3e7baef76 100644 --- a/test/test/Makefile +++ b/test/test/Makefile @@ -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 diff --git a/test/test/process.h b/test/test/process.h index ba3a18502..c015c9030 100644 --- a/test/test/process.h +++ b/test/test/process.h @@ -18,6 +18,10 @@ #define exe "exe" #endif +#include +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; } diff --git a/test/test/test.c b/test/test/test.c index 44dfe20ef..a54b0d142 100644 --- a/test/test/test.c +++ b/test/test/test.c @@ -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 }, diff --git a/test/test/test_pdump.c b/test/test/test_pdump.c new file mode 100644 index 000000000..cfdda4d39 --- /dev/null +++ b/test/test/test_pdump.c @@ -0,0 +1,232 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Intel Corporation + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "test.h" +#include "sample_packet_forward.h" +#include "test_pdump.h" +#include "process.h" + +#define launch_p(ARGV) process_dup(ARGV, \ + sizeof(ARGV)/(sizeof(ARGV[0])), __func__) + +struct rte_ring *ring_server; +uint16_t portid; +uint16_t flag_for_send_pkts = 1; + +int +test_pdump_init(void) +{ + int ret = 0; + + ret = rte_pdump_init(NULL); + if (ret < 0) { + printf("rte_pdump_init failed\n"); + return -1; + } + ret = test_ring_setup(&ring_server, &portid); + if (ret < 0) { + printf("test_ring_setup failed\n"); + return -1; + } + printf("pdump_init success\n"); + return ret; +} + +int +run_pdump_client_tests(void) +{ + int flags = RTE_PDUMP_FLAG_TX, ret = 0, itr; + char deviceid[] = "net_ring_net_ringa"; + struct rte_ring *ring_client; + struct rte_mempool *mp = NULL; + struct rte_eth_dev *eth_dev = NULL; + char poolname[] = "mbuf_pool_client"; + + ret = test_get_mempool(&mp, poolname); + if (ret < 0) + return -1; + mp->flags = 0x0000; + ring_client = rte_ring_create("SR0", RING_SIZE, rte_socket_id(), + RING_F_SP_ENQ | RING_F_SC_DEQ); + if (ring_client == NULL) { + printf("rte_ring_create SR0 failed"); + return -1; + } + + eth_dev = rte_eth_dev_attach_secondary(deviceid); + if (!eth_dev) { + printf("Failed to probe %s", deviceid); + return -1; + } + rte_eth_dev_probing_finish(eth_dev); + + ring_client->prod.single = 0; + ring_client->cons.single = 0; + + printf("\n***** flags = RTE_PDUMP_FLAG_TX *****\n"); + + for (itr = 0; itr < NUM_ITR; itr++) { + ret = rte_pdump_enable(portid, QUEUE_ID, flags, ring_client, + mp, NULL); + if (ret < 0) { + printf("rte_pdump_enable failed\n"); + return -1; + } + printf("pdump_enable success\n"); + + ret = rte_pdump_disable(portid, QUEUE_ID, flags); + if (ret < 0) { + printf("rte_pdump_disable failed\n"); + return -1; + } + printf("pdump_disable success\n"); + + ret = rte_pdump_enable_by_deviceid(deviceid, QUEUE_ID, flags, + ring_client, mp, NULL); + if (ret < 0) { + printf("rte_pdump_enable_by_deviceid failed\n"); + return -1; + } + printf("pdump_enable_by_deviceid success\n"); + + ret = rte_pdump_disable_by_deviceid(deviceid, QUEUE_ID, flags); + if (ret < 0) { + printf("rte_pdump_disable_by_deviceid failed\n"); + return -1; + } + printf("pdump_disable_by_deviceid success\n"); + + if (itr == 0) { + flags = RTE_PDUMP_FLAG_RX; + printf("\n***** flags = RTE_PDUMP_FLAG_RX *****\n"); + } else if (itr == 1) { + flags = RTE_PDUMP_FLAG_RXTX; + printf("\n***** flags = RTE_PDUMP_FLAG_RXTX *****\n"); + } + } + if (ring_client != NULL) + test_ring_free(ring_client); + if (mp != NULL) + test_mp_free(mp); + + return ret; +} + +int +test_pdump_uninit(void) +{ + int ret = 0; + + ret = rte_pdump_uninit(); + if (ret < 0) { + printf("rte_pdump_uninit failed\n"); + return -1; + } + if (ring_server != NULL) + test_ring_free(ring_server); + printf("pdump_uninit success\n"); + test_vdev_uninit("net_ring_net_ringa"); + return ret; +} + +void * +send_pkts(void *empty) +{ + int ret = 0; + struct rte_mbuf *pbuf[NUM_PACKETS] = { }; + struct rte_mempool *mp; + char poolname[] = "mbuf_pool_server"; + + ret = test_get_mbuf_from_pool(&mp, pbuf, poolname); + if (ret < 0) + printf("get_mbuf_from_pool failed\n"); + do { + ret = test_packet_forward(pbuf, portid, QUEUE_ID); + if (ret < 0) + printf("send pkts Failed\n"); + } while (flag_for_send_pkts); + test_put_mbuf_to_pool(mp, pbuf); + return empty; +} + +/* + * This function is called in the primary i.e. main test, to spawn off secondary + * processes to run actual mp tests. Uses fork() and exec pair + */ + +int +run_pdump_server_tests(void) +{ + int ret = 0; + char coremask[10]; + +#ifdef RTE_EXEC_ENV_LINUXAPP + char tmp[PATH_MAX] = { 0 }; + char prefix[PATH_MAX] = { 0 }; + + get_current_prefix(tmp, sizeof(tmp)); + snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp); +#else + const char *prefix = ""; +#endif + + /* good case, using secondary */ + const char *const argv1[] = { + prgname, "-c", coremask, "--proc-type=secondary", + prefix + }; + + snprintf(coremask, sizeof(coremask), "%x", + (1 << rte_get_master_lcore())); + + ret = test_pdump_init(); + ret |= launch_p(argv1); + ret |= test_pdump_uninit(); + return ret; +} + +int +test_pdump(void) +{ + int ret = 0; + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + printf("IN PRIMARY PROCESS\n"); + ret = run_pdump_server_tests(); + if (ret < 0) + return TEST_FAILED; + } else if (rte_eal_process_type() == RTE_PROC_SECONDARY) { + printf("IN SECONDARY PROCESS\n"); + sleep(5); + ret = run_pdump_client_tests(); + if (ret < 0) + return TEST_FAILED; + } + return TEST_SUCCESS; +} + +REGISTER_TEST_COMMAND(pdump_autotest, test_pdump); diff --git a/test/test/test_pdump.h b/test/test/test_pdump.h new file mode 100644 index 000000000..abef9a85e --- /dev/null +++ b/test/test/test_pdump.h @@ -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_ */ From patchwork Fri Aug 3 12:34:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naga Suresh Somarowthu X-Patchwork-Id: 43553 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BE2BB1B557; Fri, 3 Aug 2018 14:35:18 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 1D43A1B546 for ; Fri, 3 Aug 2018 14:35:16 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Aug 2018 05:35:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,438,1526367600"; d="scan'208";a="250839899" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga005.fm.intel.com with ESMTP; 03 Aug 2018 05:35:14 -0700 Received: from wgcvswdev001.ir.intel.com (wgcvswdev001.ir.intel.com [10.102.246.100]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w73CZEIZ004199; Fri, 3 Aug 2018 13:35:14 +0100 Received: from wgcvswdev001.ir.intel.com (localhost [127.0.0.1]) by wgcvswdev001.ir.intel.com with ESMTP id w73CZAms021045; Fri, 3 Aug 2018 13:35:10 +0100 Received: (from jmparthx@localhost) by wgcvswdev001.ir.intel.com with ? id w73CZApa021041; Fri, 3 Aug 2018 13:35:10 +0100 From: Naga Suresh Somarowthu To: dev@dpdk.org Cc: remy.horton@intel.com, reshma.pattan@intel.com, Naga Suresh Somarowthu Date: Fri, 3 Aug 2018 13:34:57 +0100 Message-Id: <1533299698-20950-6-git-send-email-naga.sureshx.somarowthu@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1533299698-20950-1-git-send-email-naga.sureshx.somarowthu@intel.com> References: <1533297953-9149-1-git-send-email-naga.sureshx.somarowthu@intel.com> <1533299698-20950-1-git-send-email-naga.sureshx.somarowthu@intel.com> Subject: [dpdk-dev] [PATCH v12 5/6] autotest: add new unit tests to autotest list X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" added bitrate, latency and pdump lib unit tests to autotest list. Signed-off-by: Naga Suresh Somarowthu Reviewed-by: Reshma Pattan --- test/test/autotest_data.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/test/autotest_data.py b/test/test/autotest_data.py index f68d9b111..9a54d0c04 100644 --- a/test/test/autotest_data.py +++ b/test/test/autotest_data.py @@ -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! # From patchwork Fri Aug 3 12:34:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naga Suresh Somarowthu X-Patchwork-Id: 43554 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B057C1B560; Fri, 3 Aug 2018 14:35:20 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id E87E41B55A for ; Fri, 3 Aug 2018 14:35:18 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Aug 2018 05:35:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,438,1526367600"; d="scan'208";a="221504084" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga004.jf.intel.com with ESMTP; 03 Aug 2018 05:35:14 -0700 Received: from wgcvswdev001.ir.intel.com (wgcvswdev001.ir.intel.com [10.102.246.100]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w73CZFUr004258; Fri, 3 Aug 2018 13:35:15 +0100 Received: from wgcvswdev001.ir.intel.com (localhost [127.0.0.1]) by wgcvswdev001.ir.intel.com with ESMTP id w73CZCKQ021052; Fri, 3 Aug 2018 13:35:12 +0100 Received: (from jmparthx@localhost) by wgcvswdev001.ir.intel.com with ? id w73CZCnn021048; Fri, 3 Aug 2018 13:35:12 +0100 From: Naga Suresh Somarowthu To: dev@dpdk.org Cc: remy.horton@intel.com, reshma.pattan@intel.com, Naga Suresh Somarowthu Date: Fri, 3 Aug 2018 13:34:58 +0100 Message-Id: <1533299698-20950-7-git-send-email-naga.sureshx.somarowthu@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1533299698-20950-1-git-send-email-naga.sureshx.somarowthu@intel.com> References: <1533297953-9149-1-git-send-email-naga.sureshx.somarowthu@intel.com> <1533299698-20950-1-git-send-email-naga.sureshx.somarowthu@intel.com> Subject: [dpdk-dev] [PATCH v12 6/6] maintainers: add bitrate latency pdump tests X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Update MAINTAINERSHIP for bitrate, latency, pdump unit tests and sample packet helper functions for unit test. Signed-off-by: Naga Suresh Somarowthu Reviewed-by: Reshma Pattan --- MAINTAINERS | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 3b9fec76f..7b9277404 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -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 F: lib/librte_bitratestats/ +F: test/test/test_bitratestats.c Latency statistics M: Reshma Pattan F: lib/librte_latencystats/ +F: test/test/test_latencystats.c BPF - EXPERIMENTAL M: Konstantin Ananyev @@ -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 +F: test/test/sample_packet_forward.c +F: test/test/sample_packet_forward.h + Driver testing tool M: Wenzhuo Lu M: Jingjing Wu