aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2017-09-22 09:57:24 +0200
committerAlberto Compagno <acompagn+fdio@cisco.com>2017-09-22 10:03:38 +0200
commit64f33cc7d23871f7cbca47a26302ebbe23f56f04 (patch)
treef769cbdf2da7a2bb0c3ea445cdd6625995c8dd88
parent5b9b85339d0621c52ebddff808480ca251c7d8a1 (diff)
Introducing speculative enqueue
Change-Id: I5e22334fd03747811bb352c95d3682a91fc6b9f4 Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
-rw-r--r--cicn-plugin/cicn/node.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/cicn-plugin/cicn/node.c b/cicn-plugin/cicn/node.c
index 0279df84..0d755c61 100644
--- a/cicn-plugin/cicn/node.c
+++ b/cicn-plugin/cicn/node.c
@@ -279,6 +279,11 @@ icnfwd_node_fn (vlib_main_t * vm,
from += 1;
n_left_from -= 1;
+ /* Enqueue packet to next graph node */
+ to_next[0] = bi0;
+ to_next += 1;
+ n_left_to_next -= 1;
+
b0 = vlib_get_buffer (vm, bi0);
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) &&
@@ -544,6 +549,10 @@ icnfwd_node_fn (vlib_main_t * vm,
if (cicn_cs_enabled (&rt->pitcs))
{
+ /* Remove b0 from the frame, we hold it in the CS */
+ to_next -= 1;
+ n_left_to_next += 1;
+
/* At this point we think we're safe to proceed.
* Store the CS buf in the PIT/CS hashtable entry
*/
@@ -591,6 +600,7 @@ icnfwd_node_fn (vlib_main_t * vm,
/* Store the original packet buffer in the CS node */
pitp->u.cs.cs_pkt_buf = vlib_get_buffer_index (vm, b0);
+
/* Add to CS LRU */
cicn_cs_lru_insert (&rt->pitcs, nodep, pitp);
@@ -1335,13 +1345,6 @@ icnfwd_node_fn (vlib_main_t * vm,
t->next_index = next0;
}
- /* Speculatively enqueue packet b0 (index in bi0)
- * to the current next frame
- */
- to_next[0] = bi0;
- to_next += 1;
- n_left_to_next -= 1;
-
/* Incr packet counter */
pkts_processed += 1;