From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Julian Anastasov <ja@ssi.bg>
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: Fri, 23 Jan 2015 11:54:59 +0100 [thread overview]
Message-ID: <1422010499.505027.217827681.22B9051C@webmail.messagingengine.com> (raw)
In-Reply-To: <alpine.LFD.2.11.1501222135140.2572@ja.home.ssi.bg>
On Thu, Jan 22, 2015, at 20:57, Julian Anastasov wrote:
>
> 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...
Yes, noticed it too late.
>
> > + (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.
Yes, that aligns pretty much with how source routing should work. :)
> 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?
I agree, I don't see any other complications any more. Will send patch
soon. Thanks a lot! Also please feel free to add you SOB.
Bye,
Hannes
prev parent reply other threads:[~2015-01-23 10:55 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
2015-01-23 10:54 ` Hannes Frederic Sowa [this message]
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=1422010499.505027.217827681.22B9051C@webmail.messagingengine.com \
--to=hannes@stressinduktion.org \
--cc=fw@strlen.de \
--cc=ja@ssi.bg \
--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