* [PATCH net-next] net: ipv4: remove fib_weight
@ 2017-09-28 2:08 David Ahern
2017-09-28 4:51 ` David Miller
2017-09-29 5:20 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: David Ahern @ 2017-09-28 2:08 UTC (permalink / raw)
To: netdev; +Cc: David Ahern
fib_weight in fib_info is set but not used. Remove it and the
helpers for setting it.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
include/net/ip_fib.h | 3 ---
net/ipv4/fib_semantics.c | 9 ---------
2 files changed, 12 deletions(-)
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 1a7f7e424320..f80524396c06 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -122,9 +122,6 @@ struct fib_info {
#define fib_rtt fib_metrics->metrics[RTAX_RTT-1]
#define fib_advmss fib_metrics->metrics[RTAX_ADVMSS-1]
int fib_nhs;
-#ifdef CONFIG_IP_ROUTE_MULTIPATH
- int fib_weight;
-#endif
struct rcu_head rcu;
struct fib_nh fib_nh[0];
#define fib_dev fib_nh[0].nh_dev
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 57a5d48acee8..be0874620ecc 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -601,17 +601,9 @@ static void fib_rebalance(struct fib_info *fi)
atomic_set(&nexthop_nh->nh_upper_bound, upper_bound);
} endfor_nexthops(fi);
}
-
-static inline void fib_add_weight(struct fib_info *fi,
- const struct fib_nh *nh)
-{
- fi->fib_weight += nh->nh_weight;
-}
-
#else /* CONFIG_IP_ROUTE_MULTIPATH */
#define fib_rebalance(fi) do { } while (0)
-#define fib_add_weight(fi, nh) do { } while (0)
#endif /* CONFIG_IP_ROUTE_MULTIPATH */
@@ -1275,7 +1267,6 @@ struct fib_info *fib_create_info(struct fib_config *cfg,
change_nexthops(fi) {
fib_info_update_nh_saddr(net, nexthop_nh);
- fib_add_weight(fi, nexthop_nh);
} endfor_nexthops(fi)
fib_rebalance(fi);
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: ipv4: remove fib_weight
2017-09-28 2:08 [PATCH net-next] net: ipv4: remove fib_weight David Ahern
@ 2017-09-28 4:51 ` David Miller
2017-09-28 13:25 ` David Ahern
2017-09-29 5:20 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2017-09-28 4:51 UTC (permalink / raw)
To: dsahern; +Cc: netdev
From: David Ahern <dsahern@gmail.com>
Date: Wed, 27 Sep 2017 19:08:00 -0700
> fib_weight in fib_info is set but not used. Remove it and the
> helpers for setting it.
>
> Signed-off-by: David Ahern <dsahern@gmail.com>
Hmmm, I wonder then what Peter intended in commit
0e884c78ee19e902f300ed147083c28a0c6302f0 ("ipv4: L3 hash-based
multipath") because that's where this came from.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: ipv4: remove fib_weight
2017-09-28 4:51 ` David Miller
@ 2017-09-28 13:25 ` David Ahern
0 siblings, 0 replies; 4+ messages in thread
From: David Ahern @ 2017-09-28 13:25 UTC (permalink / raw)
To: David Miller; +Cc: netdev
On 9/27/17 10:51 PM, David Miller wrote:
> From: David Ahern <dsahern@gmail.com>
> Date: Wed, 27 Sep 2017 19:08:00 -0700
>
>> fib_weight in fib_info is set but not used. Remove it and the
>> helpers for setting it.
>>
>> Signed-off-by: David Ahern <dsahern@gmail.com>
>
> Hmmm, I wonder then what Peter intended in commit
> 0e884c78ee19e902f300ed147083c28a0c6302f0 ("ipv4: L3 hash-based
> multipath") because that's where this came from.
>
You can see that fib_weight is set but not used in his patch either.
Perhaps it was an early idea that was replaced by the per-nexthop
nh_upper_bound and that code was not removed.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: ipv4: remove fib_weight
2017-09-28 2:08 [PATCH net-next] net: ipv4: remove fib_weight David Ahern
2017-09-28 4:51 ` David Miller
@ 2017-09-29 5:20 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2017-09-29 5:20 UTC (permalink / raw)
To: dsahern; +Cc: netdev
From: David Ahern <dsahern@gmail.com>
Date: Wed, 27 Sep 2017 19:08:00 -0700
> fib_weight in fib_info is set but not used. Remove it and the
> helpers for setting it.
>
> Signed-off-by: David Ahern <dsahern@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-09-29 11:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-28 2:08 [PATCH net-next] net: ipv4: remove fib_weight David Ahern
2017-09-28 4:51 ` David Miller
2017-09-28 13:25 ` David Ahern
2017-09-29 5:20 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.