From c7f942175b8c25c77ddc21561b52e3e6b5620b80 Mon Sep 17 00:00:00 2001 From: Alberto Compagno Date: Sat, 19 Jan 2019 17:28:57 +0100 Subject: Improved performance on data-fwd node: - Removed full pit entry initialization in favor of a lighter initialization on few fields - Squeezed pit entry size in order to store only the number of incomplete faces (as set in HICN_PARAM_PIT_ENTRY_PHOPS_MAX). The bitmap size is now determined by HICN_PARAM_FACES_MAX and optimized to do a fast lookup Replaced the field is_appface with the field flags in the hicn_buffer_t: - is_appface is now a flag with value 0x01 (HICN_BUFFER_FLAGS_FACE_IS_APP) - Added flag HICN_BUFFER_FLAGS_PKT_LESS_TWO_CL (0x02) to handle the copy of pkt with length < than 2*CACHE_LINES (in this case cloning is prevented by the cloning function in vpp). Such flag is initialized by the incoming face of the pkt. Change-Id: Ia956fd5719a28ee29f7fa2fd23d283964743efd8 Signed-off-by: Alberto Compagno --- hicn-plugin/src/faces/face.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'hicn-plugin/src/faces/face.h') diff --git a/hicn-plugin/src/faces/face.h b/hicn-plugin/src/faces/face.h index 2774d9a2e..b24fe8648 100755 --- a/hicn-plugin/src/faces/face.h +++ b/hicn-plugin/src/faces/face.h @@ -21,6 +21,8 @@ #include #include +#include "../hicn.h" + typedef u8 hicn_face_flags_t; typedef index_t hicn_face_id_t; typedef dpo_type_t hicn_face_type_t; @@ -101,6 +103,27 @@ extern hicn_face_t *hicn_dpoi_face_pool; #define HICN_FACE_NULL (hicn_face_id_t) ~0 +#define HICN_FACE_FLAGS_APPFACE_PROD_BIT 2 +#define HICN_FACE_FLAGS_APPFACE_CONS_BIT 3 + +STATIC_ASSERT ((1 << HICN_FACE_FLAGS_APPFACE_PROD_BIT) == + HICN_FACE_FLAGS_APPFACE_PROD, + "HICN_FACE_FLAGS_APPFACE_PROD_BIT and HICN_FACE_FLAGS_APPFACE_PROD must correspond"); + +STATIC_ASSERT ((1 << HICN_FACE_FLAGS_APPFACE_CONS_BIT) == + HICN_FACE_FLAGS_APPFACE_CONS, + "HICN_FACE_FLAGS_APPFACE_CONS_BIT and HICN_FACE_FLAGS_APPFACE_CONS must correspond"); + +STATIC_ASSERT ((HICN_FACE_FLAGS_APPFACE_PROD >> + HICN_FACE_FLAGS_APPFACE_PROD_BIT) == + HICN_BUFFER_FLAGS_FACE_IS_APP, + "hicn buffer app flag does not correspond to HICN_FACE_FLAGS_APPFACE_PROD"); + +STATIC_ASSERT ((HICN_FACE_FLAGS_APPFACE_CONS >> + HICN_FACE_FLAGS_APPFACE_CONS_BIT) == + HICN_BUFFER_FLAGS_FACE_IS_APP, + "hicn buffer app flag does not correspond to HICN_FACE_FLAGS_APPFACE_PROD"); + /** * @brief Definition of the virtual functin table for an hICN FACE DPO. * -- cgit 1.2.3-korg