[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191211194705.GA486739@splinter>
Date:   Wed, 11 Dec 2019 21:47:05 +0200
From:   Ido Schimmel <idosch@...sch.org>
To:     David Ahern <dsahern@...il.com>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, jiri@...lanox.com,
        roopa@...ulusnetworks.com, mlxsw@...lanox.com,
        Ido Schimmel <idosch@...lanox.com>
Subject: Re: [PATCH net-next 3/9] ipv4: Notify route if replacing currently
 offloaded one
On Wed, Dec 11, 2019 at 10:40:09AM -0700, David Ahern wrote:
> On 12/10/19 10:23 AM, Ido Schimmel wrote:
> > +/* Return the first fib alias matching prefix length and table ID. */
> > +static struct fib_alias *fib_find_first_alias(struct hlist_head *fah, u8 slen,
> > +					      u32 tb_id)
> > +{
> > +	struct fib_alias *fa;
> > +
> > +	hlist_for_each_entry(fa, fah, fa_list) {
> > +		if (fa->fa_slen < slen)
> > +			continue;
> > +		if (fa->fa_slen != slen)
> > +			break;
> > +		if (fa->tb_id > tb_id)
> > +			continue;
> > +		if (fa->tb_id != tb_id)
> > +			break;
> > +		return fa;
> 
> Rather than duplicating fib_find_alias, how about adding a 'bool
> find_first' argument and bail on it:
> 
> 		if (find_first)
> 			return fa;
> 
> 		continue to tos and priority compares.
Sure, I'll change this tomorrow morning.
Thanks, David!
> 
> > +	}
> > +
> > +	return NULL;
> > +}
Powered by blists - more mailing lists
 
