Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions ET2500/vpp-24.02/src/vnet/fib/fib_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -1648,33 +1648,33 @@ fib_path_cmp_i (const fib_path_t *path1,
return (res);
}

/*
* fib_path_cmp_for_sort
*
* Compare two paths for equivalence. Used during path sorting.
* As usual 0 means equal.
*/
int
fib_path_cmp_for_sort (void * v1,
void * v2)
{
fib_node_index_t *pi1 = v1, *pi2 = v2;
fib_path_t *path1, *path2;

path1 = fib_path_get(*pi1);
path2 = fib_path_get(*pi2);

/*
* when sorting paths we want the highest preference paths
* first, so that the choices set built is in prefernce order
*/
if (path1->fp_preference != path2->fp_preference)
{
return (path1->fp_preference - path2->fp_preference);
}

return (fib_path_cmp_i(path1, path2));
}
// /*
// * fib_path_cmp_for_sort
// *
// * Compare two paths for equivalence. Used during path sorting.
// * As usual 0 means equal.
// */
// int
// fib_path_cmp_for_sort (void * v1,
// void * v2)
// {
// fib_node_index_t *pi1 = v1, *pi2 = v2;
// fib_path_t *path1, *path2;

// path1 = fib_path_get(*pi1);
// path2 = fib_path_get(*pi2);

// /*
// * when sorting paths we want the highest preference paths
// * first, so that the choices set built is in prefernce order
// */
// if (path1->fp_preference != path2->fp_preference)
// {
// return (path1->fp_preference - path2->fp_preference);
// }

// return (fib_path_cmp_i(path1, path2));
// }

/*
* fib_path_cmp
Expand Down
2 changes: 1 addition & 1 deletion ET2500/vpp-24.02/src/vnet/fib/fib_path.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ extern fib_node_index_t fib_path_create_special(fib_node_index_t pl_index,

extern int fib_path_cmp(fib_node_index_t path_index1,
fib_node_index_t path_index2);
extern int fib_path_cmp_for_sort(void * a1, void * a2);
// extern int fib_path_cmp_for_sort(void * a1, void * a2);
extern int fib_path_cmp_w_route_path(fib_node_index_t path_index,
const fib_route_path_t *rpath);
extern fib_node_index_t fib_path_copy(fib_node_index_t path_index,
Expand Down
44 changes: 22 additions & 22 deletions ET2500/vpp-24.02/src/vnet/fib/fib_path_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,16 +700,16 @@ fib_path_list_create (fib_path_list_flags_t flags,
fib_path_create(path_list_index,
&rpaths[i]));
}
/*
* we sort the paths since the key for the path-list is
* the description of the paths it contains. The paths need to
* be sorted else this description will differ.
*/
if (vec_len(path_list->fpl_paths) > 1)
{
vec_sort_with_function(path_list->fpl_paths,
fib_path_cmp_for_sort);
}
// /*
// * we sort the paths since the key for the path-list is
// * the description of the paths it contains. The paths need to
// * be sorted else this description will differ.
// */
// if (vec_len(path_list->fpl_paths) > 1)
// {
// vec_sort_with_function(path_list->fpl_paths,
// fib_path_cmp_for_sort);
// }
}

/*
Expand Down Expand Up @@ -973,12 +973,12 @@ fib_path_list_copy_and_path_add (fib_node_index_t orig_path_list_index,
}
}

/*
* we sort the paths since the key for the path-list is
* the description of the paths it contains. The paths need to
* be sorted else this description will differ.
*/
vec_sort_with_function(path_list->fpl_paths, fib_path_cmp_for_sort);
// /*
// * we sort the paths since the key for the path-list is
// * the description of the paths it contains. The paths need to
// * be sorted else this description will differ.
// */
// vec_sort_with_function(path_list->fpl_paths, fib_path_cmp_for_sort);

FIB_PATH_LIST_DBG(path_list, "path-added");

Expand Down Expand Up @@ -1152,12 +1152,12 @@ fib_path_list_copy_and_path_remove (fib_node_index_t orig_path_list_index,

path_list_index = FIB_NODE_INDEX_INVALID;
} else {
/*
* we sort the paths since the key for the path-list is
* the description of the paths it contains. The paths need to
* be sorted else this description will differ.
*/
vec_sort_with_function(path_list->fpl_paths, fib_path_cmp_for_sort);
// /*
// * we sort the paths since the key for the path-list is
// * the description of the paths it contains. The paths need to
// * be sorted else this description will differ.
// */
// vec_sort_with_function(path_list->fpl_paths, fib_path_cmp_for_sort);

/*
* If a shared path list is requested, consult the DB for a match
Expand Down
32 changes: 16 additions & 16 deletions ET2500/vpp-24.02/src/vnet/fib/fib_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,12 +598,12 @@ fib_table_entry_path_add (u32 fib_index,
return (fib_entry_index);
}

static int
fib_route_path_cmp_for_sort (void * v1,
void * v2)
{
return (fib_route_path_cmp(v1, v2));
}
// static int
// fib_route_path_cmp_for_sort (void * v1,
// void * v2)
// {
// return (fib_route_path_cmp(v1, v2));
// }

fib_node_index_t
fib_table_entry_path_add2 (u32 fib_index,
Expand All @@ -623,11 +623,11 @@ fib_table_entry_path_add2 (u32 fib_index,
{
fib_table_route_path_fixup(prefix, &flags, &rpaths[ii]);
}
/*
* sort the paths provided by the control plane. this means
* the paths and the extension on the entry will be sorted.
*/
vec_sort_with_function(rpaths, fib_route_path_cmp_for_sort);
// /*
// * sort the paths provided by the control plane. this means
// * the paths and the extension on the entry will be sorted.
// */
// vec_sort_with_function(rpaths, fib_route_path_cmp_for_sort);

if (FIB_NODE_INDEX_INVALID == fib_entry_index)
{
Expand Down Expand Up @@ -788,11 +788,11 @@ fib_table_entry_update (u32 fib_index,
{
fib_table_route_path_fixup(prefix, &flags, &paths[ii]);
}
/*
* sort the paths provided by the control plane. this means
* the paths and the extension on the entry will be sorted.
*/
vec_sort_with_function(paths, fib_route_path_cmp_for_sort);
// /*
// * sort the paths provided by the control plane. this means
// * the paths and the extension on the entry will be sorted.
// */
// vec_sort_with_function(paths, fib_route_path_cmp_for_sort);

if (FIB_NODE_INDEX_INVALID == fib_entry_index)
{
Expand Down