aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/faces/face.h
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-03-23 14:46:14 +0100
committerAlberto Compagno <acompagn+fdio@cisco.com>2019-03-23 16:05:19 +0100
commit2ba7f1f0bef4ecb20af57283d456e66e31fa667a (patch)
tree5c29f03e3259bc9def5623152ae9e3eff771f39f /hicn-plugin/src/faces/face.h
parenta2bdc00ea25f89185c1095a48a8f51cb2c1a20e6 (diff)
[HICN-138] Added number of received/transmitted bytes and packets on each face
Change-Id: Icfe9cd84bdc72afef3d714064e695d1abef368f5 Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'hicn-plugin/src/faces/face.h')
-rw-r--r--hicn-plugin/src/faces/face.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/hicn-plugin/src/faces/face.h b/hicn-plugin/src/faces/face.h
index 313f8ec86..d4f7f356a 100644
--- a/hicn-plugin/src/faces/face.h
+++ b/hicn-plugin/src/faces/face.h
@@ -51,6 +51,9 @@ typedef struct __attribute__ ((packed)) hicn_face_shared_s
/* And a network or application face (1B) */
hicn_face_flags_t flags;
+ /* Align the upcoming fields */
+ u8 align;
+
/* Path label (2B) */
u16 pl_id;
@@ -82,7 +85,6 @@ typedef struct __attribute__ ((packed)) hicn_face_s
/* Additional space to fill with face_type specific information */
u8 data[2 * CLIB_CACHE_LINE_BYTES - sizeof (hicn_face_shared_t)];
hicn_face_shared_t shared;
-
}
hicn_face_t;
@@ -140,6 +142,24 @@ typedef struct hicn_face_vft_s
void (*hicn_face_get_dpo) (hicn_face_t * face, dpo_id_t * dpo);
} hicn_face_vft_t;
+#define foreach_hicn_face_counter \
+ _(INTEREST_RX, 0, "Interest rx") \
+ _(INTEREST_TX, 1, "Interest tx") \
+ _(DATA_RX, 2, "Data rx") \
+ _(DATA_TX, 3, "Data tx") \
+
+typedef enum
+{
+#define _(a,b,c) HICN_FACE_COUNTERS_##a = (b),
+ foreach_hicn_face_counter
+#undef _
+ HICN_N_COUNTER
+} hicn_face_counters_t;
+
+extern const char *HICN_FACE_CTRX_STRING[];
+
+#define get_face_counter_string(ctrxno) (char *)(HICN_FACE_CTRX_STRING[ctrxno])
+
/* Vector maintaining a dpo per face */
extern dpo_id_t *face_dpo_vec;
@@ -151,6 +171,9 @@ extern char **face_type_names_vec;
/* First face type registered in the sytem.*/
extern dpo_type_t first_type;
+/* Per-face counters */
+extern vlib_combined_counter_main_t *counters;
+
/**
* @brief Return the face id from the face state
*