From: Florian Westphal <fw@strlen.de>
To: Jarno Rajahalme <jarno@ovn.org>
Cc: Florian Westphal <fw@strlen.de>,
Pablo Neira Ayuso <pablo@netfilter.org>,
netfilter-devel@vger.kernel.org, kernel-janitors@vger.kernel.org,
dev@openvswitch.org
Subject: Re: [PATCH] nf_nat_packet: Clear skb hash after modifying packet headers.
Date: Sat, 30 Apr 2016 09:57:43 +0200 [thread overview]
Message-ID: <20160430075743.GA26902@breakpoint.cc> (raw)
In-Reply-To: <BF2D351F-29C4-49BA-9C97-231BB513DD23@ovn.org>
Jarno Rajahalme <jarno@ovn.org> wrote:
> In the OVS datapath we clear the skb hash whenever we change any of the fields that may be used to compute it. This guarantees that any given flow will get the same hash value when assigning packets to bond interfaces based on the skb hash. If the hash is not cleared, some packets may use the pre-nat hash provided by a nic, for example, while others may not have the nic provided hash and compute a new one post-nat. Also, if DNAT is used for load balancing, the hash should be computed after the NAT for the difference in the destination address to make a difference in the hash value.
>
> We could also clear the hash in the OVS datapath code after calling into nf nat, but could that still have the same issue with affecting the nf_tables tracing (of which I know nothing about)?
No, that would not affect nft.
Note that we could also remove the skb_get_hash() usage in nf trace (we
want to compute a pseudo-id that doesn't change while skb travels the
netfilter hooks).
For now I'd prefer if the hash reset would happen in OVS.
prev parent reply other threads:[~2016-04-30 7:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-20 21:31 [PATCH] nf_nat_packet: Clear skb hash after modifying packet headers Jarno Rajahalme
2016-04-29 9:09 ` Pablo Neira Ayuso
2016-04-29 9:12 ` Florian Westphal
[not found] ` <20160429091212.GL17538-E0PNVn5OA6ohrxcnuTQ+TQ@public.gmane.org>
2016-04-29 18:04 ` Jarno Rajahalme
2016-04-30 7:57 ` Florian Westphal [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=20160430075743.GA26902@breakpoint.cc \
--to=fw@strlen.de \
--cc=dev@openvswitch.org \
--cc=jarno@ovn.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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;
as well as URLs for NNTP newsgroup(s).