Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
MTRIE Optimisations 2
[vpp.git]
/
src
/
vnet
/
fib
/
fib_entry.c
diff --git
a/src/vnet/fib/fib_entry.c
b/src/vnet/fib/fib_entry.c
index
24b5063
..
6ac5461
100644
(file)
--- a/
src/vnet/fib/fib_entry.c
+++ b/
src/vnet/fib/fib_entry.c
@@
-230,6
+230,7
@@
fib_entry_last_lock_gone (fib_node_t *node)
ASSERT(0 == vec_len(fib_entry->fe_delegates));
vec_free(fib_entry->fe_delegates);
ASSERT(0 == vec_len(fib_entry->fe_delegates));
vec_free(fib_entry->fe_delegates);
+ vec_free(fib_entry->fe_srcs);
pool_put(fib_entry_pool, fib_entry);
}
pool_put(fib_entry_pool, fib_entry);
}
@@
-550,11
+551,18
@@
fib_entry_alloc (u32 fib_index,
return (fib_entry);
}
return (fib_entry);
}
-static
void
+static
fib_entry_t*
fib_entry_post_flag_update_actions (fib_entry_t *fib_entry,
fib_source_t source,
fib_entry_flag_t old_flags)
{
fib_entry_post_flag_update_actions (fib_entry_t *fib_entry,
fib_source_t source,
fib_entry_flag_t old_flags)
{
+ fib_node_index_t fei;
+
+ /*
+ * save the index so we can recover from pool reallocs
+ */
+ fei = fib_entry_get_index(fib_entry);
+
/*
* handle changes to attached export for import entries
*/
/*
* handle changes to attached export for import entries
*/
@@
-590,6
+598,11
@@
fib_entry_post_flag_update_actions (fib_entry_t *fib_entry,
* no change. nothing to do.
*/
* no change. nothing to do.
*/
+ /*
+ * reload the entry address post possible pool realloc
+ */
+ fib_entry = fib_entry_get(fei);
+
/*
* handle changes to attached export for export entries
*/
/*
* handle changes to attached export for export entries
*/
@@
-604,6
+617,8
@@
fib_entry_post_flag_update_actions (fib_entry_t *fib_entry,
// FIXME
}
// else FIXME
// FIXME
}
// else FIXME
+
+ return (fib_entry);
}
static void
}
static void
@@
-611,7
+626,9
@@
fib_entry_post_install_actions (fib_entry_t *fib_entry,
fib_source_t source,
fib_entry_flag_t old_flags)
{
fib_source_t source,
fib_entry_flag_t old_flags)
{
- fib_entry_post_flag_update_actions(fib_entry, source, old_flags);
+ fib_entry = fib_entry_post_flag_update_actions(fib_entry,
+ source,
+ old_flags);
fib_entry_src_action_installed(fib_entry, source);
}
fib_entry_src_action_installed(fib_entry, source);
}
@@
-907,8
+924,10
@@
fib_entry_path_remove (fib_node_index_t fib_entry_index,
/*
* no more sources left. this entry is toast.
*/
/*
* no more sources left. this entry is toast.
*/
+ fib_entry = fib_entry_post_flag_update_actions(fib_entry,
+ source,
+ bflags);
fib_entry_src_action_uninstall(fib_entry);
fib_entry_src_action_uninstall(fib_entry);
- fib_entry_post_flag_update_actions(fib_entry, source, bflags);
return (FIB_ENTRY_SRC_FLAG_NONE);
}
return (FIB_ENTRY_SRC_FLAG_NONE);
}
@@
-995,8
+1014,10
@@
fib_entry_special_remove (fib_node_index_t fib_entry_index,
/*
* no more sources left. this entry is toast.
*/
/*
* no more sources left. this entry is toast.
*/
+ fib_entry = fib_entry_post_flag_update_actions(fib_entry,
+ source,
+ bflags);
fib_entry_src_action_uninstall(fib_entry);
fib_entry_src_action_uninstall(fib_entry);
- fib_entry_post_flag_update_actions(fib_entry, source, bflags);
return (FIB_ENTRY_SRC_FLAG_NONE);
}
return (FIB_ENTRY_SRC_FLAG_NONE);
}
@@
-1425,7
+1446,10
@@
fib_entry_encode (fib_node_index_t fib_entry_index,
fib_entry_t *fib_entry;
fib_entry = fib_entry_get(fib_entry_index);
fib_entry_t *fib_entry;
fib_entry = fib_entry_get(fib_entry_index);
- fib_path_list_walk(fib_entry->fe_parent, fib_path_encode, api_rpaths);
+ if (FIB_NODE_INDEX_INVALID != fib_entry->fe_parent)
+ {
+ fib_path_list_walk(fib_entry->fe_parent, fib_path_encode, api_rpaths);
+ }
}
void
}
void