aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/interest_hitcs_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/interest_hitcs_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/interest_hitcs_node.c')
-rw-r--r--hicn-plugin/src/interest_hitcs_node.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/hicn-plugin/src/interest_hitcs_node.c b/hicn-plugin/src/interest_hitcs_node.c
index 1d2255fcd..97879b328 100644
--- a/hicn-plugin/src/interest_hitcs_node.c
+++ b/hicn-plugin/src/interest_hitcs_node.c
@@ -45,17 +45,15 @@ clone_from_cs (vlib_main_t * vm, u32 * bi0_cs, vlib_buffer_t * dest, u8 isv6)
/* Retrieve the buffer to clone */
vlib_buffer_t *cs_buf = vlib_get_buffer (vm, *bi0_cs);
hicn_buffer_t *hicnb = hicn_get_buffer (cs_buf);
- 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;
if (hicnb->flags & HICN_BUFFER_FLAGS_PKT_LESS_TWO_CL)
{
clib_memcpy_fast (vlib_buffer_get_current (dest),
vlib_buffer_get_current (cs_buf),
- cs_buf->current_length);
+ dest->current_length);
clib_memcpy_fast (dest->opaque2, cs_buf->opaque2,
sizeof (cs_buf->opaque2));
- dest->current_data = cs_buf->current_data;
+
dest->current_length = cs_buf->current_length;
dest->total_length_not_including_first_buffer = 0;
}
@@ -71,18 +69,16 @@ clone_from_cs (vlib_main_t * vm, u32 * bi0_cs, vlib_buffer_t * dest, u8 isv6)
cs_buf = cs_buf2;
}
- clib_memcpy (vlib_buffer_get_current (dest),
- vlib_buffer_get_current (cs_buf), buffer_advance);
+ clib_memcpy_fast (vlib_buffer_get_current (dest),
+ vlib_buffer_get_current (cs_buf), buffer_advance);
+ clib_memcpy_fast (dest->opaque2, cs_buf->opaque2,
+ sizeof (cs_buf->opaque2));
dest->current_length = buffer_advance;
vlib_buffer_advance (cs_buf, buffer_advance);
vlib_buffer_attach_clone (vm, dest, cs_buf);
}
}
-/*
- * ICN forwarder node for interests: handling of Interests delivered based on
- * ACL. - 1 packet at a time - ipv4/tcp ipv6/tcp
- */
static uword
hicn_interest_hitcs_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_frame_t * frame)
@@ -190,8 +186,6 @@ hicn_interest_hitcs_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
* Retrieve the incoming iface and forward
* the data through it
*/
- ASSERT (hicnb0->face_dpo_id.dpoi_index <
- HICN_PARAM_PIT_ENTRY_PHOPS_MAX);
next0 = hicnb0->face_dpo_id.dpoi_next_node;
vnet_buffer (b0)->ip.adj_index[VLIB_TX] =
hicnb0->face_dpo_id.dpoi_index;