aboutsummaryrefslogtreecommitdiff
path: root/sys/net/flowtable.c
diff options
context:
space:
mode:
authorQing Li <qingli@FreeBSD.org>2009-10-01 20:32:29 +0000
committerQing Li <qingli@FreeBSD.org>2009-10-01 20:32:29 +0000
commite5c610d6592ffc80b1c56e628185b60269a33eb7 (patch)
tree4db02a39f3df6fba7d79e3f3032208d6ad0e2bb9 /sys/net/flowtable.c
parent3538cf0cbe9a3f6e5c152d1cf640d358d8dfb2d2 (diff)
Notes
Diffstat (limited to 'sys/net/flowtable.c')
-rw-r--r--sys/net/flowtable.c40
1 files changed, 35 insertions, 5 deletions
diff --git a/sys/net/flowtable.c b/sys/net/flowtable.c
index 22cab54e47aa..b85ae268081a 100644
--- a/sys/net/flowtable.c
+++ b/sys/net/flowtable.c
@@ -830,7 +830,7 @@ fle_free(struct flentry *fle)
}
static void
-flowtable_free_stale(struct flowtable *ft)
+flowtable_free_stale(struct flowtable *ft, struct rtentry *rt)
{
int curbit = 0, count;
struct flentry *fle, **flehead, *fleprev;
@@ -866,8 +866,14 @@ flowtable_free_stale(struct flowtable *ft)
curbit);
}
#endif
- while (fle != NULL) {
- if (!flow_stale(ft, fle)) {
+ while (fle != NULL) {
+ if (rt != NULL) {
+ if (__DEVOLATILE(struct rtentry *, fle->f_rt) != rt) {
+ fleprev = fle;
+ fle = fle->f_next;
+ continue;
+ }
+ } else if (!flow_stale(ft, fle)) {
fleprev = fle;
fle = fle->f_next;
continue;
@@ -916,6 +922,30 @@ flowtable_free_stale(struct flowtable *ft)
log(LOG_DEBUG, "freed %d flow entries\n", count);
}
+void
+flowtable_route_flush(struct flowtable *ft, struct rtentry *rt)
+{
+ int i;
+ if (ft->ft_flags & FL_PCPU) {
+ for (i = 0; i <= mp_maxid; i++) {
+ if (CPU_ABSENT(i))
+ continue;
+
+ thread_lock(curthread);
+ sched_bind(curthread, i);
+ thread_unlock(curthread);
+
+ flowtable_free_stale(ft, rt);
+
+ thread_lock(curthread);
+ sched_unbind(curthread);
+ thread_unlock(curthread);
+ }
+ } else {
+ flowtable_free_stale(ft, rt);
+ }
+}
+
static void
flowtable_clean_vnet(void)
{
@@ -933,14 +963,14 @@ flowtable_clean_vnet(void)
sched_bind(curthread, i);
thread_unlock(curthread);
- flowtable_free_stale(ft);
+ flowtable_free_stale(ft, NULL);
thread_lock(curthread);
sched_unbind(curthread);
thread_unlock(curthread);
}
} else {
- flowtable_free_stale(ft);
+ flowtable_free_stale(ft, NULL);
}
ft = ft->ft_next;
}