Skip to content

Commit

Permalink
[IPV4]: Kill MULTIPATHHOLDROUTE flag.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pravin B. Shelar authored and David S. Miller committed May 30, 2005
1 parent 7916512 commit 37e20a6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 40 deletions.
3 changes: 0 additions & 3 deletions include/net/route.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ static inline int ip_route_newports(struct rtable **rp, u16 sport, u16 dport,
memcpy(&fl, &(*rp)->fl, sizeof(fl));
fl.fl_ip_sport = sport;
fl.fl_ip_dport = dport;
#if defined(CONFIG_IP_ROUTE_MULTIPATH_CACHED)
fl.flags |= FLOWI_FLAG_MULTIPATHOLDROUTE;
#endif
ip_rt_put(*rp);
*rp = NULL;
return ip_route_output_flow(rp, &fl, sk, 0);
Expand Down
18 changes: 1 addition & 17 deletions net/ipv4/multipath_drr.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ struct multipath_device {

static struct multipath_device state[MULTIPATH_MAX_DEVICECANDIDATES];
static DEFINE_SPINLOCK(state_lock);
static struct rtable *last_selection = NULL;

static int inline __multipath_findslot(void)
{
Expand Down Expand Up @@ -111,11 +110,6 @@ struct notifier_block drr_dev_notifier = {
.notifier_call = drr_dev_event,
};

static void drr_remove(struct rtable *rt)
{
if (last_selection == rt)
last_selection = NULL;
}

static void drr_safe_inc(atomic_t *usecount)
{
Expand Down Expand Up @@ -144,14 +138,6 @@ static void drr_select_route(const struct flowi *flp,
int devidx = -1;
int cur_min_devidx = -1;

/* if necessary and possible utilize the old alternative */
if ((flp->flags & FLOWI_FLAG_MULTIPATHOLDROUTE) != 0 &&
last_selection != NULL) {
result = last_selection;
*rp = result;
return;
}

/* 1. make sure all alt. nexthops have the same GC related data */
/* 2. determine the new candidate to be returned */
result = NULL;
Expand Down Expand Up @@ -229,12 +215,10 @@ static void drr_select_route(const struct flowi *flp,
}

*rp = result;
last_selection = result;
}

static struct ip_mp_alg_ops drr_ops = {
.mp_alg_select_route = drr_select_route,
.mp_alg_remove = drr_remove,
};

static int __init drr_init(void)
Expand All @@ -244,7 +228,7 @@ static int __init drr_init(void)
if (err)
return err;

err = multipath_alg_register(&drr_ops, IP_MP_ALG_RR);
err = multipath_alg_register(&drr_ops, IP_MP_ALG_DRR);
if (err)
goto fail;

Expand Down
20 changes: 0 additions & 20 deletions net/ipv4/multipath_rr.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,12 @@
#include <net/checksum.h>
#include <net/ip_mp_alg.h>

#define MULTIPATH_MAX_CANDIDATES 40

static struct rtable* last_used = NULL;

static void rr_remove(struct rtable *rt)
{
if (last_used == rt)
last_used = NULL;
}

static void rr_select_route(const struct flowi *flp,
struct rtable *first, struct rtable **rp)
{
struct rtable *nh, *result, *min_use_cand = NULL;
int min_use = -1;

/* if necessary and possible utilize the old alternative */
if ((flp->flags & FLOWI_FLAG_MULTIPATHOLDROUTE) != 0 &&
last_used != NULL) {
result = last_used;
goto out;
}

/* 1. make sure all alt. nexthops have the same GC related data
* 2. determine the new candidate to be returned
*/
Expand All @@ -90,15 +73,12 @@ static void rr_select_route(const struct flowi *flp,
if (!result)
result = first;

out:
last_used = result;
result->u.dst.__use++;
*rp = result;
}

static struct ip_mp_alg_ops rr_ops = {
.mp_alg_select_route = rr_select_route,
.mp_alg_remove = rr_remove,
};

static int __init rr_init(void)
Expand Down

0 comments on commit 37e20a6

Please sign in to comment.