[IPV4]: Kill MULTIPATHHOLDROUTE flag.

It cannot work properly, so just ignore it in drr
and rr multipath algorithms just like the random
multipath algorithm does.

Suggested by Herbert Xu.

Signed-off by: Pravin B. Shelar <pravins@calsoftinc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Pravin B. Shelar and committed by
David S. Miller
37e20a66 79165121

+1 -40
-3
include/net/route.h
··· 181 memcpy(&fl, &(*rp)->fl, sizeof(fl)); 182 fl.fl_ip_sport = sport; 183 fl.fl_ip_dport = dport; 184 - #if defined(CONFIG_IP_ROUTE_MULTIPATH_CACHED) 185 - fl.flags |= FLOWI_FLAG_MULTIPATHOLDROUTE; 186 - #endif 187 ip_rt_put(*rp); 188 *rp = NULL; 189 return ip_route_output_flow(rp, &fl, sk, 0);
··· 181 memcpy(&fl, &(*rp)->fl, sizeof(fl)); 182 fl.fl_ip_sport = sport; 183 fl.fl_ip_dport = dport; 184 ip_rt_put(*rp); 185 *rp = NULL; 186 return ip_route_output_flow(rp, &fl, sk, 0);
+1 -17
net/ipv4/multipath_drr.c
··· 57 58 static struct multipath_device state[MULTIPATH_MAX_DEVICECANDIDATES]; 59 static DEFINE_SPINLOCK(state_lock); 60 - static struct rtable *last_selection = NULL; 61 62 static int inline __multipath_findslot(void) 63 { ··· 110 .notifier_call = drr_dev_event, 111 }; 112 113 - static void drr_remove(struct rtable *rt) 114 - { 115 - if (last_selection == rt) 116 - last_selection = NULL; 117 - } 118 119 static void drr_safe_inc(atomic_t *usecount) 120 { ··· 137 int min_usecount = -1; 138 int devidx = -1; 139 int cur_min_devidx = -1; 140 - 141 - /* if necessary and possible utilize the old alternative */ 142 - if ((flp->flags & FLOWI_FLAG_MULTIPATHOLDROUTE) != 0 && 143 - last_selection != NULL) { 144 - result = last_selection; 145 - *rp = result; 146 - return; 147 - } 148 149 /* 1. make sure all alt. nexthops have the same GC related data */ 150 /* 2. determine the new candidate to be returned */ ··· 215 } 216 217 *rp = result; 218 - last_selection = result; 219 } 220 221 static struct ip_mp_alg_ops drr_ops = { 222 .mp_alg_select_route = drr_select_route, 223 - .mp_alg_remove = drr_remove, 224 }; 225 226 static int __init drr_init(void) ··· 228 if (err) 229 return err; 230 231 - err = multipath_alg_register(&drr_ops, IP_MP_ALG_RR); 232 if (err) 233 goto fail; 234
··· 57 58 static struct multipath_device state[MULTIPATH_MAX_DEVICECANDIDATES]; 59 static DEFINE_SPINLOCK(state_lock); 60 61 static int inline __multipath_findslot(void) 62 { ··· 111 .notifier_call = drr_dev_event, 112 }; 113 114 115 static void drr_safe_inc(atomic_t *usecount) 116 { ··· 143 int min_usecount = -1; 144 int devidx = -1; 145 int cur_min_devidx = -1; 146 147 /* 1. make sure all alt. nexthops have the same GC related data */ 148 /* 2. determine the new candidate to be returned */ ··· 229 } 230 231 *rp = result; 232 } 233 234 static struct ip_mp_alg_ops drr_ops = { 235 .mp_alg_select_route = drr_select_route, 236 }; 237 238 static int __init drr_init(void) ··· 244 if (err) 245 return err; 246 247 + err = multipath_alg_register(&drr_ops, IP_MP_ALG_DRR); 248 if (err) 249 goto fail; 250
-20
net/ipv4/multipath_rr.c
··· 47 #include <net/checksum.h> 48 #include <net/ip_mp_alg.h> 49 50 - #define MULTIPATH_MAX_CANDIDATES 40 51 - 52 - static struct rtable* last_used = NULL; 53 - 54 - static void rr_remove(struct rtable *rt) 55 - { 56 - if (last_used == rt) 57 - last_used = NULL; 58 - } 59 - 60 static void rr_select_route(const struct flowi *flp, 61 struct rtable *first, struct rtable **rp) 62 { 63 struct rtable *nh, *result, *min_use_cand = NULL; 64 int min_use = -1; 65 - 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 74 * 2. determine the new candidate to be returned ··· 73 if (!result) 74 result = first; 75 76 - out: 77 - last_used = result; 78 result->u.dst.__use++; 79 *rp = result; 80 } 81 82 static struct ip_mp_alg_ops rr_ops = { 83 .mp_alg_select_route = rr_select_route, 84 - .mp_alg_remove = rr_remove, 85 }; 86 87 static int __init rr_init(void)
··· 47 #include <net/checksum.h> 48 #include <net/ip_mp_alg.h> 49 50 static void rr_select_route(const struct flowi *flp, 51 struct rtable *first, struct rtable **rp) 52 { 53 struct rtable *nh, *result, *min_use_cand = NULL; 54 int min_use = -1; 55 56 /* 1. make sure all alt. nexthops have the same GC related data 57 * 2. determine the new candidate to be returned ··· 90 if (!result) 91 result = first; 92 93 result->u.dst.__use++; 94 *rp = result; 95 } 96 97 static struct ip_mp_alg_ops rr_ops = { 98 .mp_alg_select_route = rr_select_route, 99 }; 100 101 static int __init rr_init(void)