aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@redhat.com>2015-03-06 16:47:00 -0500
committerDavid S. Miller <davem@davemloft.net>2015-03-11 16:22:14 -0400
commit0ddcf43d5d4a03ded1ee3f6b3b72a0cbed4e90b1 (patch)
tree28c93b0c6eb9389182f60736103b6bfc0b61cedc /net/core
parent169bf9121b19dd6029e0a354d33513f61bfbe3d3 (diff)
ipv4: FIB Local/MAIN table collapse
This patch is meant to collapse local and main into one by converting tb_data from an array to a pointer. Doing this allows us to point the local table into the main while maintaining the same variables in the table. As such the tb_data was converted from an array to a pointer, and a new array called data is added in order to still provide an object for tb_data to point to. In order to track the origin of the fib aliases a tb_id value was added in a hole that existed on 64b systems. Using this we can also reverse the merge in the event that custom FIB rules are enabled. With this patch I am seeing an improvement of 20ns to 30ns for routing lookups as long as custom rules are not enabled, with custom rules enabled we fall back to split tables and the original behavior. Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/fib_rules.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 44706e81b2e0..b55677fed1c8 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -492,6 +492,12 @@ static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh)
492 goto errout; 492 goto errout;
493 } 493 }
494 494
495 if (ops->delete) {
496 err = ops->delete(rule);
497 if (err)
498 goto errout;
499 }
500
495 list_del_rcu(&rule->list); 501 list_del_rcu(&rule->list);
496 502
497 if (rule->action == FR_ACT_GOTO) { 503 if (rule->action == FR_ACT_GOTO) {
@@ -517,8 +523,6 @@ static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh)
517 523
518 notify_rule_change(RTM_DELRULE, rule, ops, nlh, 524 notify_rule_change(RTM_DELRULE, rule, ops, nlh,
519 NETLINK_CB(skb).portid); 525 NETLINK_CB(skb).portid);
520 if (ops->delete)
521 ops->delete(rule);
522 fib_rule_put(rule); 526 fib_rule_put(rule);
523 flush_route_cache(ops); 527 flush_route_cache(ops);
524 rules_ops_put(ops); 528 rules_ops_put(ops);