Netdev List
 help / color / mirror / Atom feed
From: Julian Anastasov <ja@ssi.bg>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: netdev@vger.kernel.org, Marcelo Leitner <mleitner@redhat.com>,
	Florian Westphal <fw@strlen.de>
Subject: Re: [PATCH net v2] ipv4: try to cache dst_entries which would cause a redirect
Date: Thu, 22 Jan 2015 21:57:14 +0200 (EET)	[thread overview]
Message-ID: <alpine.LFD.2.11.1501222135140.2572@ja.home.ssi.bg> (raw)
In-Reply-To: <1421930098.14431.8.camel@stressinduktion.org>


	Hello,

On Thu, 22 Jan 2015, Hannes Frederic Sowa wrote:

> I would try to not introduce this complexity. I am currently researching
> if this change does improve things:
> 
>         do_cache = res->fi && !itag;
> -       if (out_dev == in_dev && err && IN_DEV_TX_REDIRECTS(out_dev) &&
> -           (IN_DEV_SHARED_MEDIA(out_dev) ||
> -            inet_addr_onlink(out_dev, saddr, FIB_RES_GW(*res)))) {
> -               flags |= RTCF_DOREDIRECT;
> -               do_cache = false;
> +       if (skb->protocol == htons(ETH_P_IP)) {
> +               if (out_dev == in_dev && err && IN_DEV_TX_REDIRECTS(out_dev) &&
> +                   skb->protocol == htons(ETH_P_IP) &&

	Above is duplicate. Or better to remove first
and to keep this second check if flag is not cleared below...

> +                   (IN_DEV_SHARED_MEDIA(out_dev) ||
> +                    inet_addr_onlink(out_dev, saddr, FIB_RES_GW(*res))))
> +                       IPCB(skb)->flags |= IPSKB_DOREDIRECT;
> +               else if (IPCB(skb)->flags & IPSKB_DOREDIRECT)
> +                       IPCB(skb)->flags &= ~IPSKB_DOREDIRECT;

	It seems we do not need to clear the flag for
ip_options_rcv_srr purposes because ip_route_input is called
only if initial rt_type is RTN_LOCAL, so the flag should be
unset. ip_mkroute_input/__mkroute_input is called only for
forwarding.

	In ip_options_rcv_srr we have RTN_LOCAL ... [RTN_LOCAL]
and may be final RTN_UNICAST. The flag can be set and used
only for RTN_UNICAST and that is the final ip_route_input
called there. Lets keep it just with the 2nd ETH_P_IP check?

Regards

--
Julian Anastasov <ja@ssi.bg>

  reply	other threads:[~2015-01-22 19:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 12:41 [PATCH net v2] ipv4: try to cache dst_entries which would cause a redirect Hannes Frederic Sowa
2015-01-21 21:26 ` Julian Anastasov
2015-01-22 12:34   ` Hannes Frederic Sowa
2015-01-22 19:57     ` Julian Anastasov [this message]
2015-01-23 10:54       ` Hannes Frederic Sowa

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=alpine.LFD.2.11.1501222135140.2572@ja.home.ssi.bg \
    --to=ja@ssi.bg \
    --cc=fw@strlen.de \
    --cc=hannes@stressinduktion.org \
    --cc=mleitner@redhat.com \
    --cc=netdev@vger.kernel.org \
    /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