aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/data_fwd.h
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-plugin/src/data_fwd.h')
-rw-r--r--hicn-plugin/src/data_fwd.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/hicn-plugin/src/data_fwd.h b/hicn-plugin/src/data_fwd.h
index ad41e7e39..d95f564c3 100644
--- a/hicn-plugin/src/data_fwd.h
+++ b/hicn-plugin/src/data_fwd.h
@@ -20,6 +20,27 @@
#include "pcs.h"
+/**
+ * @file data_fwd.h
+ *
+ * This is the node encoutered by data packets after the hicn-data-pcslookup.
+ * This node has two goals: 1) clone/copy the vlib buffer as many time as the number
+ * of faces stored in the pit entry, 2) store a clone/copy of the vlib buffer in the CS.
+ * Unless there are memory issue (no more vlib buffer available to perform cloning/copy),
+ * a single vlib buffer received might results in several vlib buffer sent to the next
+ * vlib node (hicn4-iface-output or hicn6-iface-output).
+ *
+ * It must be noted that cloning is possible only if the lentgh of the data pointed by
+ * the vlib buffer is at least 256 bytes. This is due to an imposition in the vpp source
+ * code. In all the other cases the vlib buffer is copied. Cloning is performed by advancing
+ * the vlib buffer of 256 bytes and a new vlib buffer is created and chained in from of the received
+ * buffer. Additionally, the 256 bytes removed (advanced) from the received vlib buffer are
+ * copied in the head vlib buffer. In case of multiple cloning for the same vlib buffer, this
+ * mechanism allows us to have a different hICN header for each clone (+ the same additional bytes
+ * due to the vpp restriction on cloning).
+ */
+
+
/* Trace context struct */
typedef struct
{
@@ -33,7 +54,6 @@ typedef enum
{
HICN_DATA_FWD_NEXT_V4_LOOKUP,
HICN_DATA_FWD_NEXT_V6_LOOKUP,
- HICN_DATA_FWD_NEXT_PUSH,
HICN_DATA_FWD_NEXT_IFACE4_OUT,
HICN_DATA_FWD_NEXT_IFACE6_OUT,
HICN_DATA_FWD_NEXT_ERROR_DROP,
@@ -41,7 +61,7 @@ typedef enum
} hicn_data_fwd_next_t;
/**
- *@brief Create a maximum of 256 clones of buffer and store them
+ * @brief Create a maximum of 256 clones of buffer and store them
* in the supplied array. Unlike the original function in the vlib
* library, we don't prevent cloning if n_buffer==1 and if
* s->current_length <= head_end_offset + CLIB_CACHE_LINE_BYTES * 2.