aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAhmed Abdelsalam <ahabdels@cisco.com>2022-06-29 16:30:21 +0000
committerDamjan Marion <dmarion@0xa5.net>2022-06-29 21:20:33 +0000
commitb0057282d64a4f9ac5966fceb427057b0665b772 (patch)
tree62cd5987e432c1205581584223af18b73a021c88 /src
parentffa7bac6f5c01aa1dc72a58b76f02882db341c20 (diff)
sr: code refactor and style fix
Type: refactor Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com> Change-Id: Iff5e85952273526d5c9d9e7e73bd2b6c15bcd7f6
Diffstat (limited to 'src')
-rw-r--r--src/vnet/srv6/sr_pt.c13
-rw-r--r--src/vnet/srv6/sr_pt.h16
2 files changed, 14 insertions, 15 deletions
diff --git a/src/vnet/srv6/sr_pt.c b/src/vnet/srv6/sr_pt.c
index 28da12e22f4..5d907eaf639 100644
--- a/src/vnet/srv6/sr_pt.c
+++ b/src/vnet/srv6/sr_pt.c
@@ -6,7 +6,7 @@
* @file
* @brief SR Path Tracing (PT)
*
- * PT CLI
+ * SR PT CLI
*
*/
@@ -36,7 +36,7 @@ sr_pt_find_iface (u32 iface)
p = mhash_get (&sr_pt->sr_pt_iface_index_hash, &iface);
if (p)
{
- /* Retrieve pt_iface */
+ /* Retrieve sr_pt_iface */
return pool_elt_at_index (sr_pt->sr_pt_iface, p[0]);
}
return NULL;
@@ -69,16 +69,15 @@ sr_pt_add_iface (u32 iface, u16 id, u8 ingress_load, u8 egress_load,
if (tts_template > SR_PT_TTS_TEMPLATE_MAX)
return SR_PT_ERR_TTS_TEMPLATE_INVALID;
- /* Create a new pt_iface */
- pool_get (sr_pt->sr_pt_iface, ls);
- clib_memset (ls, 0, sizeof (*ls));
+ /* Create a new sr_pt_iface */
+ pool_get_zero (sr_pt->sr_pt_iface, ls);
ls->iface = iface;
ls->id = id;
ls->ingress_load = ingress_load;
ls->egress_load = egress_load;
ls->tts_template = tts_template;
- /* Set hash key for searching pt_iface by iface */
+ /* Set hash key for searching sr_pt_iface by iface */
mhash_set (&sr_pt->sr_pt_iface_index_hash, &iface, ls - sr_pt->sr_pt_iface,
NULL);
return 0;
@@ -210,7 +209,7 @@ sr_pt_del_iface_command_fn (vlib_main_t *vm, unformat_input_t *input,
}
/**
- * @brief CLI function to show all PT interfcaes
+ * @brief CLI function to show all SR PT interfcaes
*/
static clib_error_t *
sr_pt_show_iface_command_fn (vlib_main_t *vm, unformat_input_t *input,
diff --git a/src/vnet/srv6/sr_pt.h b/src/vnet/srv6/sr_pt.h
index 7242f90b6b3..87fdb68a36e 100644
--- a/src/vnet/srv6/sr_pt.h
+++ b/src/vnet/srv6/sr_pt.h
@@ -11,7 +11,7 @@
#ifndef included_vnet_sr_pt_h
#define included_vnet_sr_pt_h
-/*PT error codes*/
+/*SR PT error codes*/
#define SR_PT_ERR_NOENT -1 /* No such entry*/
#define SR_PT_ERR_EXIST -2 /* Entry exists */
#define SR_PT_ERR_IFACE_INVALID -3 /* IFACE invalid */
@@ -19,19 +19,19 @@
#define SR_PT_ERR_LOAD_INVALID -5 /* LOAD invalid*/
#define SR_PT_ERR_TTS_TEMPLATE_INVALID -6 /* TTS Template invalid */
-/*PT paramters max values*/
+/*SR PT paramters max values*/
#define SR_PT_ID_MAX 4095
#define SR_PT_LOAD_MAX 15
#define SR_PT_TTS_TEMPLATE_MAX 3
-/*PT TTS Templates*/
+/*SR PT TTS Templates*/
#define SR_PT_TTS_TEMPLATE_0 0
#define SR_PT_TTS_TEMPLATE_1 1
#define SR_PT_TTS_TEMPLATE_2 2
#define SR_PT_TTS_TEMPLATE_3 3
#define SR_PT_TTS_TEMPLATE_DEFAULT 2
-/*PT TTS Template shift value*/
+/*SR PT TTS Template shift value*/
#define SR_PT_TTS_SHIFT_TEMPLATE_0 8
#define SR_PT_TTS_SHIFT_TEMPLATE_1 12
#define SR_PT_TTS_SHIFT_TEMPLATE_2 16
@@ -47,14 +47,14 @@ typedef struct
} sr_pt_iface_t;
/**
- * @brief Path Tracing main datastructure
+ * @brief SR Path Tracing main datastructure
*/
typedef struct
{
- /* Pool of pt_iface instances */
+ /* Pool of sr_pt_iface instances */
sr_pt_iface_t *sr_pt_iface;
- /* Hash table for pt iface parameters */
+ /* Hash table for sr_pt_iface parameters */
mhash_t sr_pt_iface_index_hash;
} sr_pt_main_t;
@@ -65,4 +65,4 @@ extern int sr_pt_add_iface (u32 iface, u16 id, u8 ingress_load, u8 egress_load,
extern int sr_pt_del_iface (u32 iface);
extern void *sr_pt_find_iface (u32 iface);
-#endif /* included_vnet_sr_pt_h */
+#endif /* included_vnet_sr_pt_h */ \ No newline at end of file