aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/multipath_rr.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/multipath_rr.c')
-rw-r--r--net/ipv4/multipath_rr.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/net/ipv4/multipath_rr.c b/net/ipv4/multipath_rr.c
index 554a82568160..061b6b253982 100644
--- a/net/ipv4/multipath_rr.c
+++ b/net/ipv4/multipath_rr.c
@@ -47,29 +47,12 @@
47#include <net/checksum.h> 47#include <net/checksum.h>
48#include <net/ip_mp_alg.h> 48#include <net/ip_mp_alg.h>
49 49
50#define MULTIPATH_MAX_CANDIDATES 40
51
52static struct rtable* last_used = NULL;
53
54static void rr_remove(struct rtable *rt)
55{
56 if (last_used == rt)
57 last_used = NULL;
58}
59
60static void rr_select_route(const struct flowi *flp, 50static void rr_select_route(const struct flowi *flp,
61 struct rtable *first, struct rtable **rp) 51 struct rtable *first, struct rtable **rp)
62{ 52{
63 struct rtable *nh, *result, *min_use_cand = NULL; 53 struct rtable *nh, *result, *min_use_cand = NULL;
64 int min_use = -1; 54 int min_use = -1;
65 55
66 /* if necessary and possible utilize the old alternative */
67 if ((flp->flags & FLOWI_FLAG_MULTIPATHOLDROUTE) != 0 &&
68 last_used != NULL) {
69 result = last_used;
70 goto out;
71 }
72
73 /* 1. make sure all alt. nexthops have the same GC related data 56 /* 1. make sure all alt. nexthops have the same GC related data
74 * 2. determine the new candidate to be returned 57 * 2. determine the new candidate to be returned
75 */ 58 */
@@ -90,15 +73,12 @@ static void rr_select_route(const struct flowi *flp,
90 if (!result) 73 if (!result)
91 result = first; 74 result = first;
92 75
93out:
94 last_used = result;
95 result->u.dst.__use++; 76 result->u.dst.__use++;
96 *rp = result; 77 *rp = result;
97} 78}
98 79
99static struct ip_mp_alg_ops rr_ops = { 80static struct ip_mp_alg_ops rr_ops = {
100 .mp_alg_select_route = rr_select_route, 81 .mp_alg_select_route = rr_select_route,
101 .mp_alg_remove = rr_remove,
102}; 82};
103 83
104static int __init rr_init(void) 84static int __init rr_init(void)