public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: David Ahern <dsa@cumulusnetworks•com>
To: "Peter Nørlund" <pch@ordbogen•com>, netdev@vger•kernel.org
Cc: "David S. Miller" <davem@davemloft•net>,
	Alexey Kuznetsov <kuznet@ms2•inr.ac.ru>,
	James Morris <jmorris@namei•org>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6•org>,
	Patrick McHardy <kaber@trash•net>
Subject: Re: [PATCH v3 net-next 1/2] ipv4: L3 hash-based multipath
Date: Mon, 21 Sep 2015 10:52:13 -0600	[thread overview]
Message-ID: <560035BD.6090908@cumulusnetworks.com> (raw)
In-Reply-To: <1442348993-3023-2-git-send-email-pch@ordbogen.com>

On 9/15/15 2:29 PM, Peter Nørlund wrote:
> @@ -1094,8 +1142,15 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
>
>   	change_nexthops(fi) {
>   		fib_info_update_nh_saddr(net, nexthop_nh);
> +#ifdef CONFIG_IP_ROUTE_MULTIPATH
> +		fi->fib_weight += nexthop_nh->nh_weight;
> +#endif
>   	} endfor_nexthops(fi)
>
> +#ifdef CONFIG_IP_ROUTE_MULTIPATH
> +	fib_rebalance(fi);
> +#endif

The ifdefs everywhere make this harder to read. Just have a second 
definition above for fib_rebalance(fi) when CONFIG_IP_ROUTE_MULTIPATH is 
not defined.

Similarly an inlined macro of fi->fib_weight that compiles out if 
CONFIG_IP_ROUTE_MULTIPATH is not defined.

David

  parent reply	other threads:[~2015-09-21 16:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15 20:29 [PATCH v3 net-next 0/2] ipv4: Hash-based multipath routing Peter Nørlund
2015-09-15 20:29 ` [PATCH v3 net-next 1/2] ipv4: L3 hash-based multipath Peter Nørlund
2015-09-15 21:40   ` Alexander Duyck
2015-09-15 22:32     ` Peter Nørlund
2015-09-21 16:52   ` David Ahern [this message]
2015-09-23 19:22     ` Peter Nørlund
2015-09-15 20:29 ` [PATCH v3 net-next 2/2] ipv4: ICMP packet inspection for multipath Peter Nørlund

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=560035BD.6090908@cumulusnetworks.com \
    --to=dsa@cumulusnetworks$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=jmorris@namei$(echo .)org \
    --cc=kaber@trash$(echo .)net \
    --cc=kuznet@ms2$(echo .)inr.ac.ru \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pch@ordbogen$(echo .)com \
    --cc=yoshfuji@linux-ipv6$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox