aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/data_fwd_node.c
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-02-19 18:46:36 +0100
committerAlberto Compagno <acompagn+fdio@cisco.com>2019-02-20 18:03:16 +0100
commit1c5106f66a6749266cb1d228eda98413c80cbf1f (patch)
tree40bd4c7c42eaabd3fd038caa8f9e2fe432f9a434 /hicn-plugin/src/data_fwd_node.c
parent286fd55fc0cf620747209570a32b79d97d50d9b4 (diff)
[HICN-71]
- Handling the case in which a pushed data hit an existing pit entry (created after the data has gone through the data_pcslookup_node). In this case the data packet is forwarded to the data_fwd_node - Handling the case in which the hash table (in pcs) is full and it is not possible to allocate another bucket. In this case the packet is dropped. - Copying packets whose length is less than 128B. VPP prevents to create a chain of vlib_buffer where the first, or middle, vlib_buffer are holding less then 128B. [HICN-72] - Assign a /128 subnet to the producer app face. Change-Id: I6c19d6d127774a7f59ac69ac965d4bcd6a72becc Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'hicn-plugin/src/data_fwd_node.c')
-rw-r--r--hicn-plugin/src/data_fwd_node.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/hicn-plugin/src/data_fwd_node.c b/hicn-plugin/src/data_fwd_node.c
index 1d37fdbcc..b25c9e0ac 100644
--- a/hicn-plugin/src/data_fwd_node.c
+++ b/hicn-plugin/src/data_fwd_node.c
@@ -173,6 +173,19 @@ hicn_data_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
drop_packet (vm, bi0, &n_left_to_next, &next0, &to_next,
&next_index, node);
stats.pit_expired_count++;
+
+ if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) &&
+ (b0->flags & VLIB_BUFFER_IS_TRACED)))
+ {
+ hicn_data_fwd_trace_t *t =
+ vlib_add_trace (vm, node, b0, sizeof (*t));
+ t->pkt_type = HICN_PKT_TYPE_CONTENT;
+ t->sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_RX];
+ t->next_index = next0;
+ clib_memcpy (t->packet_data,
+ vlib_buffer_get_current (b0),
+ sizeof (t->packet_data));
+ }
}
else
{
@@ -284,8 +297,7 @@ hicn_satisfy_faces (vlib_main_t * vm, u32 bi0,
u32 n_left_from = 0;
u32 next0 = HICN_DATA_FWD_NEXT_ERROR_DROP, next1 =
HICN_DATA_FWD_NEXT_ERROR_DROP;
- u16 buffer_advance = isv6 ? sizeof (ip6_header_t) + sizeof (tcp_header_t) :
- sizeof (ip4_header_t) + sizeof (tcp_header_t);
+ word buffer_advance = CLIB_CACHE_LINE_BYTES * 2;
/*
* We have a hard limit on the number of vlib_buffer that we can
@@ -307,7 +319,7 @@ hicn_satisfy_faces (vlib_main_t * vm, u32 bi0,
* Mark the buffer as smaller than TWO_CL. It will be stored as is in the CS, without excluding
* the hicn_header. Cloning is not possible, it will be copied.
*/
- if (b0->current_length <= buffer_advance + CLIB_CACHE_LINE_BYTES * 2)
+ if (b0->current_length < (buffer_advance + (CLIB_CACHE_LINE_BYTES * 2)))
{
/* In this case the packet is copied. We don't need to add a reference as no buffer are
* chained to it.