From: David Ahern <dsa@cumulusnetworks•com>
To: David Miller <davem@davemloft•net>
Cc: netdev@vger•kernel.org, shm@cumulusnetworks•com, tom@herbertland•com
Subject: Re: [PATCH net-next] net: Remove VRF change to udp_sendmsg
Date: Mon, 31 Aug 2015 14:44:46 -0600 [thread overview]
Message-ID: <55E4BCBE.4070900@cumulusnetworks.com> (raw)
In-Reply-To: <20150831.124410.99199729741650263.davem@davemloft.net>
On 8/31/15 1:44 PM, David Miller wrote:
> From: David Ahern <dsa@cumulusnetworks•com>
> Date: Mon, 31 Aug 2015 09:29:40 -0700
>
>> Remove the VRF change in udp_sendmsg to set the source address. The VRF
>> driver already has access to the packet on the TX path via the dst. It
>> can be used to update the source address in the header.
>>
>> Update function based on OVS.
>>
>> Cc: Tom Herbert <tom@herbertland•com>
>> Signed-off-by: David Ahern <dsa@cumulusnetworks•com>
>
> This is worse.
>
> You have the source address in the VRF driver's output routine in
> fl4.saddr, just use it as-is.
The original saddr code in vrf_xmit was just wrong. It should not have
been there and was a leftover from early development days.
The saddr needs to be set in the dst output function (vrf_output) as I
did in this patch otherwise the packet hits the tcpdump tap with
potentially no source address.
>
> You're adding even more route lookups, at least the existing code
> just walks the device address less which is often cheaper than
> a full-blown route lookup.
>
TCP (and connected sockets) do not hit this lookup in vrf_output.
If anything I should be going straight to fib_table_lookup in the VRF
driver for this new lookup to get the source address. It knows the exact
table that should be used and hence can avoid the rules walk + local
table miss which happens using the ip_route_xxxxx functions as well as
the rth lookup/create which is not needed here.
Opinions before I work on another version?
David
next prev parent reply other threads:[~2015-08-31 20:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-31 16:29 [PATCH net-next] net: Remove VRF change to udp_sendmsg David Ahern
2015-08-31 17:02 ` Tom Herbert
2015-08-31 17:05 ` David Ahern
2015-08-31 17:22 ` Tom Herbert
2015-08-31 17:40 ` David Ahern
2015-08-31 17:58 ` Tom Herbert
2015-08-31 17:49 ` David Ahern
2015-08-31 19:44 ` David Miller
2015-08-31 20:44 ` David Ahern [this message]
2015-09-08 20:28 ` David Miller
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=55E4BCBE.4070900@cumulusnetworks.com \
--to=dsa@cumulusnetworks$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
--cc=shm@cumulusnetworks$(echo .)com \
--cc=tom@herbertland$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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