From: roy.fan.zhang@intel.com
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 3/4] app/test_pipeline: modify pipeline test
Date: Fri, 11 Sep 2015 14:35:47 +0100 [thread overview]
Message-ID: <1441978548-3582-4-git-send-email-roy.fan.zhang@intel.com> (raw)
In-Reply-To: <1441978548-3582-1-git-send-email-roy.fan.zhang@intel.com>
From: Fan Zhang <roy.fan.zhang@intel.com>
Test_pipeline has been modified to work on updated macros to access
meta-data stored in the mbuf structure.
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
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
next prev parent reply other threads:[~2015-09-11 13:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 13:35 [dpdk-dev] [PATCH 0/4]librte_port: modify macros to access packet meta-data roy.fan.zhang
2015-09-11 13:35 ` [dpdk-dev] [PATCH 1/4] librte_port: " roy.fan.zhang
2015-09-11 13:35 ` [dpdk-dev] [PATCH 2/4] app/test: modify table and pipeline test roy.fan.zhang
2015-09-11 13:35 ` roy.fan.zhang [this message]
2015-09-11 13:35 ` [dpdk-dev] [PATCH 4/4] librte_port: modify release notes and deprecation notice roy.fan.zhang
2015-10-19 14:21 ` Thomas Monjalon
2015-09-11 13:40 ` [dpdk-dev] [PATCH 0/4]librte_port: modify macros to access packet meta-data Dumitrescu, Cristian
2015-10-19 15:02 ` Thomas Monjalon
[not found] ` <6444334.trQLVujQca@xps13>
2015-10-20 14:56 ` Dumitrescu, Cristian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1441978548-3582-4-git-send-email-roy.fan.zhang@intel.com \
--to=roy.fan.zhang@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).