netdev
[Top] [All Lists]

Re: [PATCH] : bug fix in multipath drr code.

To: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [PATCH] : bug fix in multipath drr code.
From: pravin b shelar <pravins@xxxxxxxxxxxxxx>
Date: Tue, 24 May 2005 12:16:38 +0530
Cc: netdev@xxxxxxxxxxx, "David S. Miller" <davem@xxxxxxxxxxxxx>
In-reply-to: <20050523232224.GA25349@gondor.apana.org.au>
References: <4291CBFF.6080106@calsoftinc.com> <20050523232224.GA25349@gondor.apana.org.au>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050317)
Herbert Xu wrote:

On Mon, May 23, 2005 at 05:56:39PM +0530, pravin wrote:


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



You don't need all this code. All you need to do is do result = last_selection before the if condition and then check result in the if condition instead of last_selection.

The multipath_comparekeys isn't necessary either.



In concurrent invocations of drr_select_route() last_selection will
change to different route.
So in that case we can not  use last_selection route on basis of
FLOWI_FLAG_MULTIPATHOLDROUTE flag only, since old
route might be totally different due another invocation of same function.
So, I think multipath_comparekeys is necessary.

Please correct me if I am wrong.

Regards,
Pravin.

<Prev in Thread] Current Thread [Next in Thread>