From: Jasvinder Singh <jasvinder.singh@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 2/2] modify action handlers in test_pipeline and ip_pipeline
Date: Mon, 29 Feb 2016 14:50:15 +0000 [thread overview]
Message-ID: <1456757415-107819-2-git-send-email-jasvinder.singh@intel.com> (raw)
In-Reply-To: <1456757415-107819-1-git-send-email-jasvinder.singh@intel.com>
Changes are made to the ports and table action handlers defined
in app/test_pipeline and ip_pipeline sample application.
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
app/test-pipeline/pipeline_acl.c | 3 +-
app/test-pipeline/pipeline_hash.c | 3 +-
app/test-pipeline/pipeline_lpm.c | 3 +-
app/test-pipeline/pipeline_lpm_ipv6.c | 3 +-
app/test-pipeline/pipeline_stub.c | 3 +-
.../ip_pipeline/pipeline/pipeline_actions_common.h | 47 +++++++++++++---------
.../ip_pipeline/pipeline/pipeline_firewall_be.c | 3 +-
.../pipeline/pipeline_flow_actions_be.c | 3 +-
.../pipeline/pipeline_flow_classification_be.c | 3 +-
.../ip_pipeline/pipeline/pipeline_passthrough_be.c | 3 +-
.../ip_pipeline/pipeline/pipeline_routing_be.c | 3 +-
11 files changed, 37 insertions(+), 40 deletions(-)
diff --git a/app/test-pipeline/pipeline_acl.c b/app/test-pipeline/pipeline_acl.c
index f163e55..22d5f36 100644
--- a/app/test-pipeline/pipeline_acl.c
+++ b/app/test-pipeline/pipeline_acl.c
@@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -159,7 +159,6 @@ app_main_loop_worker_pipeline_acl(void) {
.ops = &rte_port_ring_writer_ops,
.arg_create = (void *) &port_ring_params,
.f_action = NULL,
- .f_action_bulk = NULL,
.arg_ah = NULL,
};
diff --git a/app/test-pipeline/pipeline_hash.c b/app/test-pipeline/pipeline_hash.c
index 8b888d7..f8aac0d 100644
--- a/app/test-pipeline/pipeline_hash.c
+++ b/app/test-pipeline/pipeline_hash.c
@@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -140,7 +140,6 @@ app_main_loop_worker_pipeline_hash(void) {
.ops = &rte_port_ring_writer_ops,
.arg_create = (void *) &port_ring_params,
.f_action = NULL,
- .f_action_bulk = NULL,
.arg_ah = NULL,
};
diff --git a/app/test-pipeline/pipeline_lpm.c b/app/test-pipeline/pipeline_lpm.c
index 2d7bc01..916abd4 100644
--- a/app/test-pipeline/pipeline_lpm.c
+++ b/app/test-pipeline/pipeline_lpm.c
@@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -99,7 +99,6 @@ app_main_loop_worker_pipeline_lpm(void) {
.ops = &rte_port_ring_writer_ops,
.arg_create = (void *) &port_ring_params,
.f_action = NULL,
- .f_action_bulk = NULL,
.arg_ah = NULL,
};
diff --git a/app/test-pipeline/pipeline_lpm_ipv6.c b/app/test-pipeline/pipeline_lpm_ipv6.c
index c895b62..3352e89 100644
--- a/app/test-pipeline/pipeline_lpm_ipv6.c
+++ b/app/test-pipeline/pipeline_lpm_ipv6.c
@@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -100,7 +100,6 @@ app_main_loop_worker_pipeline_lpm_ipv6(void) {
.ops = &rte_port_ring_writer_ops,
.arg_create = (void *) &port_ring_params,
.f_action = NULL,
- .f_action_bulk = NULL,
.arg_ah = NULL,
};
diff --git a/app/test-pipeline/pipeline_stub.c b/app/test-pipeline/pipeline_stub.c
index 0ad6f9b..ba710ca 100644
--- a/app/test-pipeline/pipeline_stub.c
+++ b/app/test-pipeline/pipeline_stub.c
@@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -94,7 +94,6 @@ app_main_loop_worker_pipeline_stub(void) {
.ops = &rte_port_ring_writer_ops,
.arg_create = (void *) &port_ring_params,
.f_action = NULL,
- .f_action_bulk = NULL,
.arg_ah = NULL,
};
diff --git a/examples/ip_pipeline/pipeline/pipeline_actions_common.h b/examples/ip_pipeline/pipeline/pipeline_actions_common.h
index aa1dd59..9958758 100644
--- a/examples/ip_pipeline/pipeline/pipeline_actions_common.h
+++ b/examples/ip_pipeline/pipeline/pipeline_actions_common.h
@@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -33,12 +33,19 @@
#ifndef __INCLUDE_PIPELINE_ACTIONS_COMMON_H__
#define __INCLUDE_PIPELINE_ACTIONS_COMMON_H__
+#include <stdint.h>
+
+#include <rte_common.h>
+#include <rte_cycles.h>
+#include <rte_mbuf.h>
+#include <rte_pipeline.h>
+
#define PIPELINE_PORT_IN_AH(f_ah, f_pkt_work, f_pkt4_work) \
static int \
f_ah( \
+ __rte_unused struct rte_pipeline *p, \
struct rte_mbuf **pkts, \
uint32_t n_pkts, \
- uint64_t *pkts_mask, \
void *arg) \
{ \
uint32_t i; \
@@ -49,21 +56,18 @@ f_ah( \
for ( ; i < n_pkts; i++) \
f_pkt_work(pkts[i], arg); \
\
- *pkts_mask = (~0LLU) >> (64 - n_pkts); \
- \
return 0; \
}
#define PIPELINE_TABLE_AH_HIT(f_ah, f_pkt_work, f_pkt4_work) \
static int \
f_ah( \
+ __rte_unused struct rte_pipeline *p, \
struct rte_mbuf **pkts, \
- uint64_t *pkts_mask, \
+ uint64_t pkts_in_mask, \
struct rte_pipeline_table_entry **entries, \
void *arg) \
{ \
- uint64_t pkts_in_mask = *pkts_mask; \
- \
if ((pkts_in_mask & (pkts_in_mask + 1)) == 0) { \
uint64_t n_pkts = __builtin_popcountll(pkts_in_mask); \
uint32_t i; \
@@ -88,13 +92,12 @@ f_ah( \
#define PIPELINE_TABLE_AH_MISS(f_ah, f_pkt_work, f_pkt4_work) \
static int \
f_ah( \
+ __rte_unused struct rte_pipeline *p, \
struct rte_mbuf **pkts, \
- uint64_t *pkts_mask, \
+ uint64_t pkts_in_mask, \
struct rte_pipeline_table_entry *entry, \
void *arg) \
{ \
- uint64_t pkts_in_mask = *pkts_mask; \
- \
if ((pkts_in_mask & (pkts_in_mask + 1)) == 0) { \
uint64_t n_pkts = __builtin_popcountll(pkts_in_mask); \
uint32_t i; \
@@ -119,13 +122,14 @@ f_ah( \
#define PIPELINE_TABLE_AH_HIT_DROP_TIME(f_ah, f_pkt_work, f_pkt4_work) \
static int \
f_ah( \
+ struct rte_pipeline *p, \
struct rte_mbuf **pkts, \
- uint64_t *pkts_mask, \
+ uint64_t pkts_mask, \
struct rte_pipeline_table_entry **entries, \
void *arg) \
{ \
- uint64_t pkts_in_mask = *pkts_mask; \
- uint64_t pkts_out_mask = *pkts_mask; \
+ uint64_t pkts_in_mask = pkts_mask; \
+ uint64_t pkts_out_mask = pkts_mask; \
uint64_t time = rte_rdtsc(); \
\
if ((pkts_in_mask & (pkts_in_mask + 1)) == 0) { \
@@ -134,13 +138,13 @@ f_ah( \
\
for (i = 0; i < (n_pkts & (~0x3LLU)); i += 4) { \
uint64_t mask = f_pkt4_work(&pkts[i], \
- &entries[i], arg, time); \
+ &entries[i], arg, time); \
pkts_out_mask ^= mask << i; \
} \
\
for ( ; i < n_pkts; i++) { \
uint64_t mask = f_pkt_work(pkts[i], \
- entries[i], arg, time); \
+ entries[i], arg, time); \
pkts_out_mask ^= mask << i; \
} \
} else \
@@ -154,20 +158,22 @@ f_ah( \
pkts_out_mask ^= mask << pos; \
} \
\
- *pkts_mask = pkts_out_mask; \
+ rte_pipeline_ah_packet_drop(p, pkts_out_mask ^ pkts_mask); \
+ \
return 0; \
}
#define PIPELINE_TABLE_AH_MISS_DROP_TIME(f_ah, f_pkt_work, f_pkt4_work) \
static int \
f_ah( \
+ struct rte_pipeline *p, \
struct rte_mbuf **pkts, \
- uint64_t *pkts_mask, \
+ uint64_t pkts_mask, \
struct rte_pipeline_table_entry *entry, \
void *arg) \
{ \
- uint64_t pkts_in_mask = *pkts_mask; \
- uint64_t pkts_out_mask = *pkts_mask; \
+ uint64_t pkts_in_mask = pkts_mask; \
+ uint64_t pkts_out_mask = pkts_mask; \
uint64_t time = rte_rdtsc(); \
\
if ((pkts_in_mask & (pkts_in_mask + 1)) == 0) { \
@@ -195,7 +201,8 @@ f_ah( \
pkts_out_mask ^= mask << pos; \
} \
\
- *pkts_mask = pkts_out_mask; \
+ rte_pipeline_ah_packet_drop(p, pkts_out_mask ^ pkts_mask); \
+ \
return 0; \
}
diff --git a/examples/ip_pipeline/pipeline/pipeline_firewall_be.c b/examples/ip_pipeline/pipeline/pipeline_firewall_be.c
index 1c376f7..0e8da94 100644
--- a/examples/ip_pipeline/pipeline/pipeline_firewall_be.c
+++ b/examples/ip_pipeline/pipeline/pipeline_firewall_be.c
@@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -439,7 +439,6 @@ pipeline_firewall_init(struct pipeline_params *params,
.arg_create = pipeline_port_out_params_convert(
¶ms->port_out[i]),
.f_action = NULL,
- .f_action_bulk = NULL,
.arg_ah = NULL,
};
diff --git a/examples/ip_pipeline/pipeline/pipeline_flow_actions_be.c b/examples/ip_pipeline/pipeline/pipeline_flow_actions_be.c
index ec149c8..8244a5c 100644
--- a/examples/ip_pipeline/pipeline/pipeline_flow_actions_be.c
+++ b/examples/ip_pipeline/pipeline/pipeline_flow_actions_be.c
@@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -585,7 +585,6 @@ static void *pipeline_fa_init(struct pipeline_params *params,
.arg_create = pipeline_port_out_params_convert(
¶ms->port_out[i]),
.f_action = NULL,
- .f_action_bulk = NULL,
.arg_ah = NULL,
};
diff --git a/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c b/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c
index ac80fc6..81b6454 100644
--- a/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c
+++ b/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c
@@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -414,7 +414,6 @@ static void *pipeline_fc_init(struct pipeline_params *params,
.arg_create = pipeline_port_out_params_convert(
¶ms->port_out[i]),
.f_action = NULL,
- .f_action_bulk = NULL,
.arg_ah = NULL,
};
diff --git a/examples/ip_pipeline/pipeline/pipeline_passthrough_be.c b/examples/ip_pipeline/pipeline/pipeline_passthrough_be.c
index a898f7d..7642462 100644
--- a/examples/ip_pipeline/pipeline/pipeline_passthrough_be.c
+++ b/examples/ip_pipeline/pipeline/pipeline_passthrough_be.c
@@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -451,7 +451,6 @@ pipeline_passthrough_init(struct pipeline_params *params,
.arg_create = pipeline_port_out_params_convert(
¶ms->port_out[i]),
.f_action = NULL,
- .f_action_bulk = NULL,
.arg_ah = NULL,
};
diff --git a/examples/ip_pipeline/pipeline/pipeline_routing_be.c b/examples/ip_pipeline/pipeline/pipeline_routing_be.c
index 9baabd0..a207286 100644
--- a/examples/ip_pipeline/pipeline/pipeline_routing_be.c
+++ b/examples/ip_pipeline/pipeline/pipeline_routing_be.c
@@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -1192,7 +1192,6 @@ pipeline_routing_init(struct pipeline_params *params,
.arg_create = pipeline_port_out_params_convert(
¶ms->port_out[i]),
.f_action = NULL,
- .f_action_bulk = NULL,
.arg_ah = NULL,
};
--
2.5.0
next prev parent reply other threads:[~2016-02-29 14:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-25 14:11 [dpdk-dev] [PATCH 1/2] librte_pipeline: add support for packet redirection at action handlers Jasvinder Singh
2016-01-25 14:11 ` [dpdk-dev] [PATCH 2/2] modify action handlers in test_pipeline and ip_pipeline Jasvinder Singh
2016-02-29 14:50 ` [dpdk-dev] [PATCH v2 1/2] librte_pipeline: add support for packet redirection at action handlers Jasvinder Singh
2016-02-29 14:50 ` Jasvinder Singh [this message]
2016-03-02 20:41 ` [dpdk-dev] [PATCH v3 " Jasvinder Singh
2016-03-02 20:41 ` [dpdk-dev] [PATCH v3 2/2] modify action handlers in test_pipeline and ip_pipeline Jasvinder Singh
2016-03-03 9:35 ` [dpdk-dev] [PATCH v3 1/2] librte_pipeline: add support for packet redirection at action handlers Panu Matilainen
2016-03-03 9:58 ` Singh, Jasvinder
2016-03-03 11:01 ` [dpdk-dev] [PATCH v4] " Jasvinder Singh
2016-03-07 11:01 ` Thomas Monjalon
2016-03-07 11:29 ` Singh, Jasvinder
2016-03-07 11:38 ` Thomas Monjalon
2016-03-08 18:07 ` [dpdk-dev] [PATCH v5 1/2] " Jasvinder Singh
2016-03-08 18:07 ` [dpdk-dev] [PATCH v5 2/2] librte_pipeline: add new API functions for pipeline " Jasvinder Singh
2016-03-10 0:21 ` Thomas Monjalon
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=1456757415-107819-2-git-send-email-jasvinder.singh@intel.com \
--to=jasvinder.singh@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).