Thread (9 messages) flat view 9 messages, 2 authors, 2022-08-30

Re: [PATCH v2 1/3] ipv4: Namespaceify route/error_cost knob

From: CGEL <hidden>
Date: 2022-08-30 09:47:18

On Thu, Aug 25, 2022 at 08:23:56AM -0700, David Ahern wrote:
On 8/23/22 7:03 PM, cgel.zte@gmail.com wrote:
quoted
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 795cbe1de912..b022ae749640 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -118,7 +118,6 @@ static int ip_rt_max_size;
 static int ip_rt_redirect_number __read_mostly	= 9;
 static int ip_rt_redirect_load __read_mostly	= HZ / 50;
 static int ip_rt_redirect_silence __read_mostly	= ((HZ / 50) << (9 + 1));
-static int ip_rt_error_cost __read_mostly	= HZ;
 static int ip_rt_error_burst __read_mostly	= 5 * HZ;
 
 static int ip_rt_gc_timeout __read_mostly	= RT_GC_TIMEOUT;
@@ -949,6 +948,7 @@ static int ip_error(struct sk_buff *skb)
 	SKB_DR(reason);
 	bool send;
 	int code;
+	int error_cost;
can be moved to below where it is needed
quoted
 
 	if (netif_is_l3_master(skb->dev)) {
 		dev = __dev_get_by_index(dev_net(skb->dev), IPCB(skb)->iif);
@@ -1002,11 +1002,13 @@ static int ip_error(struct sk_buff *skb)
 	if (peer) {
to here and then name it ip_rt_error_cost and you don't need to
		int ip_rt_error_cost = READ_ONCE(net->ipv4.ip_rt_error_cost);

make changes to the algorithm.
Yes, done.
Also, why not ip_rt_error_burst as well? part of the same algorithm.
done.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help