summaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/face_db.h
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-01-19 17:28:57 +0100
committerAlberto Compagno <acompagn+fdio@cisco.com>2019-01-19 17:35:54 +0100
commitc7f942175b8c25c77ddc21561b52e3e6b5620b80 (patch)
treed9cecc4574ae9ed2f4a9e041010c8794e6001363 /hicn-plugin/src/face_db.h
parentd13d37534d9449dd54277af664310d5f957dc44a (diff)
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 <acompagn+fdio@cisco.com>
Diffstat (limited to 'hicn-plugin/src/face_db.h')
-rwxr-xr-xhicn-plugin/src/face_db.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/hicn-plugin/src/face_db.h b/hicn-plugin/src/face_db.h
index 7b8a08879..5c95be334 100755
--- a/hicn-plugin/src/face_db.h
+++ b/hicn-plugin/src/face_db.h
@@ -30,14 +30,11 @@
/* Must be power of two */
#define HICN_FACE_DB_INLINE_FACES 4
-#define HICN_PIT_N_HOP_BITMAP_SIZE HICN_PARAM_PIT_ENTRY_PHOPS_MAX
+#define HICN_PIT_BITMAP_SIZE_BYTE (HICN_PARAM_FACES_MAX / 8)
+#define HICN_PIT_N_HOP_BITMAP_SIZE HICN_PARAM_FACES_MAX
#define HICN_PIT_N_HOP_BUCKET (HICN_PARAM_PIT_ENTRY_PHOPS_MAX - HICN_FACE_DB_INLINE_FACES)
-STATIC_ASSERT ((HICN_PIT_N_HOP_BUCKET & (HICN_PIT_N_HOP_BUCKET - 1)) == 0,
- "HICN_PARAM_PIT_ENTRY_PHOP_MAX must be a power of 2 + 4");
-
-/* Takes 2 cache lines */
typedef struct __attribute__ ((packed)) hicn_face_bucket_s
{
/* Array of indexes of virtual faces */
@@ -46,7 +43,7 @@ typedef struct __attribute__ ((packed)) hicn_face_bucket_s
CLIB_CACHE_LINE_ALIGN_MARK (cache_line1);
/* Used to check if interests are retransmission */
- u8 bitmap[HICN_PIT_N_HOP_BITMAP_SIZE];
+ u8 bitmap[HICN_PIT_BITMAP_SIZE_BYTE];
} hicn_face_bucket_t;
@@ -138,7 +135,7 @@ hicn_faces_flush (hicn_face_db_t * face_db)
{
hicn_face_bucket_t *faces_bkt =
pool_elt_at_index (hicn_face_bucket_pool, face_db->next_bucket);
- clib_memset_u64 (&(faces_bkt->bitmap), 0, HICN_PIT_N_HOP_BITMAP_SIZE / 8);
+ clib_memset_u8 (&(faces_bkt->bitmap), 0, HICN_PIT_BITMAP_SIZE_BYTE);
face_db->n_faces = 0;
pool_put_index (hicn_face_bucket_pool, face_db->next_bucket);
}