From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 4EB4D8DED for ; Fri, 11 Sep 2015 15:36:22 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 11 Sep 2015 06:36:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,511,1437462000"; d="scan'208";a="767045458" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 11 Sep 2015 06:36:21 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t8BDaKcI003300; Fri, 11 Sep 2015 14:36:20 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t8BDaK04003829; Fri, 11 Sep 2015 14:36:20 +0100 Received: (from fanzhan2@localhost) by sivswdev02.ir.intel.com with id t8BDaKui003825; Fri, 11 Sep 2015 14:36:20 +0100 From: roy.fan.zhang@intel.com To: dev@dpdk.org Date: Fri, 11 Sep 2015 14:35:47 +0100 Message-Id: <1441978548-3582-4-git-send-email-roy.fan.zhang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1441978548-3582-1-git-send-email-roy.fan.zhang@intel.com> References: <1441978548-3582-1-git-send-email-roy.fan.zhang@intel.com> Subject: [dpdk-dev] [PATCH 3/4] app/test_pipeline: modify pipeline test X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2015 13:36:23 -0000 From: Fan Zhang Test_pipeline has been modified to work on updated macros to access meta-data stored in the mbuf structure. Signed-off-by: Fan Zhang --- app/test-pipeline/main.h | 2 ++ app/test-pipeline/pipeline_hash.c | 34 ++++++++++++++++++---------------- app/test-pipeline/pipeline_lpm.c | 2 +- app/test-pipeline/pipeline_lpm_ipv6.c | 2 +- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/app/test-pipeline/main.h b/app/test-pipeline/main.h index 0c90fc3..8dcd459 100644 --- a/app/test-pipeline/main.h +++ b/app/test-pipeline/main.h @@ -137,4 +137,6 @@ void app_main_loop_tx(void); #define APP_FLUSH 0x3FF #endif +#define APP_METADATA_OFFSET(offset) (sizeof(struct rte_mbuf) + (offset)) + #endif /* _MAIN_H_ */ diff --git a/app/test-pipeline/pipeline_hash.c b/app/test-pipeline/pipeline_hash.c index 548615f..5e4e17f 100644 --- a/app/test-pipeline/pipeline_hash.c +++ b/app/test-pipeline/pipeline_hash.c @@ -163,8 +163,8 @@ app_main_loop_worker_pipeline_hash(void) { .n_buckets_ext = 1 << 21, .f_hash = test_hash, .seed = 0, - .signature_offset = 0, - .key_offset = 32, + .signature_offset = APP_METADATA_OFFSET(0), + .key_offset = APP_METADATA_OFFSET(32), }; struct rte_pipeline_table_params table_params = { @@ -214,8 +214,8 @@ app_main_loop_worker_pipeline_hash(void) { struct rte_table_hash_key8_ext_params table_hash_params = { .n_entries = 1 << 24, .n_entries_ext = 1 << 23, - .signature_offset = 0, - .key_offset = 32, + .signature_offset = APP_METADATA_OFFSET(0), + .key_offset = APP_METADATA_OFFSET(32), .f_hash = test_hash, .seed = 0, }; @@ -238,8 +238,8 @@ app_main_loop_worker_pipeline_hash(void) { { struct rte_table_hash_key8_lru_params table_hash_params = { .n_entries = 1 << 24, - .signature_offset = 0, - .key_offset = 32, + .signature_offset = APP_METADATA_OFFSET(0), + .key_offset = APP_METADATA_OFFSET(32), .f_hash = test_hash, .seed = 0, }; @@ -263,8 +263,8 @@ app_main_loop_worker_pipeline_hash(void) { struct rte_table_hash_key16_ext_params table_hash_params = { .n_entries = 1 << 24, .n_entries_ext = 1 << 23, - .signature_offset = 0, - .key_offset = 32, + .signature_offset = APP_METADATA_OFFSET(0), + .key_offset = APP_METADATA_OFFSET(32), .f_hash = test_hash, .seed = 0, }; @@ -287,8 +287,8 @@ app_main_loop_worker_pipeline_hash(void) { { struct rte_table_hash_key16_lru_params table_hash_params = { .n_entries = 1 << 24, - .signature_offset = 0, - .key_offset = 32, + .signature_offset = APP_METADATA_OFFSET(0), + .key_offset = APP_METADATA_OFFSET(32), .f_hash = test_hash, .seed = 0, }; @@ -312,8 +312,8 @@ app_main_loop_worker_pipeline_hash(void) { struct rte_table_hash_key32_ext_params table_hash_params = { .n_entries = 1 << 24, .n_entries_ext = 1 << 23, - .signature_offset = 0, - .key_offset = 32, + .signature_offset = APP_METADATA_OFFSET(0), + .key_offset = APP_METADATA_OFFSET(32), .f_hash = test_hash, .seed = 0, }; @@ -337,8 +337,8 @@ app_main_loop_worker_pipeline_hash(void) { { struct rte_table_hash_key32_lru_params table_hash_params = { .n_entries = 1 << 24, - .signature_offset = 0, - .key_offset = 32, + .signature_offset = APP_METADATA_OFFSET(0), + .key_offset = APP_METADATA_OFFSET(32), .f_hash = test_hash, .seed = 0, }; @@ -456,8 +456,10 @@ app_main_loop_rx_metadata(void) { m = app.mbuf_rx.array[j]; m_data = rte_pktmbuf_mtod(m, uint8_t *); - signature = RTE_MBUF_METADATA_UINT32_PTR(m, 0); - key = RTE_MBUF_METADATA_UINT8_PTR(m, 32); + signature = RTE_MBUF_METADATA_UINT32_PTR(m, + APP_METADATA_OFFSET(0)); + key = RTE_MBUF_METADATA_UINT8_PTR(m, + APP_METADATA_OFFSET(32)); if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) { ip_hdr = (struct ipv4_hdr *) diff --git a/app/test-pipeline/pipeline_lpm.c b/app/test-pipeline/pipeline_lpm.c index b1a2c13..e098f8b 100644 --- a/app/test-pipeline/pipeline_lpm.c +++ b/app/test-pipeline/pipeline_lpm.c @@ -115,7 +115,7 @@ app_main_loop_worker_pipeline_lpm(void) { .n_rules = 1 << 24, .entry_unique_size = sizeof(struct rte_pipeline_table_entry), - .offset = 32, + .offset = APP_METADATA_OFFSET(32), }; struct rte_pipeline_table_params table_params = { diff --git a/app/test-pipeline/pipeline_lpm_ipv6.c b/app/test-pipeline/pipeline_lpm_ipv6.c index 3f24a2d..a5cd3a4 100644 --- a/app/test-pipeline/pipeline_lpm_ipv6.c +++ b/app/test-pipeline/pipeline_lpm_ipv6.c @@ -117,7 +117,7 @@ app_main_loop_worker_pipeline_lpm_ipv6(void) { .number_tbl8s = 1 << 21, .entry_unique_size = sizeof(struct rte_pipeline_table_entry), - .offset = 32, + .offset = APP_METADATA_OFFSET(32), }; struct rte_pipeline_table_params table_params = { -- 2.1.0