Netdev List
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: cgel.zte@gmail.com, davem@davemloft.net, kuba@kernel.org,
	yoshfuji@linux-ipv6.org
Cc: netdev@vger.kernel.org, linl@vger.kernel.org,
	xu.xin16@zte.com.cn, Yunkai Zhang <zhang.yunkai@zte.com.cn>
Subject: Re: [PATCH v2 1/3] ipv4: Namespaceify route/error_cost knob
Date: Thu, 25 Aug 2022 08:23:56 -0700	[thread overview]
Message-ID: <6c0c312c-5b95-6650-e002-0ba76bbdd854@kernel.org> (raw)
In-Reply-To: <20220824020343.213715-1-xu.xin16@zte.com.cn>

On 8/23/22 7:03 PM, cgel.zte@gmail.com wrote:
> 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
>  
>  	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.

Also, why not ip_rt_error_burst as well? part of the same algorithm.


  reply	other threads:[~2022-08-25 15:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24  2:00 [PATCH v2 0/3] Namespaceify two sysctls related with route cgel.zte
2022-08-24  2:03 ` [PATCH v2 1/3] ipv4: Namespaceify route/error_cost knob cgel.zte
2022-08-25 15:23   ` David Ahern [this message]
2022-08-25 15:24     ` David Ahern
2022-08-30  9:47     ` CGEL
2022-08-24  2:04 ` [PATCH v2 2/3] ipv4: Namespaceify route/error_burst knob cgel.zte
2022-08-24  2:08 ` [PATCH v2 3/3] ipv4: add documentation of two sysctls about icmp cgel.zte
2022-08-25 15:27 ` [PATCH v2 0/3] Namespaceify two sysctls related with route David Ahern
2022-08-30  9:59   ` CGEL

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=6c0c312c-5b95-6650-e002-0ba76bbdd854@kernel.org \
    --to=dsahern@kernel.org \
    --cc=cgel.zte@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linl@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=xu.xin16@zte.com.cn \
    --cc=yoshfuji@linux-ipv6.org \
    --cc=zhang.yunkai@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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